# PHP CRON Job

**URL:** <https://forum.kirupa.com/t/php-cron-job/294664>\
**Category:** programming\
**Created:** [August 18, 2009, 10:00am UTC](https://forum.kirupa.com/t/php-cron-job/294664 "2009-08-18T10:00:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patch](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/patch/32/1095_2.png) [@Patch](https://forum.kirupa.com/u/Patch)\
**Post date:** [August 18, 2009, 10:00am UTC](https://forum.kirupa.com/t/php-cron-job/294664/1 "2009-08-18T10:00:38Z")

</div>

Hi All,

Quick question regarding php and cron,

here is my current path in the cron job etc:

[SIZE=1]\*/5 \* \* \* \* /usr/bin/php -q /var/www/[hidden]/cron/cron\_script.php |mail [hidden@hidden-email.co.uk](mailto:hidden@hidden-email.co.uk) 2\>&1[/SIZE]

The script basically queries the database and emails etc. When I visit the web page it works perfectly, but if I leave the script to be executed via cron it does nothing. I know it’s working because I recieve the cron email from ‘root’.

Any ideas why it may not be working?

I would really appreciate some advice on this,

Thanks!!! 🙂
