Xampp Apache module not working - 'waiting for localhost' error - php

I have encountered a problem when trying to preview PHP files using the Xampp control panel Apache module. Basically I open the control panel, click 'start', and have it minimised on my screen. I then navigate to a PHP page that I want to preview in my browser - but when I try to load it, it just sits there and says 'Waiting for Localhost' on the tab. The page never loads. Has anyone ever encountered this problem before, and if so, is there a simple fix?
Regards,
Robert Young

This happened to me and the problem was that some other application was listening on port 80. I couldn't figure out what it was. Usually, it would be Skype so I shut down Skype and I still had a problem connecting to localhost. The other application was Audible Download Manager which automatically starts when I start windows and you can usually see in the windows task manager. Once I closed the app, localhost started working.
This is how you figure out which application is listening on port 80.
Go to Start, then Run or type cmd and open cmd.exe. Then type:
cd desktop
netstat -a -b -p TCP >port_list.txt
After command runs, port_list.txt will be saved on your desktop. Open port_list.txt and go through the list and find the application listening to :http. Then find the application under processes in your windows task manager and end the process.

I had similar issue... Here is what you can do:
Step 1: on xampp control panel checkout netstat & look if any other application is using that port as your xampp
( If yes then shut down those applications using Task Manager)
Step 2: Irrespective of Positive or negative results of step 1, Just Turn off your firewall through control panel.
In my case I just had to turn firewall off & it did the miracle.

Related

Failed to open the system default web browser. Is one installed? Pgadmin4

