I am looking to get a wordpress local install focusing on my Mac.
I have lately setup a database, account information while using MySQL client according to the instructions within the wordpress codex. That part is alright.
After I visit the local site on my small computer I am motivated by wordpress to setup the wordpress-config.php file. Investing in exactly the same particulars that certainly use the MySQL client returns a mistake.
By hand upgrading these particulars within the 'wp-config-sample.php' file and renaming it as being 'wp-config.php' also does not work - I am now welcomed having a large bold message: "Error creating a database connection".
From things i can gather, php and mysql aren't interacting with one another correctly.
I have transformed the apache 2 configuration file present in 'etc/apache2/httpd.conf' and uncommented the road which loads the php5 module: LoadModule php5_module libexec/apache2/libphp5.so
and restarted the apache server. It has still not fixed my problem. I am stuck on how to proceed next... help appreciated please!
The Mistake-Message "Error creating a database connection" signifies clearly, the php-script can't establish the bond. This could have among the following reasons:
- Your host within the wordpress-config.php isn't correct.
- The mysql-server doesn't listen on that host
- The consumer you placed in the mysql doesn't have rights for connecting how you are attempting
- The firewall blocks the access from the php-script for your mysql-host
Attempt to connect the database with similar configurations of the wordpress using Sequel Pro (or other GUI for connecting a mysql database). When the connection works, the issue 2. and three. is not your condition.
Try looking in your firewall-log to make certain 4. can also be not your condition.
If everything are excluded (even 1. following a final check), attempt to run something similar to phpMyAdmin for connecting your database, to make certain your php-installation has got the needed motorists.
It has been fixed now.
php was searching within the wrong spot for the mysql.sock file, and could not talk to the mysql database, meaning wordpress could not be setup.
Around the command line I typed
ps aux | grep mysql
to create as much information on mysql which i could. Out of this I saw the mysql socket on my small computer has been used at /tmp/mysql.sock
Meanwhile, within the "wordpress-config.php" file, I transformed the road
define('WP_DEBUG', false); to
define('WP_DEBUG', true); and rejuvenated my internet browser which was showing my localhost setup. This now stated much more info than "Error creating a database connection" - in reality I saw the mysql.sock wasn't set up properly whatsoever.
Developing a 'phpinfo.php' file with only the only type of code
<?php phpinfo(); ?> was the pivotal level for me personally.
Putting that 'phpinfo.php' file during my localhost directory after which viewing it from the internet browser not just certainly confirmed the mysql.sock file wasn't set up correctly, it demonstrated in which the designs had been loaded from on my small machine: '/private/etc/php.ini'
The following factor Used to do was open the 'php.ini' file inside a text editor and carrying out a quick find and replace to update the right location of mysql.sock.
Finally, a restart from the local apache server must be completed to fully update all of the new configurations that I'd been fiddling about with.
sudo apachectl restart
Now everything works fine!