Home > Backend Development > PHP Tutorial > Independently add PHP extension module mbstring_PHP tutorial under Linux

Independently add PHP extension module mbstring_PHP tutorial under Linux

WBOY
Release: 2016-07-21 14:54:16
Original
1334 people have browsed it

Environment php5.2.13, does not support mbstring extension
If the source code package of php is in /usr/local/src/php-5.2.13
The php installation directory is /usr/local/php

# cd /usr/local/src/php-5.2.13/ext/mbstring/
# rpm -qa|egrep "autoconf|gcc" This is to check whether these components are installed. If not, please perform the following sentence, otherwise an error will be 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 in php.ini

Restart the web server and take a look at phpinfo. mbstring should be supported!


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. Compile and generate extensions
Enter the ext directory in the PHP source program directory. The source code of each extension module is stored here. Select the module you need, such as the curl module:
cd curl
Execute phpize to generate a compiled file. When phpize is run in the bin directory of the PHP installation directory
/usr/local/php5/bin/phpize
, an 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., need to install autoconf:
yum install autoconf (RedHat or CentOS), apt-get install autoconf (Ubuntu Linux)

Generate the configuration file and compile the generated module:
/usr/local/php5/bin/phpize
./configure --with-curl=/usr/local/curl --with-php-config =/usr/local/php5/bin/php-config
make
make install
The generated file is in (such as: /usr/local/php5/extensions/no-debug-non-zts-20090626 /)
In this way, curl.so is copied to the corresponding PHP directory (such as: /usr/local/php5/extensions/)

3. Modify the configuration
In php.ini, set the extension directory:
extension_dir = "/usr/local/php5/extensions/"
And add the 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 based on the error message

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/364601.htmlTechArticleEnvironment php5.2.13, does not support mbstring extension. If the source code package of php is in /usr/local/src/php- 5.2.13 The php installation directory is /usr/local/php # cd /usr/local/src/php-5.2.13/ext/mbstring/ # rpm -qa|eg...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template