You have a path issue.
The error message just says Sorry...cannot find php cli!
It does not say it can't find phpcli.exe
- so copying that file to the C:\xampp directory will not solve your problem.
Lets take a look at how you are receiving this error as I have been able to replicate it by simply renaming the C:\xampp\php
directory to C:\xampp\phpren
- it produced the Sorry...cannot find php cli!
The php-switch.bat file when I open for edit in a text editor contains this relevant bit of code:
if exist php\php.exe GOTO Normal
if not exist php\php.exe GOTO Abort
echo Sorry ... cannot find php cli!
echo Must abort these process!
So you see quite clearly that it is looking for php.exe
in the C:\xampp\php
directory not a phpcli.exe file
So if php\php.exe
exists go to Normal
- so in your case and in my case the php\php.exe
did not exists and went to Abort
and gave us the error.
The path to php\php.exe is relative to the php-switch.bat file.
So if the php-switch.bat file is in C:\xampp\php-switch.bat
And if the php\php.exe file is in C:\xampp\php\php.exe
and the batch file finds it there then the batch file will go to Normal
and proceed to offer us a php switch but if the batch file can't find it, then it will go to Abort
and give the error message we both received.
Having explained that to the best of my ability and been able to replicate your error then it is up you now to see why you are getting the error based on my explanation on your XAMPP installation.
The other possibility is that you have had another php installation or still do and the Windows environment path is sending requests to it perhaps or, after installing XAMPP a reboot may be required to have the C:\xampp path recognized.
To check your Windows paths and edit them to include the C:\xampp\php path go here:
(I have only XP but one would assume that your OS would be similar
Open the Windows Control Panel
Click on System->Advanced->Environment Variables
There are 2 path locations
Click on Edit
on both of these and add at the beginning
Then try again to run the batch file - you may have to reboot your computer to have the new paths recognized.