xampp apache server up and running, yet bad request - php

I got some trouble with my xampp on Win 10, as so many have had before me...
It's the same old port problem with skype and IIS.
I used to quit skype and stop the world wide web publishing service, but am sick of having to go through the whole ordial every time I start xampp.
so yesterday I changed the ports for my apache server and ecerything worked fine.
started up today and boom...localhost couldn't find my pages.
So I checked for port problems in xampp...there were none! apache was up and running(as were mysql server and filezilla). no error messages, nothing.
I resetted the ports to 80 and 443. killed of skype and the iis and everything worked fine again. Now whenever I change the ports, it will not run.
I did everything according to here:
How to change XAMPP apache server port?
(I changed the ports in httpd.conf, httpd-ssl.conf and in service and port settings )
I just don't get it. why it won't run with changed ports(and yes I checked the ports for being empty).
atm I have changed the port 80 -> 8024
and port 443 -> 1337 (no matter what I change this port to it always throws bad request)
8024 works fine. I can get to the dashboard via localhost:8024
but localhost:1337 gives me a bad request.
any suggestions, or similar encounters?
For now will have to continue using standart ports and kill of the 2 processes, but I really wanna skip that in the future.
I used port 80->8024
and port 443->448 yesterday and it worked fine...really weird...

Ok so that means your system has Microsoft IIS installed or one of the other bits of MS technology that reports that signature, they are doing that on later versions of Windows for some reason.
If you are not intending to use it you can uninstall it, it is not an integral part of windows so its being uninstalled wont effect normal operations of windows, and if you need to install it again later, it comes as part of the standard OS so you wont need to do anything perticularly clever.
So go to Start -> Control Panel -> Programs and Features
Click the 'Turn windows features on and off' link in the left hand menu.
Wait for the list to load and then find 'Internet Information Services'
Un check the check boxes for the following items ( you may not see all of them ), and there may be others I done know about. You may have all of these or just some of these.
IIS
Web Deploy 2.0 (Web Deployment Agent Service)
MS Sql Server Reporting service.
BranchCache ( Windows 8.1 )
SQL Server VSS Writer
List of possible service names not sure how up to date this is.
Tutorial on how to find what ports are in use on your system and what app is using them
Windows will then have a think for a while and then remove those applications, you will probably be asked to reboot to complete the uninstalls.
Reboot anyway when the uninstalls are complete.
Then try XAMPP again

Related

Easy PHP Apache Port Error Message

I am new to php and I would like to run a local testing server using easy php at home to work on school projects but when I try to start the easy php server, this error message pops up: Apache port (80) is already used by another application ! Close this application and try to run again the server It then gives me some instructions on how to close the application (by killing processes of selected ports), but when I right on the selected ports, the kill processes option is faded and not clickable. Maybe there something else I need to check or do on my computer to run this local host? Thanks for all help!
Just a shot in the dark but maybe try to close Skype, if you have that running, and then start the server? If I remember correctly Skype listens on port 80 by default. If that's indeed the issue then you can configure Skype not to listen on port 80 in its settings...
That might be related to Skype or the IIS server using port 80. You can configure Skype to use different ports in the preferences. You might try going to "localhost" in your browser and see what comes up as well. If it shows a Microsoft IIS server page then you know that the server is running. Disabling that or turning that off depends upon your operating system. You can probably just look that up on the internet if that is the issue.

Can't use port 80 or 443 for WebSocket on XAMPP

