The method of adding PHP expansion module mbstring separately under Linux _linux

Source: Internet
Author: User
Tags curl
Environment php5.2.13, mbstring extension not supported
If PHP's source package is in/usr/local/src/php-5.2.13
The PHP installation directory is/usr/local/php
Copy Code code as follows:

# cd/usr/local/src/php-5.2.13/ext/mbstring/
# rpm-qa|egrep "AUTOCONF|GCC" This is to detect whether these components are installed, do not install the following sentence, or you will be the error
# yum-y Install autoconf gcc gcc-c++
# phpize
#./configure--with-php-config=/usr/local/bin/php-config
# make
# make Install

Add extension=mbstring.so to php.ini after execution

Restart the Web server, look at the phpinfo, should support mbstring!



1. Install Crul
Copy Code code as follows:

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. Compile 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 Curl module:
CD Curl
Execute phpize Build compilation file, Phpize in the bin directory of the PHP installation directory
/usr/local/php5/bin/phpize
Run, you may have an error: Cannot find autoconf. Please check your autoconf installation and the $PHP _autoconf
environment variable is set correctly and then rerun this script., 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
Generated files in (such as:/usr/local/php5/extensions/no-debug-non-zts-20090626/)
In this way, curl.so is copied to the PHP directory (for example:/usr/local/php5/extensions/)


3. Modify Configuration
In PHP.ini, set the extended directory:
Extension_dir = "/usr/local/php5/extensions/"
and add Extension module references:
Extension = curl.so


4. Check and restart Apache
/usr/local/php5/bin/php-v
Execute this command, PHP will check the configuration file is correct, if there is a configuration error, there will be an error, can be based on the wrong information to troubleshoot

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.