I used Laravel in Visual Studio code, and when I opened localhost:http://127.0.0.1:8000/ bypassing command php artisan serve, I got an error.
So I used another command php -S localhost:8888 -t public, I used this 8888 localhost. But I can't understand why localhost:http://127.0.0.1:8000 is not working.
This is an image of a browser:
you need to go at your laravel project path and run cmd after that run this command.
Another solution is here
php - Unknown: Failed opening required on line 0. laravel 5.6
Related
When running php artisan serve I get the error message:
$ php artisan serve
Starting Laravel development server: http://127.0.0.1:8000
sh: line 0: exec: : not found
Starting Laravel development server: http://127.0.0.1:8001
sh: line 0: exec: : not found
It will repeat trying to start on other ports but without success.
My installation worked fine a couple of days ago and I did not do any manual updates. What does the error message mean?
I also tested to setup a new Laravel project with laravel new test and I can properly launch this. So I assume that all my tools are still correctly installed.
I solved it by myself. I had some wrong variable in my .env file which messed up my php path. I deleted it and now everything runs fine:
PHP_BINARY="/opt/plesk/php/7.4/bin/php"
I used this to debug the site on my shared hosting server. Thanks everyone in the discussions for the good hints.
I'm working on a laravel app. I made the simple installation of a new laravel app, and in the previous days it was running great.
But now I'm not able to access my project in browser after running php artisan serve. The browser just says page not found and the buffering of that page is like infinite.
I tried to run the server in a different port with:
php artisan serve --port=9000
and then accessed it in http://127.0.0.1:9000/
It run well once, but then it stopped again.
You could try out the following:
php -S localhost:8000 -t public To run withe inbuilt PHP server
Make a fresh installation of a laravel project and copy your files into it.
It didn't work for me but I used composer:
php artisan serve --port=9000
Then it hanged. I press CTRL+C and I got it working without any errors
Try this, I got solved by these;
1) Change the default url to like this - localhost/<your-project-name>/public/ instead of default one 127.0.0.1:8000
or
2) use this php -S localhost:8000 -t public or php -S 127.0.0.1:8000 -t public
I am using windows 10 and wamp server and I am fresh installing laravel and all i get is this error message and is it necessary to do php artisan serve everytime i open laravel ? as long as i close cmd prompt localhost:8000 refused to connect .
Php artisan serve error
I think you are running a Laravel project blog by command php artisan serve and you are browsing your application by localhost:8000 or 127.0.0.1:8000
Your screenshot saying that when you are trying to visit a url which is not defined in your routes/web.php then, you are getting invalid request (Unexpected EOF) error in your cmd.
And of course! in this case when you close cmd then your Laravel app will not run.
So now, if you don't want to run your Laravel app by the following command each time, then you can use Laragon in windows environment.
Either you have to run php aritsan serve or set up a virtual host in your OS. Here is how to set up a virtual host in Ubuntu 16.04: How To Set Up Apache Virtual Hosts on Ubuntu 16.04
This is case, you can keep your cmd open. And open another cmd, redirect to file path where you are working and it should work fine.
Laravel does not work on after successful installation on mac. When I run the command: php artisan serve it is opened at http://127.0.0.1:8000/ as well as url of virtual host. (i.e. laravel.dev). After quitting the command php artisan serve if I make any change and refresh the browser, it displays blank page again.
It works with me when I change port 8000 to another one for example I use port 8080.
Try the following :
In your command line prompt try : php artisan serve --port=8080
Go to your browser with : localhost:8080
When I try to run a symfony console php command (generate:bundle, etc) in cygwin, I get an error similar to:
[Symfony\Component\Debug\Exception\ContextErrorException]
Warning: file_get_contents(E:/xampp/htdocs/foo_com/app/config/parameters.yml): failed to open stream: No such file or directory in /cygdrive/e/xampp/htdocs/foo_com/vendor/symfony/symfony/src/Symfony/Component/Yaml/Yaml.php line 61
If I delete the app/cache folder, I can run the app/console commands without any issues, until I access my page in the browser. Once I access my page in the browser I start to get this error again.
Try to do the following:
(assuming that you run windows 7):
run cygwin\bin\dash.exe as administrator
/usr/bin/rebaseall -v
run cygwin.bat as administrator
In my case it solved this problem.