问题
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.
回答1:
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...
回答2:
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
回答3:
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.
回答4:
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! :)
回答5:
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
回答6:
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.
回答7:
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.
来源:https://stackoverflow.com/questions/39343698/error-installing-xampp-windows-cannot-find-n