Closed jafar690 closed 6 years ago
Trying add this file to root project folder https://github.com/laravel/laravel/blob/master/server.php
trying add this file.
<?php
/**
$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 one works with 5.5
`<?php
/**
$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.'/'.$uri)) { return false; }
require_once DIR.'/public/index.php'; ?> `
@AgusRdz i get a page not found in github for that url.
@luizhenriquesoares now i get this error in my terminal
✘ jafar690@gakami ~/school/laravel-gitscrum master ● art serve --port=8080 Laravel development server started: http://127.0.0.1:8080 [Wed Oct 25 17:07:03 2017] PHP Notice: Use of undefined constant DIR - assumed 'DIR' in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:07:03 2017] PHP Warning: require_once(DIR/public/index.php): failed to open stream: No such file or directory in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:07:03 2017] PHP Fatal error: require_once(): Failed opening required 'DIR/public/index.php' (include_path='.:/usr/share/php') in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:07:04 2017] PHP Notice: Use of undefined constant DIR - assumed 'DIR' in /home/jafar690/school/laravel-gitscrum/server.php on line 16 [Wed Oct 25 17:07:04 2017] PHP Notice: Use of undefined constant DIR - assumed 'DIR' in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:07:04 2017] PHP Warning: require_once(DIR/public/index.php): failed to open stream: No such file or directory in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:07:04 2017] PHP Fatal error: require_once(): Failed opening required 'DIR/public/index.php' (include_path='.:/usr/share/php') in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:07:04 2017] PHP Notice: Use of undefined constant DIR - assumed 'DIR' in /home/jafar690/school/laravel-gitscrum/server.php on line 16 [Wed Oct 25 17:07:04 2017] PHP Notice: Use of undefined constant DIR - assumed 'DIR' in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:07:04 2017] PHP Warning: require_once(DIR/public/index.php): failed to open stream: No such file or directory in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:07:04 2017] PHP Fatal error: require_once(): Failed opening required 'DIR/public/index.php' (include_path='.:/usr/share/php') in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:07:04 2017] PHP Notice: Use of undefined constant DIR - assumed 'DIR' in /home/jafar690/school/laravel-gitscrum/server.php on line 16 [Wed Oct 25 17:07:04 2017] PHP Notice: Use of undefined constant DIR - assumed 'DIR' in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:07:04 2017] PHP Warning: require_once(DIR/public/index.php): failed to open stream: No such file or directory in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:07:04 2017] PHP Fatal error: require_once(): Failed opening required 'DIR/public/index.php' (include_path='.:/usr/share/php') in /home/jafar690/school/laravel-gitscrum/server.php on line 20
@fatonsopa i get this error
✘ jafar690@gakami ~/school/laravel-gitscrum master ● art serve --port=8080 Laravel development server started: http://127.0.0.1:8080 [Wed Oct 25 17:08:02 2017] PHP Notice: Use of undefined constant DIR - assumed 'DIR' in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:08:02 2017] PHP Warning: require_once(DIR/public/index.php): failed to open stream: No such file or directory in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:08:02 2017] PHP Fatal error: require_once(): Failed opening required 'DIR/public/index.php' (include_path='.:/usr/share/php') in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:08:02 2017] PHP Notice: Use of undefined constant DIR - assumed 'DIR' in /home/jafar690/school/laravel-gitscrum/server.php on line 16 [Wed Oct 25 17:08:02 2017] PHP Notice: Use of undefined constant DIR - assumed 'DIR' in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:08:02 2017] PHP Warning: require_once(DIR/public/index.php): failed to open stream: No such file or directory in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:08:02 2017] PHP Fatal error: require_once(): Failed opening required 'DIR/public/index.php' (include_path='.:/usr/share/php') in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:08:02 2017] PHP Notice: Use of undefined constant DIR - assumed 'DIR' in /home/jafar690/school/laravel-gitscrum/server.php on line 16 [Wed Oct 25 17:08:02 2017] PHP Notice: Use of undefined constant DIR - assumed 'DIR' in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:08:02 2017] PHP Warning: require_once(DIR/public/index.php): failed to open stream: No such file or directory in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:08:02 2017] PHP Fatal error: require_once(): Failed opening required 'DIR/public/index.php' (include_path='.:/usr/share/php') in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:08:03 2017] PHP Notice: Use of undefined constant DIR - assumed 'DIR' in /home/jafar690/school/laravel-gitscrum/server.php on line 16 [Wed Oct 25 17:08:03 2017] PHP Notice: Use of undefined constant DIR - assumed 'DIR' in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:08:03 2017] PHP Warning: require_once(DIR/public/index.php): failed to open stream: No such file or directory in /home/jafar690/school/laravel-gitscrum/server.php on line 20 [Wed Oct 25 17:08:03 2017] PHP Fatal error: require_once(): Failed opening required 'DIR/public/index.php' (include_path='.:/usr/share/php') in /home/jafar690/school/laravel-gitscrum/server.php on line 20
@jafar690 You should setup virtual host (apache or nginx) and point to public folder in root project. If you want to run by php artisan serve, you must add server.php file to root folder project (this file is default when installing laravel project, perhap someone has deleted it). But if you run serve by php artisan serve, it is a PHP's built-in development server. And it is not stable. Typically, you may use a web server such as Apache or Nginx to serve your applications
I my own case I noticed that
require_once __DIR__.'/public/index.php';
is not this same as
require_once __DIR__.'./public/index.php';
on different servers
line 21 of server.php
i have just installed gitscrum but when i do an artisan serve, i get the following error on my terminal
Laravel development server started: <http://127.0.0.1:8000> [Mon Oct 9 19:34:47 2017] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0 [Mon Oct 9 19:34:47 2017] PHP Fatal error: Unknown: Failed opening required '/home/jafar690/school/laravel-gitscrum/server.php' (include_path='.:/usr/share/php') in Unknown on line 0 [Mon Oct 9 19:34:48 2017] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0 [Mon Oct 9 19:34:48 2017] PHP Fatal error: Unknown: Failed opening required '/home/jafar690/school/laravel-gitscrum/server.php' (include_path='.:/usr/share/php') in Unknown on line 0 [Mon Oct 9 19:34:48 2017] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0 [Mon Oct 9 19:34:48 2017] PHP Fatal error: Unknown: Failed opening required '/home/jafar690/school/laravel-gitscrum/server.php' (include_path='.:/usr/share/php') in Unknown on line 0 [Mon Oct 9 19:34:48 2017] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0 [Mon Oct 9 19:34:48 2017] PHP Fatal error: Unknown: Failed opening required '/home/jafar690/school/laravel-gitscrum/server.php' (include_path='.:/usr/share/php') in Unknown on line 0
i have installed everything correctly but i have not been able to get rid of this error, any help will be highly appreciated.