Link to home
Start Free TrialLog in
Avatar of Tech Ops
Tech OpsFlag for Afghanistan

asked on

Can't run PHP Script

I'm trying to run a PHP script under Cron&CLI.However, I keep getting an error "No such file or directiory" but  file is there. Is there any special setup for PHP????
Avatar of Sinki
Sinki

Could you try to give us more information. Do you run the command line in administrator mode if you use windows vista or later?
Avatar of Shinesh Premrajan
place the php.exe in the c :\windows\system32
- First check you have set the php exe path in environment variable
- Locate the path and give the full page (if linux check with pwd current path)
- in some server need to set cron with control panel
ASKER CERTIFIED SOLUTION
Avatar of waytoomuchtime
waytoomuchtime

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What exactly you want to do, can u ellaborate in more detail
I assume you are using Linux or some Unix.

In your crobtab, specify absolute path, like /usr/bin/yourscriptname.

Also maybe, check your php script, at the top there should be something like #!/usr/local/bin/php

Upload your script, if possible and also paste the output of folowing command:

crontab -l

This will help us to diagnose the issue.
Ok, what is the entry in the crontab or how are you calling the PHP script from CLI. ?
Avatar of Tech Ops

ASKER

Found out that I had to add PHP in the command line