Just wondering has anyone come across this issue with pgadmin4?
Every time I go to open it, I get the following:
Failed to open the system default web browser. Is one installed?.
Thanks
In mac make sure the default browser is selected from System preference
Choose System Preferences from the Apple () menu.
Click General
Choose your web browser from the ”Default web browser”
If default browser is set, try to change it and try again. This should solve the problem.
My pgAdmin4 was working fine until today, and then I also received the following:
Failed to open the system default web browser. Is one installed?.
I updated to the most current version and still I received the error.
I did two other things before I fixed the problem so I'm not sure which solved it:
I remembered I got a strange pop up in my browser the day before. I ran a virus scan and a tracking cookie was found, I deleted it.
I changed my default browser from Edge to IE (in Windows 10) and then pgAdmin opened. I then put my default browser back to Edge.
I've killed pgAdmin, then removed .pgadmin folder from the home directory, and now it works like a charm :)
When running pgAdmin, wait for maybe 1-2 mins. It should automatically open in your browser. If you click the button to create a new pgAdmin window before that, it will fail because pgAdmin 4 isn't running yet. The wrong error message will be shown.
If changing the default browser to IE/chromium/chrome does not work, you can try running it as an administrator. That always works for me
I experienced this problem and then 24 hours later everything seemed to be working fine again. I did not delete my internet history, restart my PC or change my default browser. The problem just seemed to fix itself. If you have tried some of the suggestions above and the problem still persists. Then maybe in 24 hours time you will just be lucky and see the problem unexpectedly go away.
This happens because you have some other app listening on port 5432 or some other is already running on this port and pgadmin not being able to override it.
You can check if there are any other apps at this port (in local host at ip http://127.0.0.1) by running following command in powershell:
netstat -ano | findstr :5432
Possible fixes for this problem:
You can configure pgadmin to run at port other than 5432, by right clicking on pgadmin (elephant icon) in your notification shade and click on 'configure' and changing the port to something else, like 22 there.
Or, if you have already setup lots of applications to use postgresql on port 5432 and don't want to change the port, you can kill the application running on 5432 by running:
taskkill /PID 5280 /F
Replace "5280" with the number listed next to LISTENING when you run the first command. this will kill what was running at 5432. Now, you can should be able to run pgadmin without any problems.
Here you can see me finding the app, killing it, checking if it's running after having killed and then checking after running pgadmin:
In first command, I have checked what's running at 5432 port.
In second command, you can see that I have killed it.
In third command, I have checked if there's anything running again.
Then I started pgadmin and checked what's running at port 5432 in fourth and fifth commands. (I clicked on pgadmin and then ran this command quickly, that's the reason you can't see 'LISTENING' in fourth command.)
if you have this problem [Failed to open the system default web browser. Is one installed
]
I fixed that , just by setting another default browser ,in my case I was using Chrome, then I installed Firefox Mozilla but for pgadmin4 to work, you must find the file pgadmin4, that is in file programs :
postgresql/11/pgadmin4/bin/docs/en_US/html/
then you must replaced in the html file "browser" like default with another browser that you prefer (besides Internet Explorer).
The reason why most major browsers don't open up pgAdmin is that it is an applet and major browsers have dropped support for Java. Internet Explorer still supports Java applets at the time of this answer and thus works with IE.
The problem seems to be that pgAdmin4 runs in an old version of Flask, the two simplest options are:
Install it thru pip (not pacman or apt-get) in a virtual env, here is the tutorial from pgAdmin website
Use a different program like Dbeaver
It happens because PGAdmin didn't found a default browser, note PGAdmin is web-based tool and it needs a browser to run.
On windows, go to system settings and set your preferred browser as default browser.

PHP exec() , showing executed exe file in task manager but not displaying

i have used simple PHP script to execute exe file through php script, below is my PHP code
<? exec('"C:\Windows\notepad.exe"');?>
my problem is, when i check task manager after executing above code, notepad.exe is there but it is not diplaying
same way if i execute below mentioned code
<? exec('"C:\Program Files\WinSCP\WinSCP.exe"'); ?>
task manager shows WinSCP.exe, but winscp is not diplaying
can anyone tell me why applications are not showing ?
Whatever your web server is (Apache, Nginx, IIS...) it's clearly not configured to run with the credentials of your administrator user account. That's the sensible default. Background services are designed to run unattended.
You have several choice, from worse to better:
Kill security in your web server configuration. If web server runs as service, open Windows Service Manager and configure it to run with your account (don't forget to come back here if you change your password in the future). This way you allow any stranger in your computer, local network and/or internet to run programs in your name, in this case Notepad and WinSCP.
If the web server allows it, run it from a command-prompt in your own session. It's similar to #1 but will at least not run 24/7.
Any of the above, with a restricted account.
Don't use a web server. PHP can run from the command-line just fine, what means that you can even create a *.bat file and assign an icon to it.
As about your code, when it finally works your script will sleep until you close Notepad. This can be a bug or a feature depending on your needs.
Had the same problem with WAMP 2.4 & windows XP, the following helped:
Win+R, services.msc
edit wampapache and wampmysqld to allow affecting desktop.
Alternatively you can try:
Win+R, services.msc
edit wampapache and wampmysqld to log on as the same user.

wamp is not working and showing red icon on system tray please provide me a precise note for it

strong textI have installed wamp server but initially showing red icon & not responding recommend a exact working process .
If the wamp manager icon in the system tray is RED then neither apache or mysql has started correctly.
The ONLINE is something else completely. It says you have used the "Put Online" which just changes the apache config to allow access from any ip address or when Offline to only allow access from localhost, 127.0.0.1
Are you sure you dont have something else using port 80? IIS is most likely.
Run wampmanager->apache->services->test port 80 see what it says.
Have a look at your Windows Event Viewer, this will probably give you a clue to why apache and mysql have not started. Also te apache and mysql error logs.
When you get a clue drop back with a bit more information.
You could also try reading through this once you get apache and mysql running, by the way they are called wampapache and wampmysql in your services list.
I found this after looking / eliminating all alternates. Run the wampmanager.exe through task scheduler as at startup.
After restarting the server / desktop, go to task manager and select the "Aestan Tray menu" which is nothing but wampmanager.exe
Right click and select the properties window. As shown in the screen, click on the "Run Compatibility Troubleshooter". Follow the screen and based on your OS, it would show the compatible OS.
Select the OS and presto, the icon appears on the tray.
Best of luck.
Sriram

Apache not starting on windows 7

I'm a beginner in PHP. When attempting to start Apache using XAMPP, I saw the following error messages in my log:
11:42:18 AM [Apache] Problem detected!
11:42:18 AM [Apache] Port 80 in use by "Unable to open process" with PID 4!
11:42:18 AM [Apache] Apache WILL NOT start without the configured ports free!
11:42:18 AM [Apache] You need to uninstall/disable/reconfigure the blocking application
11:42:18 AM [Apache] or reconfigure Apache and the Control Panel to listen on a different port
11:42:18 AM [Apache] Attempting to start Apache app...
11:42:19 AM [Apache] Status change detected: running
How to fix these errors?
If you're running "Skype" from Microsoft, close it.
No just from the window, right click close/exit on the skype icon on the taskbar (in your clock) or kill the moth*** process in the task manager if you've been stucked for a while with this (it gave me some relief a few years ago), if works open skype and kill it again just to be sure.
If you're not running skype, try something from here:
http://www.sitepoint.com/unblock-port-80-on-windows-run-apache/
If you didn't click I will quote the article here:
The Obvious Candidates
There are a number of well-known Windows programs which use port 80:
IIS The most likely culprit is Microsoft Internet Information Server.
You can stop the service from the command line on Windows 7/Vista:
net stop was /y
or XP:
net stop iisadmin /y
SQL Server Reporting Services SSRS can remain active even if you
uninstall SQL Server. To stop the service:
Open SQL Server Configuration Manager.
Select “SQL Server Services” in the left-hand pane.
Double-click “SQL Server Reporting Services”.
Hit Stop.
Switch to the Service tab and set the Start Mode to “Manual”.
Skype Irritatingly, Skype can switch to port 80. To disable it, select
Tools > Options > Advanced > Connection then uncheck “Use port 80 and
443 as alternatives for incoming connections”. What’s Using Port 80?
Further detective work is necessary if IIS, SSRS and Skype are not to
blame. Enter the following on the command line:
netstat -ao
The active TCP addresses and ports will be listed — locate the line
with local address “0.0.0.0:80″ and note the PID value.
Now right-click the task bar and select Start Task Manager. Navigate
to the Processes tab and, if necessary, click View > Select Columns…
to ensure “PID (Process Identifier)” is checked. You can now locate
the PID you noted above. The description and properties should help
you determine which application is using the port.
The Task Manager allows you to kill the process, but be a little wary
about doing that — especially if it’s “NT Kernel & System”.
Microsoft-HTTPAPI/2.0
NT Kernel & System is an essential service. Stopping it will probably
stop Windows in a blue-screeny-like way. Therefore, enter the
following at the command line:
telnet 127.0.0.1 80
If you’re faced with a blank screen, type “GET” and hit return. The
chances are, you’ll see a line stating that Microsoft-HTTPAPI/2.0 is
listening on port 80. If that’s the case, open Services from
Administrative Tools and locate “Web Deployment Agent Service”. Stop
the service and set it’s startup type to “Manual”.
The Web Deployment Agent Service is deployed with WebMatrix and was
the cause of my woes. It may also be distributed with other
applications installed using Microsoft’s Web Platform Installer.
That caused me a few frustrating hours so I hope it solves your Apache
or WAMP start-up problems.
If you enjoyed reading this post, you’ll love Learnable; the place to
learn fresh skills and techniques from the masters. Members get
instant access to all of SitePoint’s ebooks and interactive online
courses, like PHP & MySQL Web Development for Beginners.
Stop all apaches and any web-servers you already running and then run xampp with admin privileges (click right button on app).
Open Service Control Manager [Start -> "services.msc" (enter)] and Stop the Following services if they are enabled and are not important you.
World Wide Web Publishing Service (IIS)
Web Client
Web Deployment Agent Service
Also check for applications like (Since PID is 4, the service must be from Microsoft so this is rare)
Skype
TeamViewer
VMWare Products (In very rare case, if you have configured)

XAMPP Apache and MySQL services not starting or stopping after first installation

Hi I want to start learning PHP and MySql and also polish my knowledge of Javascript witch is very limited at the moment having only use jQuery and knowing only the core sintax of the language.I choose to read Learning PHP MySQL and Javascript witch seemed to fit all my needs.
Having always had bad luck when installing something new I immediately hit a dead end with XAMPP 1.7.7.
The server runs corectly when is first installed and I can stop MySQL and Apache from running from the control panel.But if close the control panel and reopen it I get and error.
If when it was first opened I left apache and Mysql opened I get the error Apache Service not stopped [-1] the same goes for MySQL.If the services were close I get the same error that says apache service can't start same for MySQL.
I have tryed multiple instalations and the same thing happens.
I first tought I will install it and live them open so I can start working but sadly it didn't work corectly or I don't know how to run a PHP script corectly.
Here's what I did:
I opened PHPStorm and pasted this little scripped with a PHP extension :
<?php
echo "Hello world";
?>
After that I tried to run it but I get the error "PHP interpretor is not installed".
Shouldn't it have worked if the apache server was running?
You should wait after you stopped apache or mysql to let them clean things up. If you want to force them to end their processes, you can kill httpd.exe and mysqld.exe from task manager and then try starting it from xampp control panel.
Could it be that you are running Skype on the same machine? Its a known issue where Skype takes control over port 80 in order to become a supernode in the Skype network.
Go to Skype and in the "Tools" menu locate subsection "Advanced", option "Connection". There you'll find an option saying "Use port 80 and 443 as alternatives for incoming connections". Uncheck it, click "Save" and try restarting your server.
What OS are you using? Are you using the XAMPP control panel?
In windows press
Start
Run
Type "Services.msc"
Find the "Apache" service
Right click and stop
I find i get this error if i start the apache service without the control panel but try to stop it with the control panel.

Categories