[freetds] php, freetds and cron

Hans Lang hal at mmg.de
Sun Jan 5 23:24:51 EST 2003


Hi,

i have a problem when using a php-script that connects to a mssql 7.0 
server within a cronjob.

i then get an error message

"PHP Warning:  Sybase:  Unable to connect in tagestipps.php on line 50"

line 50 says:

$MS_CONN=mssql_connect("$MS_SQL" , "$MS_USER" , "$MS_PASS" );


i do not get this message when calling the script by hand, but i get it 
always in a cron-job, no difference if i start the cron job as a normal 
user or as root, no difference wheter i start it via "php -q ... " or 
via "bash -c "php -q ..."" or whatever.

every environment-variable that is set during a normal login-session is 
set in the cron-script as well.

the script itself (should) read data from a database at 4am and creates 
html-files, that will be static for that day.

i tried to "wget" the script altough it does not return any output, just 
to get it executed, but this doesnt work either.

what am doing wrong, wheres my lack of knowledge?

hans




More information about the FreeTDS mailing list