Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

metriakon's avatar

Laravel Mix bad path

Hi, how to properly change path to file in mix on shared hosting? After changing public path to public_html i get:

domains/domain.eu/appname/css/pages/home2.css

but i want to get a

domains/domain.eu/public_html/css/pages/home2.css
const mix = require('laravel-mix');

mix.setPublicPath('../public_html');
/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel applications. By default, we are compiling the CSS
 | file for the application as well as bundling up all the JS files.
 |
 */

mix.version(['css/pages/home2.css']);
0 likes
2 replies
martinbean's avatar

@metriakon You should not have public_html in your URLs. That should be the public root of your application.

metriakon's avatar

Can you explain? In public_html I have the files from public together with index.php that corresponds to the application folder

Please or to participate in this conversation.