I've got a Windows 7 XAMPP setup that I use for quickly testing PHP code. I have been running tests with a PHP WebSocket script I wrote recently, and it works fine on every port I've tested except ports 80 and 443. Neither 80 nor 443 will work with the ws or wss protocol. When I try either port, absolutely nothing will go through and the script will just sit there running forever.
The official WebSocket spec (RFC 6455) states:
The WebSocket Protocol attempts to address the goals of existing
bidirectional HTTP technologies in the context of the existing HTTP
infrastructure; as such, it is designed to work over HTTP ports 80 and
443 ...
And:
By default, the WebSocket Protocol uses port 80 for regular WebSocket
connections and port 443 for WebSocket connections tunneled over
Transport Layer Security (TLS) [RFC2818].
And:
The port component is OPTIONAL; the default for "ws" is port 80, while
the default for "wss" is port 443.
So how am I supposed to get ports 80 and 443 to work?
Thanks.
Edit: Here's the first line of netstat:
I guess that means that I can't use port 80, right?
Typically, this sort of issue would mean one of the following:
Something is already listening on those ports; port bindings cannot be shared by multiple processes.
You may require escalated privileges and don't have permissions to open up a listener on those ports (lower-range ports are usually reserved).
To see if it's the first issue, try using netstat to see what ports you have listeners for:
netstat -a -p TCP -o -n
If it's the second issue, you may have to adjust the way you're running the server so it has the proper permissions.
There may be a workaround (I haven't tried this) to enable port sharing under Windows:
https://msdn.microsoft.com/en-us/library/ms733925(v=vs.110).aspx
...but the behavior may be hard to predict with that sort of setup. Another option is to set up a proxy in IIS (which I assume is what's hogging your port 80).
This answer was last revised on November 20, 2015 at 2 PM EST.
I discovered your question because it is similar to my own during the set up process to install and configure XAMPP on my Windows 10 laptop.
(I will explain in details what happened in my specific situation below, but before that I will put a very quick summarized answer to your question.)
I ran the XAMPP as administrator via right clicking it and choosing that option.
The port problems disappeared seemingly.
Now I can open it normally by left clicking it from the pinned icon on the taskbar without specifying administrator.
The latter result occurred after restarting my computer several times in a 24 hour period.
Wish I knew precisely what changed and how it worked, but it's working perfectly now as far as I can see.
I received some errors in the XAMPP Control Panel on November 17, 2015.
These errors said things similar to the following:
"unable to open process PID 4416"
"port 80 blocked"
"port 443 blocked"
"you are not running as an administrator"
Also, I should mention, that I am working through the steps in Chapter 2, Setting Up a Development Server, in the O'Reilly published text book 4th Edition of Learning PHP, MySQL, & JavaScript With jQuery, CSS, & HTML5 by Robin Nixon.
I also discovered that a command prompt "looking" box had opened which I did not know what to do with, and so I later closed it.
However, to get back on point, specifically it was important to me to set up with server and run it in as similar a way to the text book instructions as possible, so changing default port numbers did not appear to be a good option for me because I was not sure how alter the port number for one thing, such as the main port, might affect other ports, and other things on down the line.
I also was getting a bit confused by some other advice offered about searching, using various methods, to determine what other "things" might be interrupting the ports that my XAMMP was trying to use, akak my Apache server.
It actually appeared as though Apache was the source of the PID 4416, and that nothing was utilizing Port 80 or Port 443 at all. I also checked to see if Port 3306 was being used, because it is mentioned in the text book that it would be the default Port for MySQL, and it was not being used by anything else.
I check these PIDs by going to "Task Manager," then to "Details," then to "PID."
Then, in my Windows 10 laptop, I closed all open windows of any kind, even the XAMMP Control Panel.
Then, I typed XAMMP into the "Search Windows" bar.
When XAMMP appeared, I right clicked on it and chose to run it as Administrator.
When the Control Panel opened in this method, I received no error messages in the Control Panel for XAMMP.
However, when I pinned XAMMP to my task bar and tried to open it in a normal fashion (left-click to open) I received many errors.
But, when I right click on the pinned XAMMP icon on my task bar, and then right click again when the words XAMMP pop up, and then choose "run as administrator" it seems to be error free.
This is a work around type of solution.
I assume it might be helpful to some, but not all.
I hope it helps to shed light on similar issues.
I will be working to solve this completely.
It seems in this particular case I need to find a way to be sure the XAMMP automatically runs as adminisistrator when opened, and must require some adjustments that I simply have not discovered just yet.
I hope this is helpful to others! :)
Most of my knowledge is based in HTML5 and CSS3 and search engine optimization, and so I am working to learn more about server side, and dynamic / interactive scripting at this time.
P.S. Within 24 hours of this initial problem, after several restarts of my laptop, I was able to open XAMPP without error, in a normal fashion, by simply left clicking on the icon that I pinned to my taskbar.
I hope this is helpful as well. :)
Have a great day.

php server ERR_CONNECTION_REFUSED

I can't make a php server run on my local computer. I tryed with wampserver and Easy PHP. I checked the usage of my port:80, I changed the port from :80 to :8080, I gave Apache and mysql the permissions required on the firewall settings... I did everything, but when a type http://localhost with or without the port number browser answer is always the same:
ERR_CONNECTION_REFUSED
Can you help me, please?
While I think this questions is off-topic, I will try to answer it.
I have had problems with Skype and WAMP running at the same time. If you have Skype open, close it and WAMP, then open just WAMP. There is a setting in skype to use an alternate port. It has been covered thousands of times all over the internet.
Close everything you can think of.. Zone Alarm or any other software based firewall, disable Windows firewall, temporarily disable your AV if it has a built in firewall. I am not saying you should run without protection, but you need to identify what is causing the troubles. As far as hardware firewalls, I have a Linksys wireless router (built in firewall) and I have never had to do anything to get WAMP to work behind it.
If you have been messing with tons of settings in your WAMP, then just uninstall it and re-install it. You don't need to change your port to 8080 to get it working, and doing so would require you to always include :8080 in your URL (unless you have it listen on both).
With a stock WAMP, and everything you can think of closed or disabled, try again.
The WAMP icon should be green. Click on it, and go into both Apache and MySQL. They have a "services" sub-menu, where you can start/stop/restart the service. Start should be greyed out, and stop and restart should be available. If you see one of them not started, try clicking "start service". If it still won't start, then click "Install Service". Wait a minute. Then click "Start Service".
For some reason, when I freshly install WAMP, I have to manually install the service on one of them. I don't recall which one. Once I install the service, it then will work. You might have to click the WAMP icon again, and select "Restart All Services". Then go into the Apache and MySQL menus and make sure the services are started.
OK after about an hour of trying all of the fixes and youtubes I could find, I read Wade's approach. So with that knowledge I went:
wamp menu->apache->services->start/resume and boom localhost wamp page popped right up.
This was a fresh install the error for localhost was 404 err connection refused.
I hope this helps your frustration.

MySQL Abruptly Refusing Remote Connections

UPDATE
So I completely disabled my server's firewall and it appears to be the culprit. I had tried to disable certain rules before but disabling the whole thing worked. Very frustrating, but problem solved I guess... I think the key indicator that it was the firewall was because it happened at exactly midnight when my server likes to apply updates and such.
This is pretty strange to me, I have a server downstairs that hosts my websites and MySQL servers and it has been running for years without many issues. I have 2 routers bridged together behind my modem and my server is behind one of them. All other devices connect via WiFi. All of the proper ports are open on the router and I have users configured in MySQL that haven't changed and have been working fine this whole time.
So last night I was working on a project and I decided to sync everything with a backup on my SkyDrive. I have a scheduled backup for MySQL that runs at midnight (daily) and it just turned over to midnight so I decided to open my network and watch the file get populated before I sent a copy to my SkyDrive. After the backup was complete (which it did successfully), I was going to continue to work on my program but all of a sudden I can no longer connect via my local network to the MySQL server. I'm using PHP and my connection string never changed and all other MySQL admin tools don't connect. The live site works fine, so MySQL was definitely running and working but no remote connections were being accepted. Why is this happening all of a sudden?
Things I've tried :
I did notice that my logs were packed full of BINLOG errors so I turned off the binlog since I recently turned it on (a couple weeks ago).
Restarting MySQL
Turning off Windows Server 2008 firewall (temporarily)
Connecting from a different device (mobile phone, tablet), no luck
Temporarily allowing port 3306 on my router
Checked server logs for intrusion attempts, none present...
Setup :
PHP 5.4 on local machine and server
Windows Server 2008 Enterprise (on server...)
MySQL Version 5.5.25a
Does anyone have any clue as to what's going on here? I'm going to reboot my server when the load is low and see if this helps any, I will update this once it comes back online.
So I completely disabled my server's firewall and it appears to be the culprit. I had tried to disable certain rules before but disabling the whole thing worked. Very frustrating, but problem solved I guess... I think the key indicator that it was the firewall was because it happened at exactly midnight when my server likes to apply updates and such.

setting up remotely accessible wamp server along with iis

I am new to Windows IIS and I need to run a php/mysql application on it. For local php development on windows, I have found WAMP to be the easiest.
But can WAMP be used in this case instead of installing php and mysql separately ?
This needs to be done on an ec2 Windows 2003 instance. So far, I have already tried installing WAMP and setting up apache to listen on port 8080 instead of 80. From inside the remote desktop, both IIS and WAMP work properly in parallel on their respective ports.
However, when I try to connect from another computer using the ip address http://184.**.***.***, IIS works fine serving the default web page but cannot connect to apache on http://184.**.***.***:8080.
Is it possible to use WAMP at all for this purpose and if yes, would there be any disadvantages in using it instead of installing php/mysql seperately ?
Edit :
I dont know if this is a problem of blocked 8080 port. To verify this I stopped IIS and configured apache to listen to 80. Even then http://184.**.***.*** doent show the WAMP homepage. IS anything needed to be configured in IIS ?
RESOLVED :
Added the port 80 in Windows Firewall Exceptions and it started working.
Also, its necessary to select "Put Online" in the WAMP tray otherwise it gives a forbidden response as suggested by some answers.
Thanks
I haven't used EC2 in this way before, but broadly speaking, I'd encourage you to use the same server for development and production environments if at all possible - the installation effort can be a bit of a pain, but it's nothing compared to developing an app locally and then finding an IIS configuration issue causes it to break on production.
This approach also lets you keep your PHP configurations in source code control - php.ini and any modules you're using - and automatically deploy them alongside your application; again, forgetting to deploy the correct PHP.ini usually makes your application do crazy things...
So, your choices appear to be:
- switch off IIS and have WAMP listen to port 80. Not sure WAMP is designed for production level traffic, but in the past, I've run low-traffic public websites in this way.
- work out why port 8080 is blocked, and if it can be unblocked. This would still require you to run your website on an unusual port, which makes for ugly and hard-to-communicate URLs.
- install PHP on your IIS instance. One benefit of having installed WAMP is that MySQL should already be up and running, and the basic PHP installation should also be there; getting PHP to run on IIS is no longer a dark art ([http://php.iis.net][1])
For my money, I'd go for the latter option...IIS is a production quality server, and it's clearly what Amazon want you to use in this instance.
Of course, running IIS on your development environment may be a problem.
Have you put the server online? Think it is offline by default, meaning it's only accessible from your local machine. It's an option in the systray menu to put it online.
If I remember well, there is an option "go public" (or "put online") on the system traya icon of wamp.
This option modifies the httpd.conf to authorize public access.
You should give a try.
On a side note, you can make php work with IIS. This is another option to help you manage your server. (Mysql and Php have to be installed separatly but, this is very easy to do as far as I remember :) )

Categories