Home  >  Article  >  Backend Development  >  PHP environment (apache, PHP, Mysql) detailed configuration method_PHP tutorial

PHP environment (apache, PHP, Mysql) detailed configuration method_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:50:33956browse

Preparation before installation: Download PHP, apache, and mysql installation packages. You can download them from the relevant official websites. The following are the installation steps
1. Install Apache, just run the installation directly. We will install it to the D:/PHP/Apache/ directory
2. Place the decompressed contents of the PHP compressed package into the specified PHP directory (specify this to be D:/PHP/ and rename it to PHP5)
3. Modify the Apache configuration file
​ 1. Load the PHP module and add
in the Apache configuration file LoadModule php5_module "D:/PHP/PHP5/php5apache2_2.dll" //D:/PHP/PHP5/ is the php installation directory
​ 2. Add AddTypeapplication/x-httpd-php .php .phtml //Set apache solution file type
//Specify the php configuration file path
Add phpinidir "D:/PHP/PHP5" to set the php configuration file directory (first rename PHP.iniDevelopment in the PHP installation directory to php.ini)
4. Restart Apache
5. Verify whether PHP is installed successfully
Here we create a phpinfo.php file in the D:PHPApachehtdocs directory and enter the following content
[php] view plaincopy
phpinfo();
?>
Then open the browser and enter http://localhost/phpinfo.php. The default is port 80. If it is not port 80, the port number must be added after localhost. If the installation is successful, open the PHP related information page, otherwise check whether the relevant directories are installed correctly.
6. Install the mysql service, run the mysql installation file directly, and follow the prompts to perform the installation step by step
5Add Mysql module
1. Find libMysql.dll or phpmysql.dll and phpmysqli.dll in the PHP installation directory and copy them to the Windows directory on the C drive
2. Open the PHP configuration file
1. Cancel extension=php_mysql.dll and extension=php_mysqli.dll and remove the semicolon
2. Set the extension path extension_dir="D:/PHP/PHP5/ext"
in php.ini 3. Restart Apache
4. Visit the phpinfo.php page again in the browser. If the page information has more mysql and mysqli columns, it means the module was added successfully. Otherwise, recheck the above steps
Verify whether mysql is



Excerpted from jt521xlg’s column

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478266.htmlTechArticlePreparation before installation: Download PHP, apache, mysql installation package, you can download it from the relevant official website, the following is the installation Step 1. Install Apache, just run the installation directly. We will install it to D:/PH...
Statement:
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