How to resolve Apache port startup error? - php

When XAMPP starts, I am getting the error below. I have already tried all sorts of port settings (listen:xx, servername:xxx settings in httpd.conf, httpd-ssl.conf) provided in this SO question.
Error: Apache shutdown unexpectedly.This may be due to a blocked port, missing dependencies,
improper privileges, a crash, or a shutdown by
another method. Press the Logs button to view
error logs and check the Windows Event Viewer for
more clues
If you need more help, copy and post
this entire log window on the forums
All of the threads with similar questions were revolving around one answer -
"system port". I have already tried this and it didn't solve my issue.

Open XAMPP Control Panel and select Config under Apache. Select your httpd.conf and locate the following line.
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen **xx**
Where you see xx change this to something like 8080 if it currently states 81. Port 81 is commonly used by a few applications, so I tend to always change to 8080 by default, but your network may be different. You may obviously use netstat to see what ports may be available to you.
Restart XAMPP entirely as Apache is very fussy, then try starting Apache again.
Should changing ports not help, you can also try uninstalling and reinstalling the Apache service from the control panel through the following steps;
Start Xampp Control Panel
Uninstall Apache by clicking on Apache Module
Uninstall Mysql by clicking on Mysql Module
Again install both module by clicking on Xampp Control Panel.
Should both fail, there is an interesting guide here as well in case of duplicate services.

Related

how to get rid of default apache page "it works!"?

I created a virtual host on MAMP PRO 5 like this "mywebsite.test" but it does not open the local site unless I add :8888 so it has to be like this "mywebsite.test:8888" then I changed the Apache port to 80 and whenever I try to get them to local site using "mywebsite.test" is show me the default page of apache "it works!" instead.
I did uncomment this line
# Virtual hosts
#Include /private/etc/apache2/extra/httpd-vhosts.conf
in
/private/etc/apache2/httpd.conf
but still not working
any solution?
I just found the solution this could be helpful to anyone facing this same problem.
After contacting the support they told me to check indexes under Apache tab and it works
make sure the Apache port is at 80 and not 8888

How do I know what server name or web address was set on Nginx

I am trying to setup LEMP (Linux, Nginx, MySQL, PHP) stack on my PC to use with Wordpress.
I follow the instructions on this website. I see that the folder of wordpress in www folder was successfully extracted.
I can also verify that Nginx is running. However, I don't know how to get the wordpress index.php page on the browser.
On windows, I simply go to the browser and type localhost/webprojectfoldername or 127.0.0.1/webprojectfoldername
However, when I try to access the index.php of wordpress via localhost, I get the Apache page.
I would like to use Nginx as server but not Apache. I guess at this point, I don't know what servername or ipaddress to put on the browser to get to Nginx's page or Wordpress's index.php
I don't know how to identify the servername that was setup. On Windows, I simply use localhost or 127.0.0.1.
Any thoughts on how I identify it on Ubuntu?
I'd appreciate any help.
Thank you.
*** EDIT (Added Screenshot of Nginx configuration) ****
Either:
nginx is listening on a different port
By default, HTTP works over port 80, but when you connect to that port you are reaching Apache.
You need to find the port nginx is listening on (from the article you link to: listen 80 default_server; shows 80 but lets say it was 81) and connect to that instead: http://localhost:81/`
nginx and apache are trying to listen on the same port and apache won
You need to turn off Apache (and possibly restart nginx).

Localhost on Xampp not Displaying

I'm testing xampp setup, and when I enter localhost, the homepage doesn't display. The main port is 80, and SSL port is 443. I've tried removing the index and dashboard files, but that didn't work. PHP scripts are not running correctly.
You need to start the Apache.....
XAMPP has all logs in-built. Go to Apache > Logs > Apache (error.log) and do a quick search. In most of the cases you likely want to change the port Apache listens to.
Go to Apache > Config > Apache (httpd.conf) and find Listen 80. Replace it with any non-blocked port, i.e. Listen 8087. Save the file and start Apache again.

WAMP is not responding to external requests

