Ubuntu Server源码编译安装PHP

前端之家收集整理的这篇文章主要介绍了Ubuntu Server源码编译安装PHP前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
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
sudo sudo cp /usr/local/src/PHP-7.1.8/PHP.ini-production /usr/local/PHP/lib/PHP.ini

AddType application/x-httpd-PHP .PHP
AddType application/x-httpd-PHP-source .PHPs


#cd /usr/src/PHP-5.3.6/ext/mbstring
#/usr/local/PHP/bin/PHPize
#./configure --with-PHP-config=/usr/local/PHP/bin/PHP-config
#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

猜你在找的Ubuntu相关文章