WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] wp-config.php not working with MySQL (2 posts)

  1. 100PercentNick
    Member
    Posted 2 years ago #

    Hi guys, I'm trying to get a wordpress local install working on my Mac.

    I've recently set up a database, username and password using the MySQL client as per the instructions in the wordpress codex. That part is ok.

    When I go to the local site on my computer I'm prompted by wordpress to set up the wp-config.php file. Putting in the same details that definitely work with the MySQL client returns an error.

    Manually updating these details in the 'wp-config-sample.php' file and renaming it as 'wp-config.php' also doesn't work - I'm now greeted with a big bold message: "Error establishing a database connection".

    From what I can gather, php and mysql are not communicating with each other properly.

    I've changed the apache 2 configuration file found in 'etc/apache2/httpd.conf' and uncommented the line which loads the php5 module: LoadModule php5_module libexec/apache2/libphp5.so

    and restarted the apache server. This has still not fixed my problem. I'm stuck on what to do next... help appreciated please!

  2. 100PercentNick
    Member
    Posted 2 years ago #

    Fixed it.

    I needed to put a 'phpinfo.php' file containing some php code into the localhost directory

    <?php phpinfo(); ?>

    After doing that, I could see it wasn't configured and that I needed to change my php.ini file to get MySQL and PHP talking to each other.

Topic Closed

This topic has been closed to new replies.

About this Topic