Installed WAMPServer
Version : 3.0.4
OS type : 64 bit
Apache : 2.4.18
PHP : 5.6.19 / 7.0.4 (5.6.19 checked)
MySQL : 5.7.11
I've tried to look at the older overflow questions and answers and tried to do along as they said, however, I still do not have any connection to the wampserver.
What I've done to test
Use localhost on the host laptop to check if wampserver is operational
[SUCCESS]
Use my IP on host to check if wampserver is operational [SUCCESS]
Use my IP on other devices on the network in attempt to access a php file of the server in a directory. [FAILED]
Use other devices to on the network to ping my host [Request timed out x4]
Use tracert command as an alternative to 4 [Request timed out]
What I've done to the server
Modification to httpd.conf
Listen 12.34.56.78:80//commented
Listen 0.0.0.0:80
Listen [::0]:80
Dynamic Shared Object (DSO) Support//commented
miscellaneous for LOAD MODULE
ServerName localhost:80
Deny access to the entirety of your server's filesystem. You must
explicitly permit access to web content directories in other
blocks below.
Directory//This directory tag has no reference to server
AllowOverride All
Require all granted
Directory
DocumentRoot "E:/Server/wamp64/www"
Directory "E:/Server/wamp64/www/"
Options Indexes FollowSymLinks
AllowOverride All
# onlineoffline tag - don't remove
Require all granted
Directory
What I've done to the host laptop
Fresh installation of WAMP
Backup original httpd.conf
Edited httpd.conf (Refer above)
[FAILED]Added rule for port 80 to enable all - Deleted
Disable all rules for inbound for port 80
Look for rules in outbound for port 80 [NONE]
All of the steps I've described does not work at all. Has no experience in firewall configuration and WAMP configuration. And no virtual hosts except localhost
P/S: The example link I tried testing was 1.1.1.1/testPHP/testPHP.php. The host is Win10 while the device on the similar network tested was XP. Any advice is greatly appreciated.
The apache configuration seems correct.
Check this if you're using Wifi on server or client
Check if the router/AP has enabled something called Wifi Isolation, or Client Isolation.
I looked on a similar router like yours and there it's one option called Client Isolation on the Wireless Basic setup of your router. Uncheck it, save and retry.
Check this on the Windows firewall
Press on your keyboard WindowsKey+R, write control.exe. Press enter
Double click on Windows Firewall
On the left vertical bar select Advanced Settings
Click Inbound Rules
On the right pane click New Rule...
Select Port and click Next button
On the top leave TCP option selected. And below select Specific local ports and write there 80 or the port your apache uses. Looking to your Listen line on the apache config you should write here 80. Press Next
Leave selected Allow the connection and press Next.
Select the profiles of the Firewall you want to use for this rule. If you doubt select all. Press Next
Set a name for the rule, and press Finish
Try it another time ;-)
Found the problem. Win 10 apparently had this setting I have had forgotten about - Make this PC discoverable (OFF)
I turned it off in the heydays of using Win 10 because of privacy concerns. Now it can be accessed. The next step is to figure out the forbidden access.
Edit
The culprit for this post is the Windows 10 OS Settings. In order for all the settings to work (Assuming the person has done all the tinkering with httpd.conf and firewall and/or router), the PC hosting the server must be checked whether is the PC discoverable in the network settings.
How to make sure it is discovered
Open Network Settings by left clicking the network icon on your taskbar (either lan or WiFi) then click Network Settings right above the bottom most icons.
Select Advanced Settings
Under the item Make this PC discoverable, there will be a switch button. Make sure the button is turned ON otherwise, left click on that particular button.

I typed the wrong information into my httpd.conf for my WAMP installation ...

I just installed WAMP on my 64 Bit Windows 8.1 operating system. I changed a portion of my httpd.conf file that apparently was in error. I tried to follow instructions from a YouTube video and I really do not know much about WAMP or PHP. I am just trying to get started. How do I have to change the information below so that I can get Wamp to work properly.
I just installed it and since it was not working I followed some common advice I found online and tried to make some changes but nothing happened.
I also see there is a httpd.conf.build file that has disparate information from the httpd.conf file itself.
If I just installed WAMP on Windows 8.1 and only made the changes I have shared below ... how do I get my local server working so that I can test out PHP software on my local drive.
I really do not know what to do. I am just starting out with PHP and I cannot even get the WAMP to run when it is supposed to be an automatic installation.
I think I am asking the question in the right place because I made some custom problems for myself so I cannot imagine anyone else asked this exact same question. How did I mess up and how can I get my WAMP installation to run if I just installed it and only made the changes I am outlining below from the original file.
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78
Listen 0.0.0.0
Listen 8888
80 Dynamic Shared Object (DSO) Support
This is what that section of the httpd.conf file should look like
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 0.0.0.0:80
Listen [::0]:80
#
# Dynamic Shared Object (DSO) Support
Until you know what you are doing can I suggest that you make a backup copy of any config files before you attempt to change them.
If you really want to move APache to Listen on port 8888, and I suggest you dont. Instead work out what else is using port 80 and reconfigure that.
But if you must then try these changes to httpd.conf
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 0.0.0.0:8080
Listen [::0]:8080
#
# Dynamic Shared Object (DSO) Support
Then find the line
ServerName localhost:80
and change it to
ServerName localhost:8080

Categories