This article and share build PHP runtime environment, and I hope to be able to help you.
Preface:
-
An article on the ultimate realization of effects:
-
The bin under Apache and bin under the MySQL directory, added to the system " environment variables " in:
3. Apache / htdocs new under the "test.php", here htdocs Apache is the default site folder:
If the code executes successfully , then build a successful PHP code is as follows:
<?php echo "Hello Worls!"; echo "<br>当前时间为:".date("Y-m-d H:i:s");?>
Figure:
First, configure the Apache
Open Apache / conf / httpd.conf, as shown:
writing three lines of code:
# Load the PHP module LoadModule php5_module "D: /amp/php/php5apache2_4.dll" # php suffix when execution of documents, went to this module performs AddType Application / x-httpd-php .php # php configuration file loaded PHPIniDir "D: / amp / php"
Figure:
The first line mentioned modules in php directory, as shown:
saved, first do not worry start the Apache service, to test just knock on the code has no error! If there are errors, Apache will fail to start. Open cmd, enter: Note: If you do not add to the Apache bin "Environment Variables" where there should be (need to enter the D disk to execute this code, recommended directly added to the environment variable, it is convenient) there is an error on the change, When finished, start the Apache service: in the browser, enter localhost :httpd -t
"D:/amp/apache/httpd.exe" -t
Second, configure PHP
-
Manually create php.ini , as shown:
-
Change the time zone , as shown:
Refresh your browser: -
Add MySQL support module , if you have not installed MySQL is also all right, after their one-time installation settings are all right:
the "test.php" added the code:
$link=@mysql_connect("localhost","root","1234"); var_dump($link);
Figure:
Third, configure MySQL
It does not require any configuration, as long as you add to the system's "Environment Variables" in.
You can go and enjoy playing up the code!
Next: Configuring Site
Preface:
-
An article on the ultimate realization of effects:
-
The bin under Apache and bin under the MySQL directory, added to the system " environment variables " in:
3. Apache / htdocs new under the "test.php", here htdocs Apache is the default site folder:
If the code executes successfully , then build a successful PHP code is as follows:
<?php echo "Hello Worls!"; echo "<br>当前时间为:".date("Y-m-d H:i:s");?>
Figure:
First, configure the Apache
Open Apache / conf / httpd.conf, as shown:
writing three lines of code:
# Load the PHP module LoadModule php5_module "D: /amp/php/php5apache2_4.dll" # php suffix when execution of documents, went to this module performs AddType Application / x-httpd-php .php # php configuration file loaded PHPIniDir "D: / amp / php"
Figure:
The first line mentioned modules in php directory, as shown:
saved, first do not worry start the Apache service, to test just knock on the code has no error! If there are errors, Apache will fail to start. Open cmd, enter: Note: If you do not add to the Apache bin "Environment Variables" where there should be (need to enter the D disk to execute this code, recommended directly added to the environment variable, it is convenient) there is an error on the change, When finished, start the Apache service: in the browser, enter localhost :httpd -t
"D:/amp/apache/httpd.exe" -t
Second, configure PHP
-
Manually create php.ini , as shown:
-
Change the time zone , as shown:
Refresh your browser: -
Add MySQL support module , if you have not installed MySQL is also all right, after their one-time installation settings are all right:
the "test.php" added the code:
$link=@mysql_connect("localhost","root","1234"); var_dump($link);
Figure:
Third, configure MySQL
It does not require any configuration, as long as you add to the system's "Environment Variables" in.
related suggestion:
How to configure PHP runtime environment Detailed graphics in Windows8 IIS in
Win7 Configuration php runtime environment
These are the details to build PHP runtime environment method, please pay attention to more php Chinese net other related articles!