PHP Warning: No such file or directory in Unknown on line 0

前端 未结 2 525
悲哀的现实
悲哀的现实 2021-01-21 03:55

I\'m using hosting in linux and configured subdomain in my website in Apache2 server. I\'m using laravel but I didn\'t use apache2 service by default. I\'m using laravel artisan

2条回答
  •  有刺的猬
    2021-01-21 04:50

    I had the same issue, the real cause of the problem is this, somewhere along the line, the last parameter for the php -S built in server was changed to a flag, so you have to call it like this:

    php -S 127.0.0.1:8000 -t public -f serve.php

    Before php 7.0.26 you could omit the -f.

    This is what happens under the hood when you call php artisan serve.

    If you want to serve it with php artisan serve you will have to override the ServeCommand and add -f before the serve.php ont the last line of the fire() method, like this:

    passthru('"'.PHP_BINARY.'"'." -S {$host}:{$port} -t \"{$public}\" -f server.php");

    For more details look at this stackoverflow post.

提交回复
热议问题