There are many PHP integrated development environments, such as XAMPP, AppServ... Just one-click installation will set up the PHP environment. However, this installation method is not flexible enough, it is inconvenient to freely combine software, and it is not conducive to learning. Therefore, I still prefer to build a PHP development environment manually. I can just install which modules I need, or if that software needs to be upgraded, I can just upgrade that software directly. It does not affect other software, which is very convenient.
: Double-click installation is no different from installing other Windows software. When filling in Server Information, there are no special regulations, as long as the entered information conforms to the format.
: Extract php-5.3.10-Win32-VC9-x86.zip to a directory.
Install MySQL: Double-click to install. If you need to change the installation directory, select Custom
in Choose Setup Type3. Integrate Apache+PHP+MySQL
Apache: First modify the Apache configuration file so that Apache supports parsing PHP files. The Apache configuration file is httpd.conf in the conf directory of the Apache installation directory.
1. Let Apache parse the php file and find
in the configuration file#LoadModule vhost_alias_module modules/mod_vhost_alias.so
Add in the next line (the green position is based on the directory where PHP is located)
LoadModule php5_module ""
PHPIniDir " "
AddType application/x-httpd-php .php .html .htm
2. Find
in the configuration fileDirectoryIndex index.html
Change to
DirectoryIndex index.html
3. Modify the Apache site directory and find it in the configuration file (the values displayed are different depending on the directory where Apache is installed)
DocumentRoot ""
Change to
DocumentRoot ""
Find again
Change to
PHP: Rename php.ini-development to php.ini as the PHP configuration file. Modify php.ini
1. Set the specific directory of the PHP extension package and find
; On windows:
extension_dir = "ext"
Change to (the value is the directory of the ext folder)
; On windows:
extension_dir = ""
2. Enable the corresponding library function and find the line where the library needs to be enabled
; extension=php_curl.dll
; extension=php_gd2.dll
; extension=php_mbstring.dll
; extension=php_mysql.dll
; extension=php_xmlrpc.dll
Remove the semicolon (comment) in front and change it to
extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mysql.dll
extension=php_xmlrpc.dll
3. Set the time zone and find
; date.timezone =
Change to
Date.timezone = Asia/Shanghai
The configuration is complete, check whether the configuration is successful. Restart Apache, create a new file index.php in the site directory, and enter the content:
<?php<br /> <span phpinfo</span>();<br />?>
Open the browser and enter http://localhost. If the following content is displayed, the installation is successful and MySQL is successfully associated.