[TYPO3-dev] @file_get_contents($url) returns nothing when running script from cronjob

Brian Bendtsen bb at bellevuevej.dk
Wed Oct 1 17:53:51 CEST 2008


Xavier Perseguers skrev:
> Hi,
> 
>>>> Im calling the script like this:
>>>>
>>>> * * * * * php
>>>> /var/www/typo3/my_t3_site/typo3conf/ext/aux_newsmailer/mailer/mailer.sh
>>>>
>>>> Is that not enough?
>>>>
>>>> /Brian
>>>
>>>
>>> Probably: no. The directory from which pathes will get resolved is
>>> probably either / or the home directory of the user running the
>>> script.  You need to do an explicit "cd".
>>
>> Im not sure I understand this - can you show an example?
> 
> This means
> 
> * * * * * cd /var/www/typo3/my_t3_site && php 
> typo3conf/ext/aux_newsmailer/mailer/mailer.sh
> 
> BTW, your script should be named mailer.phpsh instead of .sh but that's 
> not a blocking point.
> 
Ok but I still dont get any images when running this cron job.

Im debugging like this(in class.t3lib_htmlmail.php(line 2636):

t3lib_div::devLog('t3lib_div file_get_contents', 'auxmailer',1, 
array($url,$content));

The result when running the script from command line:

0  	../../../../typo3temp/pics/517c22379a.jpg
1 	ÿØÿà�JFIF��H�H��ÿÛ�C�nnn nZ%Z# , 
#&')*)-0-(0%()(ÿÛ�Cnnnn(ZZ((((((((((((((((((((((((((((((((((((((((((((((((((ÿÀ��W�‚"ÿÄ���������������ÿÄ�E� 
�����!1AQa"2#3Bq¡b‘±ÁÑ$CSU‚’£%'RTs”¢áðÿÄ�������������ÿÄ�3���������!Q"1A¡Ra±#3bq‚‘ÁáSðñÿÚ���?�jV3ØÄͦYÇ+䯓*mTÁ=|ÍEìt~!µ¿†f´’`Ž£ºiÃ’pX¿:—ñfªúE½»%ºH÷I9!ÓC0�Ó'çœÆãwäèÒ—Ï„{iÑÆòځT§¹µ¡+nµ`­ÃrÏq�-¢74ÎÆg烚¯c^îU}»¶Ø#®r[¼WoÜð½Ù)ƒÝÚÇõxçÖªÃSáÇ»åúTË3*Ò‚gQÁ?þs4’·ô÷šC€ÇÅ@©6²Nâ„¢h×}Çy²X×azÅŽµ_,Y“§ÚoVoÚã@¹%p{û°GØ󪖵횶HKIP¹õ溵ÇnÐ;@•\‚¸åøÒ¢×R0]LØ9�ȧ0YEý"w<Ó–?KÖ§–º5Íóonv†ÆöhÔ~g•"ÒÁL„—¦Èšñõ{ݠF¸@UÅ“~@Ó–¬.-`Soc-Ñu”0@Ãn$Í-“Iš×TÒ»åZí�eAù¯:Y­Í5…ªld»2G8"5owéAɥǽÃoâ£]ß“0ZÐÏ|<ydøSjÃœGì“ØÉi/z%Øç9r©¬ºÅéžOöç9&ðo´‚¢ÜL—z…âßI§\[F©n¶ôb>g5ª8÷Â
±Rì0)ŸƒÔŽ#±’‚¾ 
ŠqZ¬Í´ÑpGtÚ1ÁV#'4É ±§ÉÓl‘ž‡ÁñVGÞ&dò<fPÒOn–$‡î©+Hx Q†­5Uݺq\GÞÅxcVÃ)CÑ[&œ8ÛFŽG»‚=²{IÀ6HeÊÓ³q³ÌI²“kHÄý!èñàþ4£ˆ¬®5;èn¶[Hn^r¬ÛÙNÞ¾‚«T‡áEuZZªÀG?×EmpUÙF0#EkÃ$5(â]\kZ¶ñ¤99É4Θ6¾&#Ÿ<Rý@(¼m¼”1o‹ÈRM‡h_ÑEøüÎi±7paýâçx©OñTZ¥„Ö‘Ùw%獷'¥DŽìtøÏÅ©G›sþ±¾?•zŸÅZü~C4L‰¬j<¸Ô­#‹{§CŒš˜ñ[êº|Ö±Ù¼m$в³HHS¢X&2yý[Í«hR&û_Yˆx-C\A<”-ij¢òÜ•£i(2w�Ý1Væ“¢.±W73:Æc[.ÄLóÁÇ^XçUnˆ#Z•—´�aÝðÍÈ®þyÇ¥^zuœÑ=ŒêdÆŽ 
äO¦+‘¥Fó~K­¢À:ÕYq‘i 
è)wy*âÜ¥Ä"6þÒ29rÏ<gõÕw/Ø5¼‹ìÓó†UúÃÔÉ‘VþH°à›¿lØdmÞÎH‘Ý0�ŸË5Ïì­ÝŸ‹à....AND 
MUCH MORE

When run as cron job:

0  	../../../../typo3temp/pics/517c22379a.jpg
1

So nothing in the $content

/Brian




More information about the TYPO3-dev mailing list