How to set up php development environment configuration

步履不停
Release: 2023-04-06 20:54:02
Original
21922 people have browsed it

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

##● MySQL

mysql-5.5.20-win32 .msi

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)

How to set up php development environment configuration

How to set up php development environment configuration

How to set up php development environment configuration

How to set up php development environment configuration

How to set up php development environment configuration## After the installation is complete, enter http://localhost in the browser. If It Works! is displayed, it means that Apache is installed successfully.

How to set up php development environment configuration 

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

How to set up php development environment configuration

# in the Choose Setup Type

How to set up php development environment configuration## 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. How to set up php development environment configuration

How to set up php development environment configuration

 How to set up php development environment configuration3. 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

in the configuration file DirectoryIndex index.html

Change to

DirectoryIndex

index.php

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 "

D:/Develop/Apache2.2/htdocs

"

 Changed to

 DocumentRoot "

D:/Workspace/PHP

"

 Find again

 D:/Develop/Apache2.2/htdocs">

 Change to

 D:/Workspace/PHP">  

 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();
?>
Copy after login

Open the browser and enter http://localhost. If the following content is displayed, the installation is successful and the association is successful. MySQL.

How to set up php development environment configuration

How to set up php development environment configuration

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template