After you have installed PHP, add the extension module (do not re-edit PHP)

Source: Internet
Author: User
Tags zts

The following is an example of installing curl, which describes the specific installation steps.

1. Install Crul wget http://curl.haxx.se/download/curl-7.19.6.tar.gz tar-zxvf curl-7.19.6.tar.gz cd curl-7.19.6./configure- -prefix=/usr/local/curl

Make

Make install

2. Build extension into the PHP source directory in the Ext directory, where the source code for each extension module, select the module you need, such as the Curl module:

CD Curl

Execute phpize to generate the compiled file, phpize in the bin directory of the PHP installation directory

/usr/local/php5/bin/phpize

At run time, you may get an error: Cannot find autoconf. Please check your autoconf installation and the $PHP _autoconf environment variable are set correctly and then rerun this SC Ript. ", you need to install autoconf:

Yum Install autoconf (redhat or CentOS), Apt-get install autoconf (Ubuntu Linux)

Build the configuration file and compile the build module:

/usr/local/php5/bin/phpize

./configure--with-curl=/usr/local/curl--with-php-config=/usr/local/php5/bin/php-config

Make

Make install

In this way, the curl.so is copied to the PHP corresponding directory (e.g./usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/)

3. Modify the configuration in php.ini, set the extension directory:

Extension_dir = "/usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/"

and add Extension reference:

Extension = curl.so

4. Check and restart Apache

/usr/local/php/bin/php-v

When executing this command, PHP will check the configuration file is correct, if there is a configuration error, here will be error, can be based on the wrong information to troubleshoot

After you have installed PHP, add the extension module (do not re-edit PHP)

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.