sudo apt-get update
sudo apt-get install autoconf
sudo apt-get install libxml2-dev
sudo apt-get install bzip2
sudo apt-get install libjpeg-dev
sudo apt-get install libpng-dev
sudo apt-get install libxpm-dev
sudo apt-get install libmcrypt-dev
sudo apt-get install libMysqL++-dev
sudo apt-get install libxslt1-dev
sudo apt-get install libbz2-dev
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libcurl4-gnutls-dev
sudo apt-get install libfreetype6-dev
sudo apt-get install build-essential
sudo apt-get install openssl
sudo apt-get install libssl-dev
sudo apt-get install make
sudo apt-get install curl
sudo apt-get install libreadline6
sudo apt-get install libreadline6-dev
sudo apt-get install libt1-dev
tar -xvf PHP-7.1.8.tar.gz
sudo mv PHP-7.1.8 /usr/local/src/
cd /usr/local/src/PHP-7.1.8
sudo cp /usr/lib/x86_64-linux-gnu/libssl.so /usr/libsudo ./configure
--prefix=/usr/local/PHP --with-apxs2=/usr/local/apache2/bin/apxs
-with-MysqLi=/usr/local/MysqL/bin/MysqL_config --with-MysqLi=MysqLnd --with-pdo-MysqL=MysqLnd --with-iconv-dir=/usr/local/lib --with-openssl --enable-mbstring --enable-ftp --enable-pcntl --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-zip --enable-sockets --enable-MysqLnd --enable-maintainer-zts --with-tsrm-pthreads
sudo make
sudo make install
#cd /usr/src/PHP-5.3.6/ext/mbstring
#make && make install
PHP.ini里增加extension=mbstring.so,并设置extension_dir = "/usr/local/PHP/lib/PHP/extensions/no-debug-non-zts-2006061
#/usr/local/apache2/bin/apachectl restart
原文链接:https://www.f2er.com/ubuntu/351682.html