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????
LVL 1
craigcerinoAsked:
Who is Participating?
 
waytoomuchtimeCommented:
php often has a cli-only equivalent, like /bin/php5-cli or /usr/local/bin/php5-cli
0
 
SinkiCommented:
Could you try to give us more information. Do you run the command line in administrator mode if you use windows vista or later?
0
 
Shinesh PremrajanEngineering ManagerCommented:
place the php.exe in the c :\windows\system32
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
gabuthakirCommented:
- 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
0
 
pankajgadhariCommented:
What exactly you want to do, can u ellaborate in more detail
0
 
jdarwinCommented:
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.
0
 
Shinesh PremrajanEngineering ManagerCommented:
Ok, what is the entry in the crontab or how are you calling the PHP script from CLI. ?
0
 
craigcerinoAuthor Commented:
Found out that I had to add PHP in the command line
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.