Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I am working on CentOS.

I have created a PHP file which run from browser

I have added the script from crontab and made the file executable, but it is not running

30 0 * * * /var/www/vhost/

what should i do?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

Add shebang at the top of your code

share|improve this answer
... and make sure to chmod +x the file. – derobert Nov 14 '12 at 14:32

Or just execute php parser with script as an argument

30 0 * * * /usr/bin/php /var/www/vhost/
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.