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

dgslide's avatar

FTP server not loading correctly

I've developed a laravel application for a school project, and we got FTP access to a server. I put all my files up, and if I don't run the "npm run dev" command beforehand, the whole site's CSS just doesn't get loaded. However if I run it it only works locally. How can I load the correct site for everyone visiting?

0 likes
12 replies
tykus's avatar
tykus
Best Answer
Level 104

After you run npm run prod locally, do you copy the build files up to the server?

dgslide's avatar

I get a "missing script: "prod"" error, even when I run build-prod. Sorry, I am new to this, tried troubleshooting on my own but couldn't get it to work.

tykus's avatar

@dgslide old habit... npm run build

The key question was whether you were properly copying the build results to the server.

dgslide's avatar

@tykus I will try that right now and I'll get back to you. If I understand this correctly, the 'npm run build' command builds everything under public/build, so that if i access the server everything looks as it should? Would I need to change anything in the code to access those?

tykus's avatar

@dgslide

Would I need to change anything in the code to access those?

That depends... I don't know your code.

dgslide's avatar

@tykus yeah my bad i worded it wrong, I just meant in general routes, image accesses and linking javascript code should work the same, right?

dgslide's avatar

@tykus I've not heard about either of those, I thought just uploading the files through cyberduck would work. Should I look into either of those to help get this thing to look as it does locally?

DaveDunlap's avatar

@tykus I'm a newbie trying to learn about this also. When you say " properly copying the build results to the server", what is the proper way to do that? I have copied everything up into a folder where I have setup Laravel, but am getting "Unable to locate a class or view for component [layout]." Yes, I did run "npm run build" before copying files.

Thanks

tykus's avatar

@DaveDunlap this is perhaps an issue with the directory structure on your server; where is the Laravel application relative to your public_html(?) or whatever directory you serve the application from?

Please or to participate in this conversation.