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

mlazuardy's avatar

Error when hosting a Laravel site

im already have VPS server, when try to upload all my file, configuring anything inside it. and load the page, its just download the index.php ('without the extension of .php) how could this happen? all public of laravel its put inside the public_html, i see the server.php path folder is just public, do i need to change the server.php or anything? please fix it for me

0 likes
17 replies
squibby's avatar

Have you installed all composer dependencies etc?

tykus's avatar

Seems likely that PHP is not executing on the VPS. Make sure that PHP is installed, and your web server is configured to use it.

mlazuardy's avatar

@squibby i guess not, how to installed it? i mean from localhost or in the vps server?because i use windows and the server it hold by my Lecture, he busy to talk

tykus's avatar

Is the PHP module loaded on the web server? Does any PHP execute via web request?

tykus's avatar

Can you confirm that a PHP script will execute over a web request (even separately from Laravel)?

Make a temporary test file inside your public directory (public/test.php) and add some very basic php inside, e.g.

<?php

phpinfo();

Then hit that file directly http://domain.tld/test.php and see if the script executes.

mlazuardy's avatar

the script isn't execute sir, it download the test.php. what happen ?:(

ejdelmonico's avatar

That tells me you are probably using Apache and it is not configured to use php and serve php pages.

mlazuardy's avatar

yeah im using apache, how to serve the php sir? i dont have much knowledge about hosting

aardalich's avatar

I think you're about to either

  1. Read lots on how to be an unix administrator (google things like the linux distro you are using, and php on apache / php on nginx if you end up going that way)
  2. Find someone with the knowledge to install the right things and set them up for you
  3. Use a service that does it all for you, like https://forge.laravel.com
mlazuardy's avatar

The administrator is being held by muly lecture sir, i dont know how to deal with with this, in the php editor i already setup the eaphp7

andreasbakir's avatar

use serverpilot.io it is free and they will setup your whole server with the best config

mlazuardy's avatar

i just want to publish my site sir, not the server, this VPS is own by my College, this error dont make me mad but this is my first step to be a web developer

Thyrosis's avatar

Not to be rude, but the first step to become a web developer should be to make sure you have the correct tools to work with and, if you don't have them, either get them or get someone to get them for you. All of us are developers here, but only some of us know a few bits and pieces on server management. Everybody else uses things like Homestead, Valet or Forge.

What you need is a working server. If your VPS was provided to you by your college or lecturer, go back to them and tell them your servet isn't set up properly. If your lecturer is 'too busy' to answer your question: Im sorry but what on earth are you doing there then? He gets paid to teach you. Answering questions is what he does, or at least should do.

So there you have it. The problems you run in to are none to be solved by us, they need to be resolved by the person who manages your server. And unless that person should be you as part of your tuition, you should direct your questions at them.

mlazuardy's avatar

a little question sir, where the composer should be install?

Please or to participate in this conversation.