Wednesday, January 18, 2012

Re: [YouTube-API] Script in browser works, but hangs as a cronjob

On Mon, 2012-01-16 at 02:25 -0800, YolkNet Internetservices wrote:
> In a cronjob file (written in Php) I have the following two lines:
>
> require_once ('Zend/Loader.php'); // the Zend dir must be in your
> include_path
>
> Zend_Loader::loadClass('Zend_Gdata_YouTube');
>
> When I run the file in a browser everything works fine. But when I use
> it for a cronjob the script hangs on the second line. I don't see the
> problem, but hopefully somenone here does

cron runs scripts in quite an unusual environment.

I'm not that experienced with PHP, but you might want to check that all
appropriate paths and environment variables are specified correctly when
the cronjob runs (and that it's using the expected shell).

A common way around this is to have a shell script which specifies all
the environment variables and then runs the interpreter - and then to
specify that script in your crontab.

This is OT for this list though.

Tim Wintle

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment