Customize php development environment

Source: Internet
Author: User

First, the file to be downloaded
1. php core file, which is compiled by vc6
2. apache server
3. mysql database

Step 1 unzip and install the above three files. Find the conf/httpd. conv file in the apace installation directory.
Step 2 search for this part of LoadModule configuration in the file and add the following content
# Load apache into the php Processing Module
LoadModule php5_module php installation directory/php5apache2_2.dll

# This is used to specify the php INI File
PHPIniDir "php installation directory"
# Fixed syntax: When apace reads a file ending with. php or. phtml
AddType application/x-httpd-php. php. phtml
Step 3. Find the php. ini-development file in the php installation directory and change the file name to php. ini.
Step 4: Add the following content under extension_dir = "./" in php. ini:
Specify the php extension library path here. Only in this way can php support database operations, graphic development, and other functions.
Extension_dir = "php installation directory/ext"
NOTE: Annotations In the INI file are implemented through;
Step 5 search and find in php. ini
Extension = php_mysql.dll
Extension = php_mysqli.dll
And remove the previous ";" to access the mysql database through php.

The following is a test example. Remember to restart the server:
[Php]
<? Php
// Test whether php configuration is normal
// Phpinfo ();
// Test whether mysql can be connected
/* $ Conn = mysql_connect ("localhost", "root", "root"); // database connection username and password
If ($ conn ){
Echo "OK"; // connect
} Else {
Echo "error"; // cannot connect
}*/
 
?>

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.