0

I'm attempting to get a PHP program running in Netbeans, but have been getting the "localhost refused to connect" error whenever I try and debug my test program, using either Google Chrome or Internet Explorer.

Following this question, I realised that my problem is that I don't have XAMPP installed on my system. So I've attempted to download XAMPP from here. After downloading the .exe to install, the following warning comes up, saying that I have to disable User Account Control in order to run XAMPP:

enter image description here

I've checked the installation instructions on netbeans.org, and they mention this being an issue on Windows Vista:

When the download is completed, run the .exe file. On Microsoft Vista, the User Access Control feature blocks the PHP installer from updating the Apache httpd configuration. Disable UAC while you are installing XAMPP. See Microsoft support for more information.

And in that, they've linked to Microsoft Docs basically explaining what UAC is in Windows Vista.

As I'm running Windows 10, not Vista, can I proceed with installing XAMPP without disabling UAC? It sounds dangerous to disable. Or is there an alternative method to successfully running PHP in Netbeans without going through this hassle?

Lou
  • 2,200
  • 2
  • 33
  • 66
  • 2
    I'm a web developer and i've never had trouble with this. I have not disabled UAC and never any issues regarding this. – Timberman Jun 09 '20 at 12:35
  • I'll proceed with the installation then, and see if I can get PHP working regardless. – Lou Jun 09 '20 at 12:36
  • 3
    Install XAMPP to `C:/xampp` rather into `Program Files` – RiggsFolly Jun 09 '20 at 12:41
  • Great, thanks for the advice. I've now got a PHP program running. If anyone wants to put in an answer for the rep then I can accept :) – Lou Jun 09 '20 at 13:03
  • [1] @Lou It would be helpful for the community if you post the answer yourself, and then accept it. I'll be happy to upvote. This issue has come up before, but without the explicit solution correctly proposed by RiggsFolly. [2] SO question [XAMPP installation on Win 8.1 with UAC Warning](https://stackoverflow.com/q/26208848/2985643) raises the same issue, but the selected answer is poor IMO, so I am loathe to propose it as a duplicate of yours. The crucial point is to avoid the `Program Files` directory rather than deactivating UAC, even though that is suggested in the error message you got. – skomisa Jun 10 '20 at 20:23
  • 1
    The developer of the setup package definitely should not be telling people to disable UAC. This would be an example of using a [global state to manage a local problem](https://devblogs.microsoft.com/oldnewthing/20081211-00/?p=19873). – Bill_Stewart Jun 29 '20 at 22:29

3 Answers3

4

So I proceeded with the installation of XAMPP as normal, and installed it into C:/xampp rather than Program Files as @RiggsFolly suggested. I've encountered no problems and have been able to run PHP programs since using Netbeans.

Lou
  • 2,200
  • 2
  • 33
  • 66
1

When the warning about UAC comes simply ignore it. Now the installer will try to install in c:\xampp by default. Do not change that path and allow the installation in c:\xampp. The message about UAC in the installer should be reworded to look less ominous.

0

XAMPP is the best localhost , but , sometime very difficult to adapt to...

NO , it not necessary to uninstall UAC , try to change the path of the program location and then install it, Should work correctly ##