can't connect to db host from zend_db

Posted on 2009-05-01
Last Modified: 2013-12-12
using zend_db via config.ini to try to connect to a remote host. i can connect fine with command line (mysql -h 209.x.x.x -u username -p), but using the same settings in zend_db from the same server i get the following error. the same exact code works perfect on the server machine.
Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'SQLSTATE[HY000] [2003] Can't connect to MySQL server on '209.x.x.x' (13)' in

Open in new window

Question by:smueller72
    LVL 3

    Author Comment

    just to rephrase this, i am using zend framework mvc and zend_db to connect to a database. the same code works perfectly on production server, but not on a remote development box. this would lead me to believe that there is a problem with privileges/hosts or a firewall issue, but from the remote box i can connect fine to it with the same login info. i am receiving this error on the page i am trying to connect it to.

    Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'SQLSTATE[HY000] [2003] Can't connect to MySQL server on '209.x.x.x' (13)' in /home/domain/public_html/library/Zend/Db/Adapter/Pdo/Abstract.php:143
    LVL 3

    Author Comment

    fyi, this isn't zend specific. i am also using a joomla app, and cannot connect to the db server through php -- but i can through the mysql command line.
    LVL 40

    Expert Comment

    Can you check the version of the mysql libraries you are using.

    Create a file called info.php containing ...


    Save this on both servers and then load them via your browser and see what is different.

    LVL 3

    Author Comment

    here is the phpinfo

    Client API version       5.0.79

    here is the older server that works fine...

    same code, centos5, etc. just an updated mysql library.
    LVL 3

    Accepted Solution

    its another darn selinux problem

    this command fixed it:
    setsebool -P httpd_can_network_connect=1

    i had a few problems with the newest version of centos. please be aware centos comes with a lot of restrictive apache/selinux permissions which need to be tweaked to open them up.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Javascript: Crash Course

    Javascript is not only emerging as the most important language to know, it's flexibility is unique. With Javascript being deployed on the web, mobile and even the desktop this is the one language that all technologists need to know.

    Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL ( several years ago, it seemed like now was a good time to updat…
    Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
    HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now