php-switch can't find phpcli

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Postby romu31 » 10. August 2008 23:33

I got this problem twice :

1st time : i got an old PhP varibale in my environemment variable ( it php.ini variable or something like that.I had this varible when i installed easy php , & when I removed easy php , the variables was still in path) .

better to remove it if u dont use it .

2nd time : new vista computer, I had to remove the control (the window who pops each u run a program) . after that no troubles ( except that i have to run apache with .bat & not from the control window).
romu31
 
Posts: 1
Joined: 10. August 2008 23:27

Re: php-switch can't find phpcli

Postby cssjunkie » 04. December 2008 19:04

I just installed xampp on XP/SP3 and it's working fine, but I get this same "can't find php cli"
message as the others. I've looked and indeed there is a php.exe in the php folder, and that
folder is together with php-switch.bat, and in that file the text does say:

if exist php\php.exe GOTO Normal

I don't see why I'm getting the error message. The desired file is right where it's
supposed to be, isn't it?
cssjunkie
 
Posts: 2
Joined: 04. December 2008 18:57

Re: php-switch can't find phpcli

Postby Sharley » 05. December 2008 00:19

Yes, your files appear to be in the correct locations but as an issue comparison, Apache likes exclusive use of port 80 and if IIS or Skype are using port 80 then Apache simply won't start.

Similarly, Apache uses exclusively the php.ini file in the .\xampp\apache\bin folder and if the PC System has an alternative path in the System\User Environment Variables then Apache\PHP will not function without issues.


You may have had or still have another instance of PHP, which Izzy mentions in his more than comprehensive troubleshooting posts, that residues after uninstalling the other PHP instance may also be the cause of this error message - Eclipse for example is known to have it's own PHP instance and to change the Environment Variables with it's own path to the php.ini file.

Open http://localhost and click on the phpinfo() link and look for this line:
Loaded Configuration File C:\xampp\apache\bin\php.ini - your path to xampp may be slightly different.

If your line has any different php.ini location then you may have to do some tweaking.

Izzy wrote: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
User variables->PATH
System variables->Path

Click on Edit on both of these and add at the beginning
C:\xampp;C:\xampp\php;

Click OK Click OK Click OK

Then try again to run the batch file - you may have to reboot your computer to have the new paths recognized.

Also when in the above Environment Variable window check for an entry PHPRC which may include the other PHP instance's path which will also cause the PHP included in XAMPP to use the wrong php.ini file - I don't have that entry so it would be safe to assume that removing that entry or editing the path location will be of help.

Once you have the phpinfo() showing it is using the correct Loaded Configuration File (C:\xampp\apache\bin\php.ini) then you should be able to switch php versions without issue.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: php-switch can't find phpcli

Postby cssjunkie » 05. December 2008 02:43

Sharley wrote:Open http://localhost and click on the phpinfo() link and look for this line:
Loaded Configuration File C:\xampp\apache\bin\php.ini - your path to xampp may be slightly different.

If your line has any different php.ini location then you may have to do some tweaking.


But it doesn't, that's exactly what appears in that line.
It's just as I feared, my computer harbors an evil spirit.

:x

I also checked the paths as you suggest (just for fun), but I can't
find the specific user and system variable paths at all, they just
aren't listed. Oh well.
cssjunkie
 
Posts: 2
Joined: 04. December 2008 18:57

Re: php-switch can't find phpcli

Postby Sharley » 05. December 2008 03:09

cssjunkie wrote:I also checked the paths as you suggest (just for fun), but I can't
find the specific user and system variable paths at all, they just
aren't listed. Oh well.
That's strange but not a problem.

When you have the EV window open select New under User variables and create the PATH on line Variable name and then Variable value line add C:\xampp;C:\xampp\php; if those paths are correct on your XAMPP installation.

...And again under the System Variables - New on line Variable name add Path (note the different case) and then C:\xampp;C:\xampp\php; on line Variable value.
Click OK and see if it works - you may have to reboot to get the paths recognized by the OS.

If that doesn't fix it then is time to have your PC exorcised of all evil spirits and other MS voodoo implants. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Previous

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 48 guests