0
votes

I have just install xampp and laravel and when I create a new Laravel project, and run php artisan serve, after a few seconds the server quits, and if I rerun it and go to 127.0.0.1, it gives me the error:

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'C:\xampp\htdocs\new_project\server.php' (include_path='C:\xampp\php\PEAR') in Unknown on line 0

And it's deleted the server.php file in the new project.

  • Windows 10
  • Laravel 5.8.34
  • PHP 7.3.8
  • Composer 1.9.0

    ps : i haven't any antivirus installed

1
I don't understand; if you have xampp installed, then why not just run laravel app as a virtual host via apache2, instead of running artisan serve? - Latheesan
ooh! is there any way to make the virtual host for a Laravel Project in Xampp! - saida lachgar

1 Answers

0
votes

php artisan:serve will host the application on 127.0.0.1:8000

You can create a virtual host in C:\xampp\apache\conf\extra\httpd-vhosts.conf.

<VirtualHost myproject.test:80>
  DocumentRoot "C:\xampp\htdocs\myproject\public"
  <Directory "C:\xampp\htdocs\myproject">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
  </Directory>
</VirtualHost>

And also edit your hosts file C:\Windows\System32\drivers\etc

Add the following line: 127.0.0.1 myproject.test