WordPress.org

Ready to get started?Download WordPress

Forums

PHP Problems? (2 posts)

  1. pauljsolomon
    Member
    Posted 8 years ago #

    I am getting the "Error establishing a database connection" after installation. I've searched many forums without success. My versions are as follows (I think I have all
    the minimum required versions):

    mysql: 3.23.54
    php: 4.2.2
    apache: Apache/2.0.40

    I wrote the following script in PHP to test my PHP access
    and it fails, which leads me to believe it is a PHP problem (making sure to insert the proper values into
    the db_* variables). My mysql client works with the values I tried. I get the "can't connect to db:" error when I run the script via browser.

    <?
    $db_host="";
    $db_user="";
    $db_pass="";
    $db_name="";

    @mysql_pconnect($db_host,$db_user,$db_pass) or die("can't
    connect to db host: $db_host");
    @mysql_select_db($db_name) or die("can't connect to db: $db_name");

    $select = "SELECT user_login FROM wp_users";
    $result = mysql_query($select) or die('db select failed!' .
    mysql_error());
    ?>

    Any thoughts?

  2. pauljsolomon
    Member
    Posted 8 years ago #

    Okay, I decided to give up on my current setup and upgrade PHP (5.x). After I followed the steps in the INSTALL file,
    it works.

Topic Closed

This topic has been closed to new replies.

About this Topic