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

carpad88's avatar

Problem with Mix manifest on shared hosting

Hi people,

I'm facing problems with an app deploy in a shared hosting. For security reasons the laravel app is located on

/home/myname/apps/laravel-app

while all the css and js are located in

/home/myname/public_html/laravel-app/

but I'm getting The Mix manifest does not exist.. What I should do to find the mix manifest? At the moment I've tried to add this code on the AppServiceProvider without luck

$this->app->bind('path.public', function() {
    return base_path() . '/../public_html/laravel-app';
});

Worth to mention I can't make npm run prod because the files aren't in the same folder

0 likes
10 replies
MichalOravec's avatar

In mix you can set

mix.setPublicPath('path/to/public');

mix.setResourceRoot('prefix/for/resource/locators');
Snapey's avatar

You should be building the assets locally then publishing them

I would not be running npm on the production environment?

carpad88's avatar

@snapey Actually I build the assets locally and after I load them to the hosting.

I think the problem is because the public folder is under public_html folder while all the app is outside so this change the path where to find the manifest

Snapey's avatar

rename public to public_html in your development environment?

carpad88's avatar

@snapey At the moment I change the AppServiceProvider like this and got it working

$this->app->bind('path.public', function() {
    return base_path() . '../../public_html/laravel-app';
});

So my guess is I have to set mix.setPublicPath('../../public_html/laravel-app'); next time I build my assets

ktsubouchi's avatar

Just out of curiosity, what's wrong with building assets in a production environment?

carpad88's avatar

@michaloravec It works binding the public path on the AppServiceProvider I haven't try setting it up not he mix configuration.

I'll make another deploy trying that option to see if it works

carpad88's avatar

@ktsubouchi I this case the app is deploy in a shared hosting where there is not possible to run npm so in order to get the app working I have to build my assets on local and upload them to the hosting.

Word to mention in local env all the app is out of the box in one folder while in production on this shared hosting just the public app is placed on the public_html while the other files are outside of public_html.

1 like

Please or to participate in this conversation.