Part 2: install and configure PHP_PHP

Source: Internet
Author: User
Tags file info
Part 2: install and configure PHP. After Apache is installed, you can finally get started with PHP. let's get started. First, decompress the downloaded php-5.2.0-win32.zip file. if you like the directory, I have installed it for Apache and can finally get started with PHP. so let's get started. First, decompress the downloaded php-5.2.0-win32.zip file. if you like the directory, I will decompress it to D: \ php5 for convenience. If you want to change the path, remember to change all the following paths. Since the content involved in this tutorial is relatively simple, I will not make any images.

Next, you need to connect PHP to the Apache server. the specific steps are as follows:

1. rename "php. ini-recommended" under the D: \ php5 directory to "php. ini ";
2. set "php. ini files are copied to the Windows or WinNT Directory, depending on the operating system. for example, if WindowXP and Windows2003 are C: \ Windows, Windows2000 is C: \ Winnt.
3. Open the "php. ini" file and modify the following important keywords (tip: press Ctrl + F on the keyboard for keyword search ):
• Find extension_dir = "./" and change it to the ext path in your PHP directory, and change it to extension_dir = "D: \ php5 \ ext"

• If garbled characters are displayed later in Chinese
; Default_charset = "iso-8859-1" changed
Dfault_charset = "gbk" (remove the semicolon above to indicate that the setting takes effect, which is the case below)

• We will use session objects to store data in the future.
; Session. save_path = "/tmp" this is
Session. save_path = "D:/php5/session" (of course, you need to create a session folder by yourself)

• Find display_errors and cgi. force_redirect and change them
Display_errors = ON
Cgi. force_redirect = 0
(Please pay attention to the modification of the semicolon. if there is a semicolon or no semicolon, I will not remind you later)

• Remove all the semicolons in the following statements:
; Extension = php_dba.dll
; Extension = php_dbase.dll
; Extension = php_filepro.dll
; Extension = php_gd2.dll
; Extension = php_imap.dll
; Extension = php_mysql.dll
; Extension = php_mysqli.dll (if this line does not exist, manually add it and remove the semicolon)

Next, we modified some file uploads and the maximum memory usage limit:
Memory_limit = 20 M
Post_max_size = 20 M
Upload_max_filesize = 20 M

Basically, this is enough. if you need to use other extension functions, you can continue to make relevant changes. because of the length, I will not introduce them here. Remember to Restart the Apache server after modification, otherwise it will not take effect.

OK. Now let's test whether the installation is successful. Create a new file info. php and save it in the D: \ PHProot folder. enter the following code and save it:
Program code
Phpinfo ();
?>


Open the browser and enter http: // localhost/info. if php can open the following web page, it indicates that the installation is successful. otherwise, check the correct information and wish you good luck:




-- Hetty)

Click to download the world document for this tutorial.

Bytes. First, decompress the downloaded php-5.2.0-win32.zip file. if you like the directory, I will try it here...

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.