A pre-configuration preparation
1 Set environment variables (WIN7) first
Win10
Two configuration Apache
I opened httpd.conf with EditPlus.
LoadModule php5_module "C:/wamp/php/php5apache2_2.dll"
DLL is lowercase ll is not uppercase II in editplus these two same
Note : You will have to restart Apache each time you change the Apache configuration file
Description
LoadModule Check if loading
Php5_module Module name in httpd.conf
Path to the "C:/wamp/php/php5apache2_2.dll" module
Check
Check to see if the module can parse the PHP file:
1 root directory of the default Web site C:\wamp\apache\htdocs
2 Create a new test.php in the root directory of the default Web site
Enter the following code:
Enter 127.0.0.1/1.php or localhost/1.php in the browser to get the following results
Add in EditPlus
AddType application/-x-httpd-php. php
Description
AddType Check to see if it resolves
Add the file extension. php
Restart Apache to see the results
If an error occurs with the configuration file, the processing method:
WIN10 System Press WIN+X Select in Administrator mode
Three-configuration database
In the installation process has been configured, specifically, please see the previous post password 123456
Quad config PHP
1. Prerequisite Preparation
Show file name extension
Win7
Win10
2 Start configuration
Configuration settings for PHP5 (php.ini):
Modify Php.ini-development to php.ini---> OK.
Note: The comment in php.ini is ";"
Look at the picture
Open php.ini Start configuration
Case: Verifying that the database is connected
<?php
mysql_connect (' Database server ', ' database user name (default is Root ') ', ' Database password (set at the time of configuration) ')
$link = mysql_connect (' localhost ', ' root ', ' 1234 ');
if ($link) {
echo "Database connection succeeded";
}else{
echo "Database connection failed";
}
?>
Run results
It took me a long time to find it because I didn't check whether I could connect to the database while I was configuring the Apache environment.
So you have to configure the database in the Apache configuration file.
Phpinidir "c:/wamp/php"
Description
Phpinidir Check if the database is connected
"c:/wamp/php" specifies the php.ini path in the Apache master configuration file.
Look at the picture
Restart Apache to see running results
I have just verified that the extension path of PHP is not set in the main configuration file of PHP.
It's not set.
apache+mysql+php Environment Configuration