This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is almost a tutorial for myself, because on and off for the last few month I’ve been trying to get a Virtual Host set up on my local Windows 7 machine. Currently I am using XAMPP to run Apache and MySql, but it requires all local hosted directories to run under the “localhost” site, for example: http://localhost/demo or http://localhost/clientdomain. | |
Really there is nothing wrong with the above, but I’ve got a few WordPress multisite installs running that mimic live sites that use wildcard DNS with sub-domains. So dealing with a local sub-directories becomes hard to test and build when the live site is running sub-domains. | |
So, this post will cover how I got sub-directory multisite installs working in Windows with XAMPP. I’ll also list some great posts which help me get to my final goal. | |
The Steps | |
First I am going to assume you’re using a Windows machine and have XAMPP installed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Launch Notepad++ and open the hosts file located at C:\windows\system32\drivers\etc\hosts. | |
127.0.0.1 name_of_your_site | |
2.In Notepad++ open the Apache configuration file located at C:\xampp\apache\conf\extra\httpd-vhosts.conf | |
<VirtualHost *> | |
DocumentRoot "C:\xampp\htdocs" | |
ServerName localhost | |
</VirtualHost> | |
<VirtualHost *> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Go to C:\xampp\phpMyAdmin\config.inc.php | |
2. change password here $cfg['Servers'][$i]['password']='root'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I. First disable grant tables | |
stop the MySQL service through Administrator tools, Services. | |
Modify the my.ini configuration file (assuming default paths) located in C:\xampp\mysql\bin | |
In the SERVER SECTION, under [mysqld], add the following line: | |
skip-grant-tables | |
... so that you have | |
# SERVER SECTION | |
# ---------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql -p -u root dbname < dbname.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$upload_dir = wp_upload_dir(); | |
$upluad_url = $upload_dir['baseurl']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.jetbrains.com/phpstorm/webhelp/configuring-xdebug.html | |
[XDebug] | |
zend_extension = "C:\xampp\php\ext\php_xdebug.dll" | |
;xdebug.profiler_append = 0 | |
;xdebug.profiler_enable = 1 | |
;xdebug.profiler_enable_trigger = 0 | |
;xdebug.profiler_output_dir = "C:\xampp\tmp" | |
;xdebug.profiler_output_name = "cachegrind.out.%t-%s" | |
xdebug.remote_enable = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Go here https://www.jetbrains.com/phpstorm/webhelp/enabling-php-support.html#configure_php_at_product_level |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
copy/pate phpinfo information into this form | |
http://xdebug.org/wizard.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[XDebug] | |
zend_extension = "C:\xampp\php\ext\php_xdebug.dll" | |
;xdebug.profiler_append = 0 | |
;xdebug.profiler_enable = 1 | |
;xdebug.profiler_enable_trigger = 0 | |
;xdebug.profiler_output_dir = "C:\xampp\tmp" | |
;xdebug.profiler_output_name = "cachegrind.out.%t-%s" | |
xdebug.remote_enable = 1 | |
xdebug.remote_handler = "dbgp" | |
xdebug.remote_host = "127.0.0.1" |