Install and configure my PHP environment

Source: Internet
Author: User
PHP may be used for installation and configuration in my own PHP environment recently. The first step is to install the development environment. There are a lot of one-click installation on the Internet, because I have installed mysql on my machine, so I don't want to install a mysql again. It is decided to use a separate configuration for installation. I found a lot of tutorials on the Internet at first. I encountered many problems. Record my own PHP environment installation configuration
PHP may be used recently. The first step is to install the development environment.
There are a lot of one-click installation on the Internet, because I have installed mysql on my machine, so I don't want to install a mysql again.
It is decided to use a separate configuration for installation. I found a lot of tutorials on the Internet at first. I encountered many problems.
Record the installation process and leave it blank.
Step 1:
Download Apache HTTP Server (httpd) 2.2.21
Win32 Binary without crypto (no mod_ssl) (MSI Installer): httpd-2.2.21-win32-x86-no_ssl.msi
Download PHP 5.2 (5.2.17) to download the zip version of VC6 x86 Thread Safe
Differences between VC6 and VC9:
VC6 is compiled using the Visual Studio 6 compiler. if your PHP is set up using Apache, select VC6.
VC9 is compiled using the Visual Studio 2008 compiler. if your PHP is set up using IIS, you can select VC9.
Thread Safe and Non-Thread Safe because an error is reported when I started Apache using Non-Thread Safe at the beginning. the error message is caused by the Non-Thread security. So we use the Thread Safe version.
Second release:
Install Apache HTTP Server by default. Change the installation path to E: \ PHP_Work \ Apache2.2.
Decompress the php zip package to E: \ PHP_Work \ php5.
Step 3:
Configure the environment. open the httpd. conf file of apache and edit it as follows:
1. some online tutorials show how to add the LoadModule at the bottom of the file. I added the LoadModule to a large string and added it: LoadModule php5_module "E:/PHP_Work/php5/php5apache2_2.dll"
2. find the DocumentRoot change: DocumentRoot "E:/PHP_Work/Root"
3. find Change:
4. in this step, I think the configuration is incorrect. the online tutorial also adds this sentence to the lowest end of the file, but I added it And In the middle: add AddType application/x-httpd-php. php. phtml
Phpinidir "E:/PHP_Work/php5 /"
Rename php. ini-dist in the php5 directory to php. ini.
Open php. ini and edit the following content:
1. find extension_dir and change it to: extension_dir = "E: \ PHP_Work \ php5 \ ext"
2. remove the semicolon (;) before extension = php_gd2.dll extension = php_mbstring.dll extension = php_mysql.dll extension = php_pdo.dll extension = php_xmlrpc.dll.
3. find default_charset and remove the semicolon and change it to default_charset = "UTF-8"
4. find register_globals and change register_globals = On.

Finally, copy libmysql. dll in the php5 directory to c:/windows.
Restart the apache service and test whether it is successful.
Create test_mysql.php write:
$ Link = mysql_connect ('localhost', 'root ','');
If (! $ Link) echo "failed! ";
Else echo "successful! ";
Mysql_close ();
?>

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.