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 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! :)
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.
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 toC:\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 executedsetup_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.
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...
Change your registry settings.
Source: windows10update.com
Then type in XAMPP shell: