PHP5 installation of two modes under Apache

Source: Internet
Author: User
PHP 5.0.0 and PHP 4.0.38 on July 13, 2004, this is a worthy of our PHP enthusiasts a big news. The long-awaited PHP5 finally came out, we can further enjoy the new PHP features and the fun of using development.

I also used the PHP5 in the first time, the following is a brief introduction to my installation process (only about the Apache server installation), and friends who love PHP to share.

In fact, PHP5 installation process is nothing new, and PHP4 almost.

One, CGI mode

1, extract Php-5.0.0-win32.zip to x:\php, rename Php.ini-dist to Php.ini,copy to X:\winnt (x:\windows) or Apache installation folder. Copy X:\php\php5ts.dll to Winnt (Windows), or Winnt\System32 or Apache installation folder.

2, modify the Apache httpd.conf file. Add the following lines:
scriptalias/php/"x:/php/"
AddType application/x-httpd-php. php
Action application/x-httpd-php "/php/php-cgi.exe"

3, modify php.ini. Set Cgi.force_redirect = 0


Second, module mode

1, with the above 1.

2 and above 2 to read:
LoadModule Php5_module Php5apache.dll
Addmodule mod_php5.c
AddType application/x-httpd-php. php

Do not step 3 above

Note: If it is Apache2, do not need to add the above addmodule mod_php5.c in the http.conf.


Third, module expansion

The completion of the above process, basically the installation is complete, but if you want to use its extended function, you have to configure. For example, use MySQL.

1, set php.ini. Generally to set "include_path =" and "Extension_dir =", especially the latter, the path of custom, generally at least include x:\php and X:\php\ext. Set "extension=" generally remove the front of the number can be.

2, copy the corresponding DLL file to the Winnt (Windows), or Winnt\System32 or Apache installation folder.

To load MySQL as an example to explain: Modify php.ini, configure Extension_dir = "X:\php\ext", remove Extension=php_mysql.dll Front ";", copy X:\php\ Libmysql.dll to Winnt (Windows), or Winnt\System32 or Apache installation folder.

Note that when configured or modified at any time, the Web server must be restarted before it can take effect. PHP4 programs can run. x represents the partition in the above path, please replace it yourself.

I was installed under the Win2K and apache1.3.31.



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.