php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: gpankhurst at hotmail dot com
New email:
PHP Version: OS:

 

 [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
php-4.0.3pl1
php-4.0.6
php-4.1.0

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 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] jtate@php.net
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-2021 The PHP Group
All rights reserved.
Last updated: Thu Oct 28 06:03:33 2021 UTC