Reputation:
I just have installed laravel Authentication to my application and launch my server php artisan serve
at URL http://localhost:8000/ and I got the following errors .
I am using Xampp and Windows 10.And Xampp is installed in D root directory.
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'D:\xampp\htdocs\ecom/server.php' (include_path='.;D:\xampp\php\pear') in Unknown on line 0
Upvotes: 5
Views: 18621
Reputation: 60
this error is occur in Laravel due to server.php file missing in your project root directory
step1:
create server.php file in your project root directory
step2
paste below code in your server.php file
<?php
/**
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @author Taylor Otwell <[email protected]>
*/
$uri = urldecode(
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);
// This file allows us to emulate Apache's "mod_rewrite" functionality from the
// built-in PHP web server. This provides a convenient way to test a Laravel
// application without having installed a "real" web server software here.
if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
return false;
}
require_once __DIR__.'/public/index.php';
this is working for me
Upvotes: 0
Reputation: 997
Server.php make an Exception and your Anti-Virus like Avast delete it Automatically. Make turn off your Anti-VIrus Software. Hope this resolves your issue.
Upvotes: 5
Reputation: 481
Type your command line :
php -S localhost:8000 -t public
because port is not public
Upvotes: 5
Reputation: 201
try the following on your cmd line:
php -S localhost:8888 -t public
Make sure the "-S" is capitalized. Hope this resolves your issue.
Upvotes: 20