Error installing XAMPP: Windows cannot find -n

2020-03-01 03:01发布

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条回答
疯言疯语
2楼-- · 2020-03-01 03:21

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

查看更多
何必那么认真
3楼-- · 2020-03-01 03:28

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楼-- · 2020-03-01 03:33

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.

查看更多
可以哭但决不认输i
5楼-- · 2020-03-01 03:36

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.

查看更多
家丑人穷心不美
6楼-- · 2020-03-01 03:42

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

查看更多
ゆ 、 Hurt°
7楼-- · 2020-03-01 03:42

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
查看更多
登录 后发表回答