I'm trying to set up my Xampp htdocs location to a Google Drive folder so that I can work on my wordpress site from any location and also sharing it with my PC-laptop.
Following along some tips & tutorials (such as: how to change xampp htdocs directory in OSX?) I now can access my localhost. However, browsing to my wordpress site located in localhost/testsite/ results in:
'Error establishing a database connection"
Any suggestions what can be wrong? Is it no possible to share htdocs-folder between PC & MAC?
my vhost.conf looks like (unchanged):
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "/Applications/XAMPP/xamppfiles/docs/dummy-host.example.com" ServerName dummy-host.example.com ServerAlias www.dummy-host.example.com ErrorLog "logs/dummy-host.example.com-error_log" CustomLog "logs/dummy-host.example.com-access_log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "/Applications/XAMPP/xamppfiles/docs/dummy-host2.example.com" ServerName dummy-host2.example.com ErrorLog "logs/dummy-host2.example.com-error_log" CustomLog "logs/dummy-host2.example.com-access_log" common </VirtualHost>
And the changes made to http.conf
DocumentRoot "/Users/username/Google Drive/htdocs" <Directory "/Users/username/Google Drive/htdocs">
# User/Group: The name (or #number) of the user/group to run httpd as. # It is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # User username
I've tried to make some changes to my wp-config.php file accordingly to some threads on this problem.
/** MySQL database username */ define('DB_USER', ''); /** MySQL hostname */ define('DB_HOST', '127.0.0.1');
Changes - Removed root from DB_USER - Tried changing DB_HOST to both Localhost (notice capital L) and 127.0.0.1. This makes the wp-config-file compatible with PC but just wanted to troubleshoot.
Localhost throws parse error and 127.0.0.1 results in "Error establishing a database connection"
try accessing http://localhost/phpmyadmin and checking the credentials. Usually user is root and no password by default. Also, don't forget to create a database for wordpress if you haven't done so already. So your wp-config.php should contain something like this:
define('DB_NAME', 'wordpress'); define('DB_USER', 'root'); define('DB_PASSWORD', ''); define('DB_HOST', 'localhost');