How to independently Add the PHP extension module mbstring in Linux

Source: Internet
Author: User

Php5.2.13 environment, does not support mbstring Extension
Assume that the PHP source code package is in the/usr/local/src/php-5.2.13
The PHP installation directory is/usr/local/PHP. CopyCode The Code is as follows: # cd/usr/local/src/php-5.2.13/EXT/mbstring/
# Rpm-Qa | egrep "Autoconf | GCC": Check whether these components are installed. If these components are not installed, run the following statement. Otherwise, an error is reported.
# Yum-y install Autoconf GCC gcc-C ++
# Phpize
#./Configure -- With-PHP-Config =/usr/local/bin/PHP-config
# Make
# Make install

After execution, add extension = mbstring. So to PhP. ini.

Restart the Web server. Check that phpinfo should support mbstring!

1. Install Crul Copy codeThe Code is 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 and generate extensions
Enter the PHP SourceProgramThe ext directory in the directory storesSource codeSelect the required module, such as the curl module:
CD curl
Execute phpize to generate the compilation file. phpize is in the bin directory of the PHP installation directory.
/Usr/local/PhP5/bin/phpize
During running, the following error may be reported: 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)

Generate a configuration file and compile the 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 file in (for example:/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 extension directory:
Extension_dir = "/usr/local/PhP5/extensions /"
Add extension module reference:
Extension = curl. So

4. Check and restart Apache
/Usr/local/PhP5/bin/PHP-V
When executing this command, PHP will check whether the configuration file is correct. If there is a configuration error, an error will be reported here. You can troubleshoot it based on the error information.

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.