04-php environment build 2 custom installation

Source: Internet
Author: User

Wamp software custom installation notes (Windows Apache MySQL PHP)
1. Installation Steps
① Install Apache first.
Notes for installing Apache:
When entering server and other information, you can fill in according to the above example of the installation instance,
If you enter a domain name, you can enter a domain name based on the instance.
② Step 2 install PHP:
You can directly decompress PHP to install it successfully.
Differences between PHP version V6 and V9:
If Apache + PHP is used in windows, V6 is used,
If IIS + PHP is used in windows, v9.
③ Step 3: Integration of Apach and PHP:
Copy the following code to the httpd. conf file under the conf directory in the Apache directory.
Loadmodule php5_modund ~ PHP installation path/php5apache2_2.dll
Phpinidir "~ PHP module installation path"
Addtype application/x-httpd-php.php.phtml

(I) Replace the Chinese characters:

# Equivalent to loading Apache into the PHP Processing Module

Loadmodule php5_module C:/myenv/php-5.3.5/php5apache2_2.dll
# Specify the PHP initialization directory
Phpinidir "C:/myenv/php-5.3.5"
# Identify and process. php files
Addtype application/X-httpd-PHP. php. phtml

(Ii) change the php. ini-development file name to PhP. ini.
PHP. INI is used to specify some basic settings of PHP.


(3) Specify the extension library path in the PHP. ini file:
Open PHP. ini and search; extension_dir = "Ext"
To:
; Path for adding the PHP extension module

Extension_dir = "C:/myenv/php-5.3.5/EXT"

Step 4: test whether the installation is successful
Create test. php In the htdocs File
Write code <? PHP phpinfo ();?>
Restart Apache and access: http: // localhost/test. php.
The PHP version is described in detail.

⑤ Test whether MySQL is successfully installed:
(I) PHP code
<? PHP
$ Conn = mysql_connect ("localhost", "root", "root ");
If ($ conn ){
Echo "database connection successful! ";
} Else {
Echo "database connection failed! ";
}
?>
If this error occurs:
Fatal error: Call to undefined function mysql_connect ()
In C: \ myenv \ apache \ htdocs \ testdb. php on line 2
This is because PHP does not have the correct configuration.
Modification method:
Open the php. ini file and set
Extension = php_mysql.dll
Extension = php_mysqli.dll
Remove the comments before the two files.
If the MySQL database service is disabled, the connection fails.
(Ii) install phpMyAdmin to check whether phpMyAdmin can be run.
Decompress the package directly to htdocs to shorten the file name display.
Then access http: // localhost/PHPmyAdmin/index. php in the browser.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.