So, ran into something very weird. Pretty new to Laravel.
Created a Laravel project and did some coding before running anything. I had previously created just a blank Laravel app and it was running just fine using all defaults. This was a second new project.
In the new project I can get Laravel running fine using php artisan serve --port=81 (non-default) but if I use just "php artisan serve" or "php artisan serve --port=8000" I get no response. Netstat shows no other processes using 8000, I've explicitly punched holes in Windows Firewall for that port and for php just in case. Nothing odd in hosts file. Not seeing anything that should be causing it.
There aren't any errors thrown when running php artisan serve, it comes up normally telling me it has started on port 8000. But whenever I try to access anything on that port it just doesn't respond. There's no "Whoops" message, it (Chrome or Postman) just sits there waiting for a response. Change it to port 81, 82, whatever, works as expected.
I have XAMPP installed though I'm not using it for Apache just now so Apache is turned off. Just for giggles I changed apache config to point at the public folder of that project on port 8000 and started it ... Worked fine; got the expected result from public/index.php.
Working with PHPStorm version 2017.2. I do have XDebug installed. Configured for port 9000. Not debugging via PHPStorm, just running artisan server.
PHP 7.1, Laravel 5.4, Windows 10
Any suggestions? I'm at a bit of a loss as I'm not seeing any errors anywhere and being rather new not sure where else to look/how to debug.
Holy poopies.
Got it figured out.
As it turns out, when I added XDebug for PHP I fat fingered the default port for that to 8000 rather than 9000 in PHP.ini. It was then intercepting all the http requests on that port and swallowing them up it seems.
Everything pointed to some sort of configuration setting but when looking at settings in PHPStorm it still showed XDebug as set for port 9000. Since that's what I thought I entered in PHP.ini I assumed it was pulling it from there so I never looked at the ini file directly.
Related
I spent a long time trying to figure out how to fix my Apache server on MAMP local host. I kept getting an error message saying that 'Apache couldn't start, because port 80 was in use by httpd'. Everyone seemed to think that another program was blocking port 80 (e.g. IIS, Skype, etc.). I tried finding these programs and removing them, but every time I did, the only program that was using port 80 was called System and I didn't think I could safely turn that off. I tried changing my port for Apache. Nothing worked until I found a solution saying that you could just change your php version in MAMP. I did this, and instantly Apache started working again.
My question is why would this happen? Why did changing my version of php fix Apache, and is there a way that port 80 could be blocked without another program being the reason.
Hope everyone is well
I have set up a LEMP environment on Ubuntu 18.04 WSL. I am using PHP7.1-FPM, Composer and NPM for an application running from a webserver.
I have set up the virtual host file and can browse to the webpage and open the application and connect to the database over localhost:80. But my issue is, it feels like there is almost a timeout on the LEMP setup. On the application, there is a 60-second timer where it automatically refreshes and pulls updated information from the MySQL database. If I press the inbuilt button to refresh it, that seems to work fine, but the minute it tries to do an automatic refresh, it throws up an error saying:
net::ERR_INCOMPLETE_CHUNKED_ENCODING
Uncaught (in promise ) Error: Network Error
at e.explorts
at XMLHttpRequest.f.onerror
I did try adding proxy buffers:
proxy_buffers 8 1024k;
proxy_buffer_size 1024k;
I feel as though Windows 10 is playing a part. from my knowlege, port 80 is in use on windows 10 from PID4 HTTP service which is used by the print spooler but when i set it to a different port, It does not even connect (1111).
I am just starting out really with this. I have (basic compared to most of you guys) knowledge in troubleshooting but WSL and LEMP is a new frontier to me so any help woul be much appreciated.
Many thanks in advance.
I think I know what the issue is, we use allow override in our vhost but this is not available on Nginx. It would mean me having to convert our vhosts file.
If anyone can assist with this, I would be most great full. In the mean time, I went with apache2 in wsl.
I am developing a web application in Laravel 5. I created the project in a local machine at my workplace and it runs just fine. But when i run the machine in another windows machine, it gives me an error The localhost page isn’t working with HTTP ERROR 500 as a server internal error.
I have also tried to look at the laravel.log file and found an exception Call to undefined function site_url() but don't know how to fix this.
Any idea on how to work around this is much appreciated.
This error is coming because you forgot to start laravel service.
If you wish to run your project on http://localhost:8000 Try with the following command :
php arisan serve
If you wish to choose specific port then try with the following command :
php artisan serve --port={port number}
Happy Coding :)
If you run local server by php artisan serve it will give url localhost:8000 by default and will run only in your machine to run in another machine of LAN you need to first find Local IP by ipconfig suppose you get this (192.168.2.10) then use this command.
`php artisan serve --host 192.168.2.10`
this will give url 192.168.2.10:8000 and can be access from any LAN connected machine.
In case none of this was working for you, there may be a more sinister explanation.
In our case, someone who shall go unnamed accidentally deleted the public/index.php file, and committed that to git! So taboo I didn't even think to look. This will stop ANYTHING in your site from running, including logging, but the server will go ahead, so there is nothing to go on, just a 500 error with no response or preview.
Again, seems ridiculous, but it was SO ridiculous who would even look for it?
please change your php version. you need to install php 7.2 version for laravel 5.6 version.
I have a working WAMP server with no problems on a Windows 8.1 Pro platform but i need to implement WAMP on several other machines all running a version of Windows (classroom environment). Some machines work perfectly fine, but others not so much. We are trying to reinstall WAMP but nothing seems to be working. The issue is
1.) every time i want to use WAMP i have to install all services before they can run. Then when i attempt to open a file on localhost i get an error that says service not found. Files are all in the right location (\www)
I have read that port 80 might be an issue but when we execute the port 80 test, no traffic issues. To be safe, we changed the port to 8080 and the same issues arrise.
Anybody have an issue like this or anything similar.
The soluton above will probably aslo do the job. When I was dealing with the same issue with Wamp on Win 10. All resolved by following steps:
open command line under as an administrator
make sure it is process with PID 4 listening to port 80:
netstat -o -n -a | findstr 0.0:80
change http process to use another port (i.e. 8000):
netsh http add iplisten ipaddress=0.0.0.0:8000
restart http service
net stop http
net start http
restart Xamp processes
i faced the same problem earlier, and the solution is
It should solve your problem.
Thanks
I'm trying to run a simple Laravel project inside a Vagrant (VirtualBox) VM. The guest is Ubuntu 14.04 x64, and the host is Windows 7 x64. I've set up port forwarding (8000 on host to 8000 on guest), but when I run php artisan serve, though I get a message stating that the server is running on port 8000, when I visit localhost:8000 on my host machine, Chrome tells me 'this webpage is not available'. There are two complications:
First, if I use curl from inside the VM, I receive the correct page contents - so it appears the server is working fine.
Second, if I run a Python web server using python -m SimpleHTTPServer on the same VM, I can access it fine on my host OS. Visiting localhost:8000, I see the directory contents listed. So it appears the port forwarding is working fine.
I tried deleting the public/.htaccess file in the Laravel project, to no avail. I'm no PHP expert, and this problem is hard to Google! Any pointers would be appreciated.
After reading this question I tried
php artisan serve --host 0.0.0.0
And it works fine now.