Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to add PHP expansion module mbstring independently under Linux

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to add PHP extension module mbstring independently under Linux. I hope you will get something after reading this article. Let's discuss it together.

Environment php5.2.13, does not support mbstring extension

If the source 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 execute the following sentence, otherwise you will get an 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 and take a look at phpinfo. It should support mbstring!

1. Install crul

Wget http://curl.haxx.se/download/curl-7.19.6.tar.gztar-zxvf curl-7.19.6.tar.gzcd curl-7.19.6./configure-- prefix=/usr/local/curlmakemake install

two。 Compile and generate extension

Go to the ext directory in the php source program directory, where the source code of each extension module is stored, and select the module you need, such as the curl module:

Cd curl

Execute phpize to generate the compilation file, and phpize is in the bin directory of the PHP installation directory.

/ usr/local/php5/bin/phpize

At run time, 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., requires autoconf to be installed:

Yum install autoconf (RedHat or CentOS), apt-get install autoconf (Ubuntu Linux)

Generate 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-configmakemake install

The generated file is in (e.g. / usr/local/php5/extensions/no-debug-non-zts-20090626/)

In this way, curl.so is copied to the PHP corresponding directory (e.g. / usr/local/php5/extensions/)

3. Modify configuration

In php.ini, set up the extension directory:

Extension_dir = "/ usr/local/php5/extensions/"

And add an 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, which can be checked according to the error message.

After reading this article, I believe you have a certain understanding of "how to add PHP expansion module mbstring independently under Linux". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report