29

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.

chainboost
  • 527
  • 1
  • 4
  • 16
  • 1
    use a portable version :p – madalinivascu Sep 06 '16 at 08:06
  • @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 Sep 06 '16 at 08:13
  • 2
    @chainboost go on microsoft site http://answers.microsoft.com/en-us/windows/forum/windows8_1-winapps/cannot-download-xampp-error-windows-cannot-find-n/00d27767-d76d-4fd6-bea6-6eac23a40e9a?auth=1 – M. I. Sep 06 '16 at 08:17
  • 1
    lol you don't need a usb for a portable version man, just download and double click on the exe and it just runs – madalinivascu Sep 06 '16 at 08:28
  • Download the 2008 MSVC runtimes. Both 32bit and 64 bit. Install them and if they are already installed do a REPAIR [32bit 2008](https://www.microsoft.com/en-us/download/details.aspx?id=5582) and [64bit 2008](https://www.microsoft.com/en-us/download/details.aspx?id=2092) – RiggsFolly Sep 06 '16 at 08:31
  • @M.I. - The ms forum does not tell exactly why the error occurs. – MasterJoe Sep 27 '16 at 00:28

7 Answers7

12

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

chainboost
  • 527
  • 1
  • 4
  • 16
  • 2
    This solution works for me. The installer recommends to not install it in program files due to UAC issues in windows. Installing it in another folder will not help. Just choose the default c:\xampp suggested during the installation process. – MasterJoe Sep 27 '16 at 00:25
10

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

riorio
  • 6,500
  • 7
  • 47
  • 100
  • 1
    This worked. I tried to save it to my Program Files folder and it had a hissy fit. Tried to install in the I:/xampp folder and it was fine. Thanks @riorio – cbloss793 Aug 04 '17 at 21:56
5

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
Cole
  • 724
  • 1
  • 8
  • 24
Jibril
  • 81
  • 2
  • 5
4

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.

  • I wanted to keep the old xampp folder, and install to a custom folder on win10. Installing MS C++ 2008 redist, like proposed by the new xampp installer, did not work. Uninstalling xampp and deleting the old folder made the new installer run through in C:\xampp :) – Guntram Jun 12 '18 at 12:03
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! :)

cg_coder
  • 136
  • 1
  • 3
1

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.

Bram Vanroy
  • 27,032
  • 24
  • 137
  • 239
0

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.

Vivek Athalye
  • 2,974
  • 2
  • 23
  • 32