由于mysql错误,PHP cronjob失败

时间:2014-08-24 06:22:22

标签: php mysql cron cpanel mysql-pconnect

我从cpanel设置了一个cronjob,但意外地导致了mysql错误。

This is the command i set from CPANEL:
  

php -f /home/server1/public_html/xad/imp.php

It need to be executed after half hour.

1) This job runs from browser without issue. 

2) Also it runs from commandline correclty.
**root@server1 [~]# php -f /home/server1/public_html/xad/imp.php**


But it failed from cpanel cronjob setting and cause mySQL Error:

**Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)**

I am using pconnect as below:
$link = mysql_pconnect($hostName, $userNam_souq, $password) or die(mysql_error());

0 个答案:

没有答案