Configuring the PHP environment under Windows
Phpnow in Windows configuration environment is very convenient, but the compatibility is not very good, and sometimes we need to manually configure the PHP environment in Windows, manual configuration is cumbersome to often forget the configuration steps. So today the configuration process is deliberately documented.
First we need to download:
Official download address for Apache:
http://httpd.apache.org/download.cgi
MySQL Official Download place:
Http://dev.mysql.com/downloads/mysql/5.0.html#win32
PHP Official Download Address: http://www.php.net/downloads.php
phpMyAdmin Official Download Address: http://phpmyadmin.com/
?
Required software We are finished downloading, next I want to install, click Apache_2.0.59-win32-x86-no_ssl.msi,apache Default Port We choose 80, there is not and IIS have port number conflict. Installation with normal applications
and similar. After the program is installed, we enter in the browser: http://127.0.0.1 can see the title of the installation Apache test page, indicating that we have Apache installation success.
?
MySQL Installation:
We run the Setup.exe under the MySQL folder. There is a need to set a password step, the general recommended password is not empty (such as: we set the password to 123456). Then click Next, then finish. Our database has been installed.
?
PHP Installation configuration:
We extracted the php-5.2.3-win32.zip into the C packing directory, change the folder name to PHP, so convenient. Locate the "php.ini-dist" or "php.ini-recommended" file in the PHP directory, and we'll name it "php.ini" and copy it to "C:\WINDOWS".
Copy the PHP directory Php5ts.dll to the "C:\WINDOWS\system32" directory.
Copy "Php_gd2.dll" and "Php_msql.dll" under the Php\ext directory to the "C:\WINDOWS\system32" directory.
Modify Apache's httpd.conf: Find E:\Apache2\conf "httpd.conf" file (preferably backed up beforehand).
Find DocumentRoot, change it to your website root directory, such as "DocumentRoot" E:/apache2/htdocs "";
Find DirectoryIndex index.html index.html.var add index.php in the back
Find #loadmodule ssl_module modules/mod_ssl.so order a row to join LoadModule Php5_module C:\php\php5apache2.dll;
Find AddType application/x-gzip.gz.tgz After adding a row AddType application/x-httpd-php.php;
Write a file index.php, add "" to the Apache root directory, from the Apache server, enter in the browser: http://126.0.0.1/index.php, see the PHP configuration information, PHP version, indicating that the PHP configuration is successful.
?
MySQL configuration:
Opens the C:\windows\php.ini file;
Look for, extension=php_mysql.dll, remove '; ' Comments
Look for, extension=php_gd2.dll, remove '; ' Comments
Look for, extension=php_mbstring.dll, remove '; ' Comments
Find, Session.save_path= "/temp", remove ";", "/temp" to "C:\WINDOWS\Temp";
Extension_dir modified to Extension_dir= "C:\php\ext";
Copy the Libmysql.dll to the "C:\Windows\System32" directory
Look for, extension=php_mysql.dll, remove '; ' Comments
Restart the Apache server.
?
Installation Configuration phpMyAdmin:
Unzip the phpMyAdmin into the Apache root directory (E:\apache\hotdocs), modify the E "\apache\htdocs\phpmyadmin\config.inc.php file, set the username, password ( We set the username and password when we installed MySQL. In the browser to enter the http://127.0.0.1/phpMyAdmin/, you can easily manage our database.
?
To configure the virtual directory for Apache:
Open a C:\WINDOWS\system32\drivers\etc\hosts file, add 127.0.0.1 ceshi.com
Open E:\apache\htdocs\httpd.conf File
Find #namevirtualhost *:80, remove "#";
?
ServerAdmin [email protected]//Your email
DocumentRoot E:/www/web//Your virtual path address
ServerName ceshi.com//virtual path URL
Errorlog Logs/dummy-host.ceshi.com-error_log
Customlog Logs/dummy-host.ceshi.com-access_log Common
?
If you need to set up more than one virtual path, you just need to copy to the content you want.