You are here:  » Problems with automated cron updates

Support Forum



Problems with automated cron updates

Submitted by mediadream on Sun, 2011-04-17 07:18 in

I get the following error when running my cronjob for the import script.

Output from command /usr/bin/php -f /home/domain/public_html/scripts/import.php @MODIFIED ..

PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0
PHP Warning: require(../includes/common.php): failed to open stream: No such file or directory in /home/domain/public_html/scripts/import.php on line 5
PHP Fatal error: require(): Failed opening required '../includes/common.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/domain/public_html/scripts/import.php on line 5

Running it on a VPS with ubuntu

What can I do to fix this?

Submitted by support on Mon, 2011-04-18 08:13

The line beginning # (line 1 in scripts/import.php) can be safely removed - it's there to indicate the command interpreter to be used but that's not required if launching via a PHP command directly.

The main problem however is an issue I come across occasionally which is where PHP does not internally change directory to the same folder as the script. This can be fixed by replacing your command with the following:

cd /home/domain/public_html/scripts/
/usr/bin/php -f import.php @MODIFIED

That should do the trick!

Cheers,
David.
--
PriceTapestry.com

Submitted by mediadream on Mon, 2011-04-25 07:16

Hi David!

I have tried this and did a test run of the cronjob, it returned "No result". And nothing is updated.
I am using webmin and the controlpanel to set it up.

Submitted by support on Mon, 2011-04-25 11:04

Hi mediadream,

Can you put the "No result" response in context - at what stage / where it is displayed (if you could describe the steps leading up to it), i'm not familiar with that as an error / warning message in terms of cron or a basic fetch.sh script...

Thanks!

David.
--
PriceTapestry.com

Submitted by mediadream on Tue, 2011-04-26 14:39

Hi David!

The response was in swedish so I just translated it, this is the original output with this settings:
cd /home/domain/public_html/scripts/ /usr/bin/php -f import.php @MODIFIED

No output generated

Submitted by support on Tue, 2011-04-26 14:44

Hi,

I notice in your post the commands are on the same line - they do need to be on separate lines in the script - can you double check that it is:

cd /home/domain/public_html/scripts/
/usr/bin/php -f import.php @MODIFIED

Hope this helps!

Cheers,
David.
--
PriceTapestry.com