Find the answer to your Linux question:
Results 1 to 2 of 2
We just set up a new Fedora 12 server. It can't connect from PHP....we're really stumped. Here's what we did to troubleshoot: Connected successfully (remote) from Workbench Connected successfully as ...
  1. #1
    Just Joined!
    Join Date
    Apr 2010
    Posts
    4

    MySQL Can't Connect from PHP (Fedora 12)

    We just set up a new Fedora 12 server. It can't connect from PHP....we're really stumped.

    Here's what we did to troubleshoot:
    1. Connected successfully (remote) from Workbench
    2. Connected successfully as the web site user from CLI
    3. Checked (and reinstalled) the php-mysql package
    4. Turned off iptables, no change
    5. installed mysql-devel packages


    We've got a drupal site installed and it does a function that checks if mysql_connect exists. Drupal says the function doesn't exist, so it's like PHP doesn't even see mysql. Now, we didn't uncomment the extension=mysql.so line in php.ini, but I checked my cPanel Cent machine and it wasn't uncommented there either, so I assume it doesn't have to be on Fedora/RHEL/Cent.

    We installed from yum, we did NOT compile Apache/PHP/MySQL. We'd prefer not to if possible.

    Anyone have any ideas?

    UPDATE: We are running on a VPS and we had enabled mpm.worker (ie, we uncommented the worker line in /etc/sysconfig/httpd).

    Once we went back to using prefork, all is well. Apparently you have to compile php/apache to use worker.

  2. #2
    Just Joined!
    Join Date
    Jan 2008
    Posts
    17
    Is php-mysql package installed?

    rpm -qa php-mysql

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...