29
votes

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.

7
use a portable version :pmadalinivascu
@madalinivascu I don't have any spare USB's and it doesn't solve the problem I'm having. It worked before but yesterday I did a clean install of Windows and now it doesn't work.chainboost
lol you don't need a usb for a portable version man, just download and double click on the exe and it just runsmadalinivascu
Download the 2008 MSVC runtimes. Both 32bit and 64 bit. Install them and if they are already installed do a REPAIR 32bit 2008 and 64bit 2008RiggsFolly

7 Answers

12
votes

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...

10
votes

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

5
votes

Change your registry settings.

  1. Open Registry Editor by pressing Windows + R key combination, type in regedit and press Enter.
  2. If prompted by UAC, click on Yes to continue.
  3. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
  4. In right-side pane, look for a EnableLUA and set the value to 0 and close Registry Editor.
  5. Restart your computer.

Source: windows10update.com

Then type in XAMPP shell:

setup_xampp.bat
4
votes

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
votes

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! :)

1
votes

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.

0
votes

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.