Apache Service detected with wrong path - php

Hej, I have problem with:
Apache Service detected with wrong path
4:31:33 PM [Apache] Change XAMPP Apache and Control Panel settings or
4:31:33 PM [Apache] Uninstall/disable the other service manually first
4:31:33 PM [Apache] Found Path: "C:\Apache\bin\httpd.exe" -k runservice
4:31:33 PM [Apache] Expected Path: "c:\xampp\apache\bin\httpd.exe" -k runservice
How to fix it? In advance, thank you.

I just encountered the exact same problem a few days ago and was having a hard time finding the fix, but I finally able to fix it.
Here's my fix:
Win + R and type regedit then enter
Open this directory HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Apache2.4
Right-click on the "ImagePath" and choose "Modify"
Change the Value Data field with your current installed path of apache in XAMPP
In my case, the value is "D:\apps\xampp\apache\bin\httpd.exe" -k runservice
For the question poster case, change the value to "C:\xampp\apache\bin\httpd.exe" -k runservice
I know it's an old post, but some people might still need this in the future. I hope it can help :)
UPDATE 12/7/2022:
This is due to our local machine already has Apache installed aside from XAMPP's Apache OR previously has installed XAMPP but in different folder directory. So my fix above is to change the Apache's target path to XAMPP's Apache path (In the folder where you installed xampp).
Another way to fix is to uninstall your existing Apache. You can find the folder directory from the error message that you got. the Found Path: C:\Apache\blablabla which could vary in every machine

I experienced the same problem. The solution that worked for me is :
Run the XAMPP in the administrator mode. Go to the XAMPP control panel.
In the modules section, in the 'Service' column, we are provided with checkboxes.'
For the services that you are facing problems with, click on the corresponding checkbox to uninstall the service.
Also, click on the same checkbox again to re-install the service.
I hope it works!

Try
Control panel > Administrative Tools > Services, after get de services name, in my case:
Apache2.4
mysql
Run "CMD" as administrator and put this command:
C:/windows/system32> sc delete Apache2.4
C:/windows/system32> sc delete mysql
Close Xampp Panel and try again.
Greetings from Mexico.

I was also experiencing the same problem for some days. Finally, I got the solution. Follow the given steps, that worked perfectly for me:
RUN the XAMPP Control Panel As Administrator
Below the Service column, you will see checkboxes, click on the checkbox to install it (if not already installed marked as RED CROSS) and if it is already installed, then uninstall it first by clicking on the GREEN TICK. Make sure the service is STOPPED
Then START the service again. That's all. Enjoy
Still not working, close the XAMPP, RUN it again as Administrator
Still not working, restart the PC (I have just experienced it)

Although Old Question but common problem for the new developers.
Solution for my case:
Run "CMD" as administrator and put this command:
C:/windows/system32> sc delete Apache2.4
restart the Xampp

It means you have Apache installed and running service from the location C:\Apache\bin\httpd.exe
You need to stop the service and start xampp

If you planing to work with XAMPP environment more comfortable way is:
Uninstall Apache (at C:\Apache\bin\httpd.exe)
Check Apache process at
C:\Apache\bin\httpd.exe if it in memory - kill it.

Change your port in the httpd.conf file, this might solve the problem because you might have a Node.JS server or Skype or another application running at port 80.

I will assume that you have uninstalled and reinstalled XAMMP multiple times, due to the fact that Apache has started the service with the wrong path. The key is to delete the service and restart XAMMP control panel

Related

DVWA setup - PHP function allow_url_include: Disabled

I am setting up a DVWA on a Linux VM in Google Cloud.
When I click Create/Reset Database, one line that appears to have issues is PHP function allow_url_include: Disabled.
I've tried enabling it in the php.ini file inside the cloned dvwa repo, as well as /etc/php/7.3/fpm/ and /etc/php/7.3/cli/ directories but alas, even after running sudo service nginx restart and hitting the Create/Reset Database button doesn't resolve the issue.
I've also tried both, On and "1" as values for allow_url_include but none of them seemed to make any difference.
Is there another hidden php.ini file I need to edit or what am I missing? Thanks!
Found two ways to solve it.
Restarting the VM itself.
Running sudo /etc/init.d/php7.3-fpm restart
Thanks, #behroozrazzaghi, for the links.

