|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15933 PHP 4.* binary does not connect to mysql from a cron job
Submitted: 2002-03-07 09:50 UTC Modified: 2002-06-06 01:00 UTC
From: gpankhurst at hotmail dot com Assigned:
Status: No Feedback Package: MySQL related
PHP Version: 4.1.0 OS: Sco Unixware 7.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
18 + 42 = ?
Subscribe to this entry?

 [2002-03-07 09:50 UTC] gpankhurst at hotmail dot com
I have a few PHP scripts that execute from a php binary from a cron job.

Since changing to version 4 they fail to connect to the database with a :-
 "Can't connect to local MySQL server through socket '/tmp/mysql.sock'" error, or :-
 "Can't connect to MySQL server on 'xxxx'" if I don't use the local socket method of connecting.

I've tried these versions of php and a few different versions of mysql all with the above same results

I've reverted the binary to version php-3.0.18 and it all works fine

As the scripts are quite simple I only need mysql with the php binary, my configuration for the binaries is :-

./configure --enable-track-vars --with-mysql=/usr/local/mysql 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-07 10:07 UTC] gpankhurst at hotmail dot com
I forgot to mention that the scripts connect fine from the command line and only failed to connect from cron.
 [2002-03-07 10:36 UTC]
Did you check that the necessary environment variables were set?  Cron doesn't read your profile before launching the executable.  Check to see that php from within cron can read the php.ini file.
 [2002-06-06 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 25 17:01:30 2024 UTC