PHP environment Configuration

Source: Internet
Author: User

When talking about the configuration of the PHP environment, many new PHP beginners feel that the Environment configuration is very cumbersome when they first learn it. In fact, as long as they follow the manual step by step, there will be no major problems.

1. install Apache (the installation of Apache 2.2 is described here, and the installation of other components is the same)

Download the httpd-2.2.15-win32-x86-no_ssl.msi installation package online, click to install

 

Network domain, server name, and administration's email address are the domain, server name, and administrator address respectively. If your server is locally installed, you can set the domain to localhost.com and the server name to www.localhost.com. As for the mailbox address, you can enter either of them.

 

Set the installation path for others and click Next ~ No difficulty

 

After the installation is successful, start Apache and enter http: // localhost in IE. If Apache is installed successfully, the installation is successful.

2. Apache configuration

Find the configuration file (httpd. conf in the installation directory/Apache Software Foundation/apache2.2/conf)

 

Set the website root directory, find DocumentRoot "your website directory" (note that/in the address must be replaced with/), and find <directory "your website directory">

 

Find the addtype application/X-compress. Z and addtype application/X-gzip. GZ. tgz rows, and add
Addtype application/X-httpd-PHP. htm
Addtype application/X-httpd-PHP. php
Addtype application/X-httpd-PHP. html

 

Apache configuration successful, restart Apache

 

3. install PHP (the installation of 5.3.2 is described here, and the installation of others is the same)

Download the php-5.3.2-win32.zip installation package online and click Install.

 

During the installation process, the installer will allow you to select the matching Apache server and the directory of the Apache configuration file.

 

After the installation is successful, the following content is automatically appended to the Apache configuration file:

# Begin PHP installer edits-remove only on uninstall
Phpinidir "PHP installation directory"
Loadmodule php5_module "/php5apache2_2.dll under the dphp installation directory"
# End PHP installer edits-remove only on uninstall

 

4. PHP configuration file
Remove ";" before "; Extension = php_mysql.dll. All module files are placed under "Ext" in the PHP decompression directory, and the previous ";" is not removed because this module is not found in the "Ext" directory by default, an error occurred while loading the file.

 

Specify the PHP installation path and the ext path to the Windows system path. Right-click "my computer", select "properties", and select the "advanced" tab, click "environment variables", find the "path" variable under "system variables", select, double-click or click "edit", and set "; D:/PHP; D: add/PHP/EXT to the original value. Of course, "d:/PHP" is my installation directory. Change it to your PHP installation directory.

 

Restart Apache, create a file named test. php under the website directory you configured, and enter <? PHP phpinfo () ;?>. Open IE and enter http: // localhost/test. php. If php information is displayed in the browser, the PHP configuration is successful.

 

5. Install MySQL
Download the installation package for mysql-5.1.48-win32. MSI online, and then click Install

 

Set the installation path. After the installation is complete, you will be asked to configure the MySQL server and configure it according to your needs.

 

(The default data file of MySQL is stored on disk C. If you detach the previous MySQL, the data file is not deleted, and you need to delete it manually. Otherwise, you will be prompted to enter the old password When configuring mysql)

 

6. Auxiliary Tools
Navicat, eclipse, and Zend Studio ~ After the environment is set up, you can use any auxiliary development tool to look at your hobbies. If you are strong enough, you can also use notepad ~

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.