Home > Article > Backend Development > How to set up php development environment configuration
1. Preparation - Download the required software
●Apache httpd-2.4.25-win64-VC14.zip
● PHP php-7.1.0-Win32-VC14-x64.zip
Recommended: PHP Integrated Development Environment Tool (Integrated tool, one-click deployment, avoiding the tedious step-by-step setup)
2. Install the software (since the new version no longer provides installation files, only source code, VC14 installation method)
Solution to httpd: Could not reliably determine the server's fully qualified domain name
Install Apache: Double-click installation, which is no different from installing other Windows software. When filling in Server Infomation, there are no special regulations, just enter The information must conform to the format. (Related tutorial recommendations: php video tutorial)
## After the installation is complete, enter http://localhost in the browser. If It Works! is displayed, it means that Apache is installed successfully.
Install PHP
: Unzip 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 the Choose Setup Type## After the installation is complete, start configuring MySQL. You can keep all the default options, but it is best to change the MySQL default encoding to utf8, set the password in the Modify Security Settings option, and enter the password twice to complete. Finally, click Execute to complete the configuration.
3. Integrate Apache PHP MySQL
Apache: First modify the Apache configuration file , let Apache support parsing PHP files. The Apache configuration file is httpd.conf in the conf directory of the Apache installation directory.
1. Allow Apache to 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 PHP Depends on the directory where it is located) LoadModule php5_module "D:/Develop/PHP/php5apache2_2.dll
" PHPIniDir "D:/Develop/PHP "
AddType application/x-httpd-php .php .html .htm 2. Find
index.php
index.html3. 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 "D:/Develop/Apache2.2/htdocs
"Changed to
DocumentRoot "D:/Workspace/PHP
"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 (value Is the directory of the ext folder)
; On windows:
extension_dir = "D:/Develop/PHP/ext"
2. Open the corresponding library Function, find the line of the library that needs to be opened
;extension=php_curl.dll
;extension=php_gd2.dll
;extension=php_mbstring.dll
;extension=php_mysql.dll
;extension=php_xmlrpc.dll
Remove the preceding semicolon (comment), that is, 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 complete success. Restart Apache, create a new file index.php in the site directory, enter the content:
<?php phpinfo(); ?>
Open the browser and enter http://localhost. If the following content is displayed, the installation is successful and the association is successful. MySQL.
The above is the detailed content of How to set up php development environment configuration. For more information, please follow other related articles on the PHP Chinese website!