Error installing XAMPP: Windows cannot find -n

I've been trying to install XAMPP for quite some time now, but every time, at the end of the installation, it says:
Windows cannot find "-n"
And after that, it says:
Problem running post-install step. Installation failed (php.exe) Perhaps you have to install Visual C++ 2008 package.
I have Visual C++ 2008 package and it still says this. What do I do now? I have Windows 10 64-bit for anyone wondering.
I installed it in the root of my C: drive and it worked. Strange that previously I could just install it in my program files folder and that everything works...
Had the same problem when I tried to install xampp in a folder with spaces in its name (some folder example)
It was solved after I reinstalled xampp in a folder that has no space in its name, E.g. c:/xampp
Change your registry settings.
Open Registry Editor by pressing Windows + R key combination, type in regedit and press Enter.
If prompted by UAC, click on Yes to continue.
Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
In right-side pane, look for a EnableLUA and set the value to 0 and close Registry Editor.
Restart your computer.
Source: windows10update.com
Then type in XAMPP shell:
setup_xampp.bat
That error could be shown if you already had an older version of XAMPP installed to the default folder (C:\xampp) and you try to install a new version in a specific custom folder.
Just go to the Windows Control Panel, Add or Remove programs and uninstall the old installation of XAMPP.
I can confirm using Windows 10, that the "Windows cannot find -n" message is indeed based on the fact that you are installing XAMPP in a folder which is not c:\xampp.
That is rather a huge oversight for those who distribute XAMPP, they should allow relative paths.
I was trying to set XAMPP in c:\webservers\xampp\ because I'm working with multiple versions of servers for testing and development and well, there goes that idea.
Of course, in the end, I could always just do it myself, and get each bundle I need such as APACHE, mySQL, etc.. And that would mean, not relying on XAMPP.
Anyways, it's a rather stupid flaw, but it is what it is, and it's free, so, you pay for what you get! :)
An alternative to the current answers: I found that installing in a folder with a dash also didn't seem to work for me. E.g. C:\xampp-test\ would still give an error. Changing it to C:\xampptest\ solved the issue.
I ran setup_xamp.bat once (w/o admin rights) and it did some configuration for XAMPP but that did not help. When I executed setup_xamp.bat again with admin rights, it gave a message "nothing to do!".
While looking at the Apache config I realized it is trying to listen on port 80 and I already had IIS listening on that port. Which was causing the problem.
So I changed httpd.conf to use a different port 8765 (change needed at 2 places)
Also changed httpd-ssl.conf to use a different port 8766 (change needed at 3 places)
Then in XAMPP Control panel > Config > Services and Port Settings > specified same port number for Apache.
Once that was done I was able to start Apache without any error.

WAMP server in green but only get 404

