PHP runtime environment to build a shared method

This article and share build PHP runtime environment, and I hope to be able to help you.

Preface:

  1. An article on the ultimate realization of effects:
    Under the general directory, for example: D: / amp /, be careful not to have Chinese pathname

  2. The bin under Apache and bin under the MySQL directory, added to the system " environment variables " in:
    English semicolon
    3. Apache / htdocs new under the "test.php", here htdocs Apache is the default site folder:
    Write pictures described here
    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:
Write pictures described here


First, configure the Apache

Open Apache / conf / httpd.conf, as shown:
Write pictures described here
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:
Write pictures described here
The first line mentioned modules in php directory, as shown:
Write pictures described here
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
Write pictures described here

Write pictures described here

Write pictures described here


Second, configure PHP

  1. Manually create php.ini , as shown:
    Write pictures described here

  2. Change the time zone , as shown:
    Write pictures described here
    Refresh your browser:
    Write pictures described here

  3. Add MySQL support module , if you have not installed MySQL is also all right, after their one-time installation settings are all right:
    Write pictures described here
    Write pictures described here
    the "test.php" added the code:

$link=@mysql_connect("localhost","root","1234");
var_dump($link);

Figure:
Write pictures described here


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:

  1. An article on the ultimate realization of effects:
    Under the general directory, for example: D: / amp /, be careful not to have Chinese pathname

  2. The bin under Apache and bin under the MySQL directory, added to the system " environment variables " in:
    English semicolon
    3. Apache / htdocs new under the "test.php", here htdocs Apache is the default site folder:
    Write pictures described here
    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:
Write pictures described here


First, configure the Apache

Open Apache / conf / httpd.conf, as shown:
Write pictures described here
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:
Write pictures described here
The first line mentioned modules in php directory, as shown:
Write pictures described here
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
Write pictures described here

Write pictures described here

Write pictures described here


Second, configure PHP

  1. Manually create php.ini , as shown:
    Write pictures described here

  2. Change the time zone , as shown:
    Write pictures described here
    Refresh your browser:
    Write pictures described here

  3. Add MySQL support module , if you have not installed MySQL is also all right, after their one-time installation settings are all right:
    Write pictures described here
    Write pictures described here
    the "test.php" added the code:

$link=@mysql_connect("localhost","root","1234");
var_dump($link);

Figure:
Write pictures described here


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

Configure PHP runtime environment configuration and development environment (graphic tutorial) _PHP Tutorial

These are the details to build PHP runtime environment method, please pay attention to more php Chinese net other related articles!

Published 91 original articles · won praise 47 · views 90000 +

Guess you like

Origin blog.csdn.net/qq_30007885/article/details/103016977