|
Posted by jerrygarciuh on 05/11/05 18:41
Bizarrely this comand
/usr/local/bin/php -q /home/u4/somePath/html/auth/dbclean.php
Produces
Segmentation fault
Even when the whole script is
<?
// nothing to do
?>
The phpinfo() and php -v check produced the same build date and version
info.
Also strange is the discovery that when run manually via command line it
still clears rows AND send email despite segmentation fault. When run by
cron job, the email arrives but the rows have not been deleted.
Thanks for your time and help with this!
jg
"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:CsKdnfU5opa9gh_fRVn-uw@comcast.com...
> jerrygarciuh wrote:
>> Hello,
>>
>> I have a script running in the wee hours via cron job. When I access the
>> script via browser it works like a charm. I noticed it was not
>> succeeding and ran it manually from the command line and it threw a
>> Segmentation Fault.
>>
>> Googling produces a ton of information on this subject but al of specific
>> to certain binaries and it doesn't seem germaine to solving my problem.
>>
>> Any one have any advice? Whole script is below.
>>
>> TIA,
>>
>> jg
>>
>> <?
>> mysql_connect('mysql.example.com', 'example', 'example');
>> mysql_select_db('example');
>> mysql_query("DELETE FROM aniSessionLog WHERE timestamp < NOW() -
>> 900");
>> $rows = mysql_affected_rows();
>> mail('jg@example.com', 'cleaned Intranet DB', "$rows rows deleted.");
>> ?>
>
> One thought here - are you using the same version of PHP in both cases?
> Perhaps you updated PHP - but left the old one as the default binary. To
> find out, run php -v from the command line and use phpinfo() from the web
> server.
>
> The only other thing I can think of is if the user the cron job is running
> under doesn't have permissions for mysql or mail access.
>
> Try commenting out the mail() call to see if that does it. If not, work
> back, commenting out statements until it works (or until nothing is left -
> in which case the connect has problems).
>
> BTW - you could also close the connection when you're done. It's cleaner
> than letting the system clean up for you.
>
>
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstucklex@attglobal.net
> ==================
Navigation:
[Reply to this message]
|