1

I'm trying to execute a php file using cron job(cPanel) with a parameter

/usr/bin/php -f /home/user/public_html/en/videos/includes/converter.php abc123

when I run "converter.php" through http/exec the mysql connection is working fine

but when I run with cron job, I'm getting this:

Can't connect to local MySQL server through socket

my question is: why when using php exec I'm being able to connect to the DB but when using the cron jobs I can't?

Mustafa M Jalal
  • 321
  • 1
  • 4
  • 18
  • Which user are you running that crontab as? Can you post the connection info (minus password)? Also, have you confirmed that '/usr/bin/php' is the same one your server is using? – Curtis Mattoon Nov 16 '14 at 23:15
  • the db connection is fine, and I'm using my username they provide to me... Also the php file is being executed by cron job but so it's working if there was not mysql connections in it – Mustafa M Jalal Nov 16 '14 at 23:23
  • Got it http://stackoverflow.com/questions/13769504/mysqlimysqli-hy000-2002-cant-connect-to-local-mysql-server-through-sock – Mustafa M Jalal Nov 16 '14 at 23:39

0 Answers0