- PHP Environment Configuration
- Configure Apache
Configuration file Syntax Description: httpd.conf// annotation method is "#"
- LoadModule, loading the PHP module
LoadModule php5_module C:/wamp/php/php5apache2_2.dll
- AddType, check to see if you can parse the. php
AddType application/x-httpd-php. php
- Phpinidir, setting the php.ini configuration file path
Phpinidir c:/wamp/php
- Configure PHP
PHP5 configuration settings (php.ini): Modify the configuration file path, generate the configuration file, load the MySQL module,
PHP configuration file Syntax description php.ini// the comment is ";"
- Open PHP Extensions
- Set extension path
- Setting the time zone
- Configure MySQL (the installation process is already configured)
- Summary Profile apache,php
- httpd.conf
- php.ini
To test the code for the connection database:
1<?PHP2 3 $link=mysql_connect(' localhost ', ' root ', ' root ');//If the connection is successful, a connection identifier is returned;4 5 if($link){//If there is a database connection identity, the connection is successful6 7 Echo"Connecting the database successfully";//Echo is the meaning of the output8 9}Else{//failed to connect to database without return identityTen One Echo"Failed to connect to database"; A - } - the?>
To test the time zone code:
1 <? PHP 2 3 echo "Now time is:",date(' y-m-d h:i:s '); 4 5 ?>
PS: reconfigure MySQL
Manually Configuring the WAMP Environment (4)--php configuration