Alright ladies and gents. I have quite the puzzling issue. I have WAMP server installed on my WIN7 machine at work, everything was working fine and dandy. Didn't use it for a few weeks because I got pulled into other things. The other day I tried to start it up... The icon was green and I figured we were good. Then I tried to open up localhost and just get a 404 error:
HTTP Error 404. The requested resource is not found.
I have no clue why it's doing this, we were working fine 2-3 weeks ago and now nothing. Have any of you had the green icon but couldn't get any pages to come up? Where in the heck do I go because I'm beating my head against the wall here.
Thanks in advance.
It is also possible that some other service is running on port 80 (maybe IIS Express, some Torrent clients, Skype..). A solution could be to change the port on which is being listened (as Mithun Sen has said).
So change the port on which Wamp listens:
Click on Wamp server -> Apache -> httpd.conf
Change Listen 80 to something else, eg: Listen 81
I would also change ServerName localhost:80 to ServerName localhost:81
If you've done this, and saved httpd.conf, you have to restart the Wamp server.
Then use localhost:81 as your root url.
So the urls will then look like
localhost:81/phpmyadmin
localhost:81/mysite_directory
For me, all I had to do was click the WAMP icon then click "Put Online", and it went online. It may be the case for someone else out there as well.
try changing the port :
click on the wamp icon -> Apache -> httpd.conf
change the 'Listen 80' to 'Listen 81'.
Restart Wamp.
Check if the port 80 is being used by any other service. In my case the icon was brown and server was online and apache service wasn't started.
Here is what I did to fix it:
In my case "Web Deployment Agent Service" was using the port blocking the apache from using it.
Stop the service and change its startup type to "Manual" in properties by default it is "Automatic", this will avoid the problem from reoccurring.
Please find more detailed information on how to find and stop the service in link below :
https://stackoverflow.com/a/35252219/5894548
Just in case anyone else has the same problem, I will post how I fixed my issue.
I recently wanted to update my PHP in WAMP to a newer version. When that didn't work, I just decided to download a newer version of WAMP with a newer PHP version. After downloading and installing all the Visual C++ Packages I installed the new WAMP. I also downloaded a fresh version of Joomla, and put the files in the wamp/www/ directory. I opened up WAMP, got the green light, then tried to install the new Joomla. When I entered the URL: http://localhost/joomla/installation/index.php the file wasn't found. I didn't notice that the new WAMP I downloaded had a file name of "wamp64". I took the joomla files out of wamp/www/ and put them into wamp64/www/ and finally the installation file was found.
Maybe this piece of info will save someone else from pulling out their hair.
If you get
HTTP Error 404. The requested resource is not found.
even Wampserver light is green check your port 80
probably it is being used by another services. So you should do them;
1- Click on Wampserver the go to Apache -> httpd.conf
2- Find Listen 80 and change it to Listen 8080
3- save .txt filen and restart Wampserver
Note: if you have same issue after you restart your computer while port number is Listen 8080
1-Change port number again like Listen 8081 and restart all services, then click LocalHost.
2- if page opens again great, but if you had an error then change the port number back to Listen 8080 and restart it, You will see it will works..
My issue was that the files weren't really there.
I ran into this since I was upgrading from 32-bit to 64-bit.
I had all my files were within Wamp while localhost was looking for files within Wamp64.
So, all I did was move files from Wamp/www -> Wamp64/www.
I was experiencing the same problem and I fixed it by changing the Apache port from 80 to 81:
You do not have to use 81. Just make sure it is not 80 and that you use a port that is free, not something that you are already using.
I think in my case the problem started when I installed Microsoft SQL Server 2012, I think a service or something took port 80 and then when Apache tried to use it, the port was already taken. Fortunately it is an easy fix by simply using a different port.
Make sure you restart Apache at the end.
check the port, it might not be 80

Apache/PHP - localhost stopped working. How do I get it to work again?

