Install PHP as Apachedso

Source: Internet
Author: User
Tags install php php database unpack
PHP is often used with Apache Web servers for Linux/unix platforms. When we install PHP in the Apache environment, you have three installation modes to choose from: Static module, dynamic module (DSO) and CGI.
I suggest you better install PHP as apached DSO, this installation mode of maintenance and upgrade are fairly simple. For example, suppose you originally installed only the PHP database support function. But after a few days you decided to add encryption to PHP. Simply type the make clean command, then add new configuration options, and then execute make and make install commands. In this way, the new PHP module will be installed to the appropriate location on Apache, you just restart Apache all OK, of course, the whole process without recompiling Apache.
The simple steps to install a new version of Apache and to install PHP as Apache DSO are as follows:
1. Download the latest version of the Apache server software from the Apache Software Foundation site.
2. Place the code file in the appropriate directory such as/usr/local/or/opt/.
3. Unzip the code file with the Gunzip command, and then you can get the corresponding *.tar file.
4. Type the following unpack command to place the above tar file in a apache_[version-shaped directory:
TAR-XVF Apache_[version].tar
5. Go to/usr/local/apache_[version] directory (or the directory you specified in the steps above).
6. Type the following configuration command, with the path you set (such as/usr/local/apache[version], and so on, pay attention to the back of the slash! Replaces the [path] parameter, and you also enable the MOD_SO parameter to allow Apache to use DSO.
./configure--prefix=[path]--enable-module=so
7. Go back to the command prompt and type make and wait for the command execution to complete and return to the command prompt state.
8. Type make install.
By this time, the compiler can create the final directory and return to the system's command prompt state.
Next Install PHP:
1. Visit the download area of the PHP home page to select the latest version of the source code link.
2. Put the downloaded file in the appropriate directory such as/usr/local/or/opt/.
3. Unzip the code file with the Gunzip command, and then you can get the corresponding *.tar file.
4. Type the following unpack command to place the above tar file in a php-[version-shaped directory:
TAR-XVF Php-[version]
5. Go to/usr/local/php-[version] directory (or the directory you specify).
Now you can compile the PHP DSO, in fact, here only need a necessary configuration options--with-apxs (a file under the Apache Bin directory)--however, for the system configuration more comprehensive, we also add to the MySQL database support.
./configure--with-mysql=/[path to MySQL]--with-apxs=/[path to APXS]

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.