When I try to start Laravel artisan on a Command-line using php artisan serve
, it works because I get the "Laravel development server started on http://localhost:8000/".
However, when I try to run 'localhost:8000' on my web browser, I get this 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\laravel\laravel/server.php' (include_path='.;C:\xampp\php\PEAR') in Unknown on line 0"
There could be multiple reasons for this problem one of the reasons is using old dependencies. step 1: Check your current version of PHP and version of dependencies if they don't match proceed to next step. step 2: replace the older dependencies with the newer one in composer. json file.
If you have a 500 Server Error, just rename the ". env. example" to ". env" and run: - php artisan key:generate - php artisan cache:clear - php artisan config:clear In my case, I pulled the project to Github repo to local machine.
The Laravel PHP artisan serve command helps running applications on the PHP development server. As a developer, you can use Laravel artisan serve to develop and test various functions within the application. It also accepts two additional options. You can use the host for changing application's address and port.
In your project folder, the server.php
file is missing so you got this error
The solution will to create another project then copy the newly created server.php this will solve it.
Another Solution is:
Run your project again in browser Now you will not get an error and the Laravel project will work properly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With