#42977 [NEW]: localhost setting goes to socket instead of 127.0.0.1
| From: | marc at perkel dot com | Date: | Mon, 15 Oct 2007 17:14:41 +0000 |
| Subject: | #42977 [NEW]: localhost setting goes to socket instead of 127.0.0.1 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-118561@lists.php.net to get a copy of this message | ||
From: marc at perkel dot com
Operating system: linux
PHP version: 5.2.4
PHP Bug Type: MySQL related
Bug description: localhost setting goes to socket instead of 127.0.0.1
Description:
------------
When a PHP application tries to call MySQL and it is set to talk to
localhost it talks only to the socket and not to TCP 127.0.0.1. In my.cnt I
set the client as follows:
[client]
protocol=TCP
However that is ignored.
I'm running a web server hosting some 100 applications installed by many
different people. So changing all the localhost setting to 127.0.0.1 isn't
practical. What I want to do is not use the socket at
/var/lib/mysql/mysql.sock at all. The reason is that I'm trying to mugrate
all mysql to a dedicated mysql server and having the web server talk to
127.0.0.1 and link them with an SSH tunnel. In this setup there will be no
socket.
I left a bug report at mysql.com and they blame the problem on PHP so i'm
now here to let you know about it.
Reproduce code:
---------------
Set configuration to localhost and disable socket and PHP can't talk to
TCP 127.0.0.1
Expected result:
----------------
I expect PHP to ignore the unix socket and talk to TCP 127.0.0.1
Actual result:
--------------
No access
--
Edit bug report at http://bugs.php.net/?id=42977&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42977&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42977&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42977&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42977&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=42977&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=42977&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=42977&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=42977&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=42977&r=support
Expected behavior: http://bugs.php.net/fix.php?id=42977&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=42977&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=42977&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42977&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42977&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42977&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=42977&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=42977&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=42977&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=42977&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=42977&r=mysqlcfg