How to resolve DSO installed as Apache in PHP _ PHP Tutorial

Source: Internet
Author: User
Tags uncompress
How to resolve DSO installed as Apache in PHP. Because it is easy to maintain and upgrade, we need to install DSO as Apache in PHP. For example, if you install PHP for the first time only supports the database, and then you want to install it again.Because it is easy to maintain and upgrade, we need to install DSO in PHP as Apache. For example, if the PHP installed for the first time only supports the database and then you want to install a module that supports encryption, you only need to run "make clean" and add new configuration options, then run "make" and "make install". a new PHP module will be installed in an appropriate location in Apache and then restart Apache without re-compiling Apache.

The following steps will install a brand new Apache and implement the DSO for installing PHP as Apache:

1. obtain the latest Apache source code from the Apache Software Foundation;

2. put the obtained source code in the/usr/local/or/opt/directory, or any directory you specified;

3rd. run gunzip' to uncompress the file and get the file suffixed with .tar;

4. run the following command to install the file in the apache _ [version] Directory:

Tar-xvf apache_{version}.tar

5. go to the/usr/local/apache _ [version] Directory (or install the compressed file directory in step 4 );

6. enter the following command to prepare for compiling Apache. replace [path] with your own path, for example,/usr/local/apache [version]. now the new value of mod_so has been set, which will allow Apache to use the DSO module;

7. return to the prompt state, type make, and wait for the prompt to return again;

8. run the "make install" command.

Now that Apache has been installed, the system will return to the prompt state. Next we will start to install the Apache DSO in PHP:

1. find the link to the latest version in the download area of the PHP homepage;

2. download the file to an appropriate directory, such as/usr/local/or/opt/or any directory you specified;

3rd. run gunzip' to uncompress the file and get the file suffixed with .tar;

4. run the following command to install the file in the php-[version] Directory:

Tar-xvf php-[version]

5. enter the/usr/local/php-[version] directory or the directory specified in step 4;

So far, you have prepared for installing DSO for Apache in PHP. the only configuration option to be modified is with-apxs (a file in the Apache bin directory ). To achieve high performance, I have not installed a Support Module for MySQL.

./Configure -- with-mysql =/[path to mysql] -- with-apxs =/[path to apxs]

6. return to the prompt status and run the make command. wait until the prompt status is returned again;

7. run the make install command.

At this point, the system installed PHP in the module directory of Apache in DSO mode, and modified the httpd. conf file of Apache, and then returned to the prompt state. After you return to the prompt state, you also need to modify the httpd. conf file of Apache.

1. find a row containing ServerAdmin and add your email address, as shown below:

ServerAdmin you@yourdomain.com

2. find the row starting with ServerName and change it to a real value, for example:

ServerName localhost

3. find the following section:

# And for PHP 4.x, use:

#

# AddType application/x-httpd-php. php

# AddType application/x-httpd-php-source. phps

Modify the content of these rows so that the AddType of PHP 4.0 is no longer annotated, and add the extension name of the file to be used in PHP. the content above is changed to the following content:

# And for PHP 4.x, use:

#

AddType application/x-httpd-php. php. phtml

AddType application/x-httpd-php-source. phps

Save the file, return to the upper-level directory, and run the following command to restart Apache:

./Bin/apachectl start

If no error message is displayed at startup, you can create a file named phpinfo. php only has the following line of content, and tests the DSO installed with Apache and PHP as Apache:

Save the file to the Apache document root directory (htdocs), open the browser, and type http: // localhost/phpinfo. php address, many variables and their values appear on the screen.

To reconfigure PHP, run the make clean command again, and then execute the command with a series of options. /configure command, and then execute the make and make install commands. a new module will appear in the directory module of Apache. you only need to restart Apache to load the new module, it's okay to install DSO for Apache in PHP.


Because it is easy to maintain and upgrade, we need to install the Apache DSO in PHP. For example, if you install PHP for the first time only supports the database, then you want to install the support...

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.