I have installed Apache2.2 on my computer, PHP 5, and MySQL. Everything was working fine until last night. Suddenly, I could no longer connect to the localhost. I think my computer was infected with a trojan, but that has since been removed and I am unable to reconnect to my localhost.
I have updated my hosts file Windows(C:)/Windows/System32/drivers/etc hosts in notepad: see attachment.
I have tested my connection in the CMD prompt see attachment.
You'll notice [::]1, but after updating my host file, it now displays as 127.0.0.1
Additionally, port 80 IS LISTENING
instead of my web browser loading the page as localhost/vote/home.php NOW it loads as file:///C:/Websites/Vote/home.php AND NOW my PHP no longer works i.e. not being pulled into my web page.
...can't establish a connection to the server at localhost.
Why is my local host not working? Thoughts? Thank you in advance.
Additionally, my web browser page does not time out when requesting localhost....
(I'm a new user so I am unable to post images)?
× 257296
if you put localhost/vote/home.php into your browser's address bar you should get an unabled to connect error,
not a redirect to a file. The only time the address bar will show file:///C:/Websites/Vote/home.php is if you open
that file directly in your browser.
Your details about why apache isnt working are not to clear, but you can try a couple of things.
First, how did you install apache, is it a service? you can check this by going to control panel > Administrative Tools > Services and
see if apache is in that list. If its, you have to start it, if its not then apache is not installed as a service and
you need to start it by running the executable. Go to the whichever directory your httpd executable is and run it.
Some things to try:
Make sure Apache is actually running, that it haven't failed during startup.
Check if it's listening to the expected port (80, or whatever you have configured it to)
> netstat -nb
Check your hosts file to make sure nothing fishy is going on there. localhost should point to 127.0.0.1, but maybe it's been set to point somewhere else by your virus thing.
If you can't figure it out, you can always try to remove/uninstall and try to set it up again. If this is a developer machine, I can recommend using the WAMP package installer instead of setting it all up yourself. It provides fairly easy switching between php/apache/mysql versions and easy switching on and off of most regular apache and php modules.
run command prompt as administrator and go to Apache bin folder (usually 'cd \apache\bin' ) and type httpd -k start. it worked for me with the same issue.
I had the exact issue. If you have a XAMPP control panel pull it up. There you will see XAMPP Control Panel Image the different modules that you have open... Apache will be one of them. In the 'Actions' column you will have 'Stop' adjacent to it. Hit the 'Stop' and wait about 1 minute for everything to calm down. The button will change to 'start' so hit it. This will reset Apache. It worked for me...Good Luck.
If you don't have the control panel on your desktop, go into your programs list and drop-down the XAMPP icon. The control panel is right there. Just click it and it will show

Localhost or phpMyAdmin not found on server: How to fix?

I followed installation instruction for PHP, MySQL and PHPMyAdmin. But when I tried to access http://localhost/phpmyadmin/, I got this error:
"Not Found The requested URL /phpmyadmin/ was not found on this
server.".
Then I tried to access just the localhost, still I got same error.
How can i fix this problem?
I'm using windows 7 (if this problem has something to do with that)
1 sudo nano /etc/apache2/apache2.conf
2 search insert: "Include /etc/phpmyadmin/apache.conf" at the bottom of file.
and restart apache2
sudo /etc/init.d/apache2 restart
you just need to delete cookies from your browser
press (ctrl + shift + delete) then
time range to clear : Everything
check -> Cookies then clear now
done.
There really isn't enough information to be able to give you a reasonable answer.
First check that your Apache is running. Goto your start menu and type services.msc into the text field.
Fairly high towards the top of the screen you will see ApacheX.X
See what the status of the service is. Try double-clicking on the Apache service and pressing Start if the service isn't running. If it has troubles starting you will get a message telling you the service couldn't be started.
I was just having this problem and i've come across an easier solution:
left click on the wamp tray icon
apache>
apache modules>
check the 'rewrite module'
bingo!
I just finished installing xampp 1.8.2 on WinXP XP2 machine and got same error show up on my Firefox 24.0 browser:
xampp Not Found The requested URL /phpmyadmin/ was not found on this
server.
I solved this problem by changing the proxy of my firefox browser, go to menu tools-Option find tab Network, click button settings. Fill the text box below No Proxy for with localhost.
In my case then it looklike:
192.168.1.0/24, localhost
Then press Ok, then Ok again.
Try now typing localhost/xampp then it should show Welcome to XAMPP for Windows!
Note: to change proxy for other browser may differ, check your browser help about how to change proxy.
Hope this help.
Most likely it is the port conflict for apache server, by default is must be using port 80. You can goto apache configuration file, http.conf and change the port to a different one like: Listen 0.0.0.0:10021
This solved my issue.
If using wamp, you can right click on wamp -> apache -> Use port other than 80, give a port number. Restart all wamp services.
If you are not able to access localhost :
One possible reason might be is your apache server is not started. Go to start menu of your computer and search services, open it, find Apache, start the program.(Considering all the configuration of PHP and Apache has done correctly)
If you are not able to access localhost/phpmyadmin :
First of all, add phpmyadmin folder to your working directory. Download it from https://www.phpmyadmin.net and unzip it. Add the folder to your working directory and change the name to phpmyadmin. Now you can access localhost/phpmyadmin. You will see a login page of PhpMyAdmin application. If you are seeing file directories instead of the login page, then go to your apache server's httpd.conf(apache/conf/httpd.conf) file. Edit it and change the index.html of DirectoryIndex to index.php
<IfModule dir_module>
DirectoryIndex index.php
</IfModule>
It also could be because you have changed the directory name, where the phpMyAdmin server sits. make sure the directory/folder name is correct and matches with the locations you used for Localhost to set up.
Also, make sure you have set up MySQL server.

Categories