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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

waytoomuchtimeCommented:
php often has a cli-only equivalent, like /bin/php5-cli or /usr/local/bin/php5-cli
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.