工作正常,我運行下面的腳本上一個cronjob ...PHP錯誤,在提示
cd /etc/parselog/
php run_all.php >/dev/null
,並正在以下錯誤:
[05-May-2009 20:30:12] PHP Warning: PHP Startup: Unable to load dynamic library './pdo.so' - ./pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0
[05-May-2009 20:30:12] PHP Warning: PHP Startup: Unable to load dynamic library './mysql.so' - ./mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
[05-May-2009 20:30:12] PHP Warning: PHP Startup: Unable to load dynamic library './mysql.so' - ./mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
[05-May-2009 20:30:12] PHP Warning: PHP Startup: Unable to load dynamic library './mysqli.so' - ./mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
[05-May-2009 20:30:12] PHP Warning: PHP Startup: Unable to load dynamic library './odbc.so' - ./odbc.so: cannot open shared object file: No such file or directory in Unknown on line 0
[05-May-2009 20:30:12] PHP Warning: PHP Startup: Unable to load dynamic library './pdo.so' - ./pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0
[05-May-2009 20:30:12] PHP Warning: PHP Startup: Unable to load dynamic library './pdo_mysql.so' - ./pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
[05-May-2009 20:30:12] PHP Warning: PHP Startup: Unable to load dynamic library './pdo_odbc.so' - ./pdo_odbc.so: cannot open shared object file: No such file or directory in Unknown on line 0
[05-May-2009 20:30:12] PHP Warning: PHP Startup: Unable to load dynamic library './pdo_sqlite.so' - ./pdo_sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
[05-May-2009 20:30:12] PHP Fatal error: Call to undefined function mysql_connect() in /etc/parselog/stats_downloads.php on line 5
然而,當我從命令行運行相同的腳本,登錄完美無誤地工作。
這是在提示我的$ PATH字符串:
$PATH = /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
任何意見或建議?我確定在運行cronjob時,它沒有lib路徑或其他東西。我甚至嘗試添加的確切路徑
嗯,我得到了導出路徑,我想我在導出前有一個$ PATH。 我的env是: HOSTNAME = ***** TERM = xterm的 SHELL = /斌/慶典 HISTSIZE = 1000 SSH_CLIENT = 70.48.253.46 61056 22 OLDPWD = /等 SSH_TTY =的/ dev/PTS/0 USER = root MAIL =/var/spool/mail/root PATH =/usr/kerberos/sbin:/ usr/kerberos/bin:/ usr/local/sbin:/ usr/local/bin:/ sbin :/ bin:/ usr/sbin:/ usr/bin:/ usr/X11R6/bin:/ root/bin INPUTRC =/etc/inputrc PWD =/etc/cron.hourly SHLVL = 1 HOME =/root LOGNAME = root LESSOPEN = |/usr/bin/less pipe.sh%s G_BROKEN_FILENAMES = 1 _ =/bin/env – MichaelICE 2009-05-05 20:46:11