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

mac03733's avatar

vhost ?? php artisan serve ????

wat is need for using ... vhost or php artisan serve . so far i have just been using 127.0.0.1/appfolder/public

am on laravel5.6 and using xamp

0 likes
5 replies
NOMGUY's avatar

for

php artisan serve

there's no need of vhosts. if you're using a vhost, then you may run your project directly by entering your vhost name you've created.

NOMGUY's avatar
NOMGUY
Best Answer
Level 16

For creating a vhosts, Go to xampp/apache/conf/extra and open httpd-vhosts.conf and add these two things at the bottom:

<VirtualHost *:80>
    Document Root "C:/xampp/htdocs"
    ServerName localhost
</VirtualHost>

<VirtualHost *:80>
    Document Root "C:/xampp/htdocs/lsapp/public"
    ServerName lsapp.pro
</VirtualHost>

Save it. After that, open a Notepad as an Administrator. Click on File and select open. Then go to, C:/windows/System32/drivers/etc there you won't find any file, but hang on! From your dialog box select All files from the drop-down button near the Open button. Then you will see some files. Select hosts file and at the bottom add these two:

127.0.0.1 localhost
127.0.0.1 lsapp.pro
1 like
mac03733's avatar

so are there specific projects that require

php artisan serve

because i only started using it when i cloned a project and all it showed was a blank page when i try

127.0.0.1/appfolder/public

but worked whn i used

php artisan serve
NOMGUY's avatar
php artisan serve

is the command to run your laravel project on localhost. But if you're creating a vhosts, then you have to run it by entering your vhosts name in the browser directly. For ex:

lsapp.pro
NOMGUY's avatar

The projects that are not set to vhosts are started by,

php artisan serve

Please or to participate in this conversation.