You are here: Re: cron not working with php+gd « PHP Programming Language « IT news, forums, messages
Re: cron not working with php+gd

Posted by Rik on 08/20/07 19:46

On Mon, 20 Aug 2007 21:42:30 +0200, jdbartlett <contact@jdbartlett.com> =
=

wrote:

> On Aug 20, 1:41 pm, push...@gmail.com wrote:
>> I'm trying to run the following php code along with gd library as a
>> cron job ,but cron is not generating any output.
>> When I run this code from my browser I get an image correctly.
>> Somebody please tell me what needs to be done to get an image via cro=
n
>> job.
>> <?php
>> //Header("Content-type: image/png");
>> $height =3D 300;
>> $width =3D 300;
>> $im =3D ImageCreate($width, $height);
>> $bck =3D ImageColorAllocate($im, 10,110,100);
>> $white =3D ImageColorAllocate($im, 255, 255, 255);
>> ImageFill($im, 0, 0, $bck);
>> ImageLine($im, 0, 0, $width, $height, $white);
>>
>> for($i=3D0;$i<=3D299;$i=3D$i+10) {
>> ImageLine($im, 0, $i, $width, $height, $white); }
>>
>> ImagePNG($im,"x.png");
>> ?>
>
> Does the user with this cron job have permission to create/overwrite
> the file "x.png"?
>

And keep in mind that often the working directory is wherever the cronjo=
b =

started, NOT the directory of the script itself. You might want to try:

ImagePNG($im,dirname(__FILE__)."/x.png");
-- =

Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация