I am new in php and now i installed wampserver 2.2 application and when i click to Localhost option, the "Unable to connect" page shown in my Firefox browser.
this is my www folder:
And this is my index.php file:
<html>
<head>
<title> Hello To PHP Learning! </title>
</head>
<body>
<?php
echo 'Hello World';
?>
</body>
</html>
Have you installed the C++ Redistributable Package ?
You should install it before installing wamp!
Did you Tried
127.0.0.1
instead of localhost
IIS and Apache/Wamp are both web server and might conflict in some way, so you have to disable IIS in order for Wamp to work
Disable IIS :
Control Panel, Uninstall Programs, Turn Widows Features On or Off, uncheck Internet Information Services
if using skype, open skype > tools > options > connections > advanced > untick "use port 80 ..." then restart wamp then skype
There might be port problem in httpd.conf change it to 80 instead of other
ON LINE NO 40+
LISTEN 80
OR TRY TO CONNECT
The last but not least method
Try to uninstall WAMP Server and reinstall it in another Drive except same drive.
Your wamp server should be started (green icon in the tray), the Apache and PHP services should be ON.
In most of the cases wamp server launches Apache on default 80 port, which might be used (for example from Skype) when you try to start Apache, so kill processes that listen on port 80 before launching wamp.
Causes for ’404 error in wamp server’:
This problem happening for Port issue. You may be install some services which one taking Port 80. Like,
Skype
IIS Express Web Server
Some Torrent Clients
Teamviewer
...
So only ‘HTTP 404 error page not found’ happening.
Solution:
You have to change your wamp server Port number. Just do following simple steps,
Open httpd.conf file
After run your wamp server, left click taskbar Wamp green icon. Then go-to Apache->httpd.conf
(Otherwise open like: C:\wamp\bin\apache\apache2.2.22\conf )
Change Listen 80
There, Line number 46 having “Listen 80″.
Just replace 80 as “81″ like
Listen 81
Change ServerName localhost:80
And Line number 171 having “ServerName localhost:80″.
Just replace with same number as you used Line number 46. Like,
ServerName localhost:81
And save this file.
Use URL
Just restart your Apache or Wamp then use URL like following,
localhost:81 or
127.0.0.0:81 ( here 127.0.0.0: is your wamp IP )
localhost:81
Related
I've installed WAMP Server on Windows 10 and it was working fine. But when I try to load localhost today it gives me refused to connect error. I've read some questions on Stack Overflow and tried their answers but no luck.
Re-installed wamp (also tried xampp. non of these work)
IIS is off
Web Development.. thing in services is not running.
Tried netstat -aon and port 80 PID is same as wampapache64 process.
changed listening port to 81 in httpd.conf in wamp => apache =>
Cleared browser cache
Wamp icon is green
Can't connect using 127.0.0.1
Nothing works.
Screenshots:
I will assume the wamp icon in the system tray is green. I think you should start tracing the root cause from the apache error/access log.
Try change the http port to 8080 and access localhost:8080. left click the wamp icon in the taskbar, go to apache > httpd.conf and edit this file: change "listen to port .. 80" to 8080.
Try the hosts file with only the initial records and test.
127.0.0.1 localhost
::1 localhost
If you are facing the error from the apache errors log file
(OS 10038)An operation was attempted on something that is not a socket. : AH00332: winnt_accept: getsockname error on listening socket, is IPv6 available?
then do the following:
* Run 'command prompt' as administrator and run the command netsh winsock reset . and restart the PC.
Skype default port is 80 and this might be having a conflict .. try to change it from Skype options.
Finally make sure the antivirus or any firewall you are having is not blocking your application requests.
firstly, uninstall wampp as well as xampp server from your PC. Also delete the wampp/xampp folders in C drive.
then install wampserver 2.0i from the link below-
wampserver 2.0i
after installation, start wamppserver and try to open localhost in chrome browser.
if localhost doesnt work, then try localhost:80
hope it helps!!
I'm having a problem with my XAMPP Control Panel. The Apache won't run, I tried reinstalling it and allowed the Apache and its http.exe in my firewall. And I also tired editing the port Listen and its server localhost name in the Apache(httpd.conf) like what the other sites were suggesting. ( i don't have a Skype too) help.
skype might be the issue. Tools ->connection option-> uncheck "use port 80 ...." -> save and restart Skype and try
Ahh you have installed xamppp to C:\Program Files (x86), right? Have you reinstalled xampp to C:\xampp and tried?
Click on httpd.conf
and change Listen 80 to Listen 8181, now you can access it as http://localhost:8181 and here as well ServerName localhost:8181
OR
close your skpype and start it and then start using skype.
PS: You can use 80 from skype settings as well if you want to use 80 part with apache
I've installed wampserver. Yet it is always as a red tray icon.
Icon tooltip msg: local server - None of 2 services running.
Port 80 is not occupied; checked with Apache ► Service ► Test port 80:
Warning: chmod(): Permission denied in C:\wamp\scripts\config.inc.php on line 68
Impossible to modify the file C:\WINDOWS\system32\drivers\etc\hosts to be writab
le
The file C:\WINDOWS\system32\drivers\etc\hosts is not writable
***** Test which uses port 80 *****
===== Tested by command netstat filtered on port 80 =====
Test for TCP
Port 80 is not found associated with TCP protocol
Test for TCPv6
Port 80 is not found associated with TCP protocol
===== Tested by attempting to open a socket on port 80 =====
Your port 80 is not actually used.
Apache ► Service administration ► Install Service issues in a cmd window:
pressing Enter shuts the window down, nothing happens. Waiting gives no profit either.
What's wrong?
Update
Had attempts to change port number for Apache (both to 81 and to 8080) in httpd.conf:
Listen 0.0.0.0:8080
Listen [::0]:8080
ServerName localhost:8080
Checked whether IIS is runnig => No!
.
Doesn't help.
I had the same problem, and the solution was too simple:
"Run it as Administrator."
Without changing port or other additional configuration ...
You can do it by right clicking on the program icon and in the menu that appears, select the option "Run as administrator".
It is also possible to automate this process, by right clicking on the program icon and selecting "Properties".
Once the properties window is open, we go to the "Compatibility" tab. In the "Configuration" area we mark the option "Run this program as administrator".
Then we will click on "Apply" and then on "OK".
Ready! From now on, every time we run the program it will do so in administrator mode.
(Today, May 8, 2019, I see that #riggsfolly has responded in a comment much earlier than me. My recognition.)
I had same problem, tried change port and so on, but finally I installed older version (2.5 I think) and it works without any change of setting.
I think that IIS in install your windows
Change your port on httpd.conf
for example 81
Listen 0.0.0.0:80
Listen [::0]:80
ServerName localhost:80
to
Listen 0.0.0.0:81
Listen [::0]:81
ServerName localhost:81
and restart apache service
Open the httpd.exe in administration manually. The file is in wamp64\bin\apache\apache2.4.23\bin\. Then it works.
You can try this
Uninstall the wamp server
Click on the downloaded wamp file , and select Run as Administrator
Read and follow the Information Window that will pop up after one or two steps
Complete the installation
Still ? Check out http://forum.wampserver.com/read.php?2,134915
It can happen because of one of the three reasons:-
1) Missing VC++ installation: Install All versions of VC++ redistribution packages VC9, VC10, VC11, VC13, VC14 and VC15.. If you have a 64-bit Windows, you must install both 32 and 64bit versions of each VisualC++ package, even if you do not use Wampserver 64 bit.
2) You forgot to provide Admin Privileges to WAMP Server : Launch and Install with the "Run as administrator" option, very important.
3) WAMP, IIS and Skype fighting over same port :
Close Skype or force not to use port 80: http://forum.wampserver.com/read.php?2,134915
Disable IIS: http://forum.wampserver.com/read.php?2,134915
I am looking to create a powershell script or a batch file that can turn on IIS and 'active' php (add the proper environment variable [path will be where script is run from]). I looked around and saw things like pkgmgr, however its been depreciated, I need the script to run on computers ranging from Server 03 -> Server 12 and standard boxes like Vista -> Win10.
Which is the best way to achieve this and is there a way to have 1 script run on all boxes or do you need OS checks in the script/different scripts?
IIS and Apache should have different port.
To change the port of Apache(WAMP)
Click on WAMP icon that you can see on your tray or other shortcut icons for wamp.
Look for the Apache and open the httpd.conf or if you know where it is stored.
Find the "80" then change
Listen 80 to Listen 8080
ServerName localhost:80 to ServerName localhost:8080
Note: You can change the port which you desired as long as it will not conflict with your other port. It is more safe and common if the port is at this range.
Then click on Restart All Services.
To change the port of Apache(XAMPP)
Open file \xampp\apache\conf\httpd.conf
search following line(at 47 in default installation):
Listen 80
change the port 80 to another say 8080 as shown below:
Listen 8080
Also search following line(at 181 in default installation)
ServerName localhost:80
and change port 80 to 8080 as shown below:
ServerName localhost:8080
Open \xampp\apache\conf\extra\httpd-ssl.conf file.
search for "Listen 443" and change to "Listen 449"
search for "" and change to ""
search for "ServerName localhost:443" and change to "ServerName localhost:449"
Start the "setup_xampp.bat" and beginning the installation.
Double click on xampp_start.exe. It will start XAMPP.
Note: Do NOT close console window if it is not closed automatically. Keep it opened.
Start your browser and type http://127.0.0.1:8080 or http://localhost:8080 in the location bar. You will see XAMPP start page.
Now, you can work with both IIS and Apache servers.
I did not use PHP but had to install it for ganglia setup but could not access the php on calling localhost it shows IT Works .How do I know what is the port number .
The default port for HTTP is 80, so if in your browser you are using http://localhost and says "It works!" means it is working on port 80.
PHP is not a web server, you are probably using Apache. You can find its configuration files in /etc/apache2 folder. Look for apache2.conf, httpd.conf or ports.conf and find a line like "Listen (Port Number)"