1. Run the following commands on the Linux host to install the mbstring extension Library: 1. Run the cd command to enter the etcmbstring directory under the php source code directory, for example, srcphp5.2.5, that is, cdsrcphp5.2.5; 2. Run # usrlocalphpbinphpize (assuming that php is installed in the usrlocalphp directory). 3
1. Install mbs on a Linux hostTrIng extension library Guide (source code installation)
BelowCommandEnter:
1. UseCdCommand to enterPhpIn the etc/mbstring directory under the source code directory, such as "/src/php5.2.5", that is, "cd/src/php5.2.5 ";
2. Execute
#/Usr/local/php/bin/phpize (assuming that php is installed in the/usr/local/php Directory)
3. Execution
#./Configure -- with-php-config =/usr/local/php/bin/php-config
4. Execute make & make install
5. The system will prompt you about the directory where the mbstring. so file is located. According to the instructions in php. iniExIn the directory to which tension_dir points, copy it. or set mbstring. copy so to the/usr/local/php/ext directory, and set the parameter extension_dir = "/usr/local/php/ext" to mbstring. so directory.
6. Modify php. ini and add extension = mbstring. so.
Restart apache: Run/serviceHttpdRestart to complete the installation.
For nginx, restartPhp-fpmWith nginx
Ii. Guide for installing the mbstring extension library on a Linux host (rpm installation)
If you are using the linux-based apache + php + mysql
Command:
# Rpm-q php (get the php version number)
Then download php-mbstring:
Note that the version number here in the php-mbstring-4.3.9-3.15.i386.rpm can be changed, just change it to your php version number.
Installation:
# Rpm-ivh php-mbstring-4.x.x-x.xx.i386.rpm
Restart apache.
Iii. Settings
PHPThe setting file of IS/etc/php. ini. In this example, the UTF-8 encoding is set as an example.
# Vi php. ini
Set the output handler to mbstring.
; Output_handler =
--> Output_handler = "mb_output_handler"
Set the text set to a UTF-8.
; Default_charSet= "Iso-8859-1"
--> Default_charset = "UTF-8"
Set the language of mbstring to Chinese.
; Mbstring. language = Japan
--> Mbstring. language = Chinese
Sets the internal encoding of mbstring to UTF-8.
; Mbstring. internal_eNcMaxcompute = EUC-JP
--> Mbstring. internal_encoding = UTF-8
Set the input text encoding of mbstring to automatic discriminant.
; Mbstring. http_input = auto
--> Mbstring. http_input = auto
Set mbstring output text encoding to a UTF-8.
; Mbstring. http_output = SJIS
--> Mbstring. http_output = UTF-8
Activate the automatic conversion of mbstring text encoding.
; Mbstring. encoding_translation = Off
Mbstring. encoding_translation = On
However, an error occurs when/usr/local/webserver/php/bin/phpize is executed:
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable is set correctly and then rerun this script.
I searched the internet and found that there were a lot of people asking this question. I picked it up for a while:
# Wget http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz
# Tar-zvxf m4-1.4.9.tar.gz
# Cd m4-1.4.9/
#./Configure & make install
# Cd ../
# Wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz
# Tar-zvxf autoconf-2.62.tar.gz
# Cd autoconf-2.62/
#./Configure & make install
For UBUNTU, it can be simpler:
SuDo apt-get install m4
Sudo apt-get install autoconf
Or directly:
Sudo apt-get install autoconf
Because autoconf depends on m4, it will be automatically downloaded to solve this dependency.