温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

记录个人php编译安装

发布时间:2020-06-18 17:18:02 来源:网络 阅读:972 作者:hello_world007 栏目:web开发

安装之前:

centos下:
yum -y install gcc pcre-devel  curl-devel libxml2-devel libpng-devel libmcrypt-devel libjpeg-devel openssl-devel  libjpeg.x86_64 libpng.x86_64 freetype.x86_64 libjpeg-devel.x86_64 libpng-devel.x86_64 freetype-devel.x86_64 
ubuntu下:
 apt-get -y install libxml2-dev  libxml2 libpng-dev zlib1g-dev openssl  libssl-dev  libcurl4-gnutls-dev libjpeg-dev  libpng-dev libfreetype6-dev --force-yes


wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz

tar -zxvf libmcrypt-2.5.7.tar.gz

cd libmcrypt-2.5.7 

./configure --prefix=/usr/local/libmcrypt

make && make install

下载安装php5.6:

 wget -c http://au1.php.net/get/php-5.6.8.tar.gz/from/this/mirror
 
 tar -zxvf mirror
 
 cd php-5.6.8/
 
 ./configure --enable-fpm --enable-soap --enable-sockets --enable-zip --with-curl --with-mysql=/usr/local/mysql-5.5.41-linux2.6-x86_64 --with-mysqli=/usr/local/mysql-5.5.41-linux2.6-x86_64/bin/mysql_config --with-gd --with-openssl --with-pdo-mysql=/usr/local/mysql-5.5.41-linux2.6-x86_64 --prefix=/usr/local/php --with-iconv --with-mcrypt=/usr/local/libmcrypt   --with-freetype-dir==/usr/lib64/  --with-jpeg-dir=/usr/lib64/  --with-gd
 
 make && make install


下载安装php7.0.2

wget -c http://cn2.php.net/distributions/php-7.0.2.tar.gz

tar -xzxvf php-7.0.2.tar.gz

cd php-7.0.2

./configure --enable-fpm --enable-soap --enable-sockets --enable-zip --with-curl  --with-mysqli=/usr/local/mysql-5.5.41-linux2.6-x86_64/bin/mysql_config --with-gd --with-openssl --with-pdo-mysql=/usr/local/mysql-5.5.41-linux2.6-x86_64 --prefix=/usr/local/php --with-iconv --with-mcrypt=/usr/local/libmcrypt   --with-freetype-dir==/usr/lib64/  --with-jpeg-dir=/usr/lib64/  --with-gd

 make && make install

cp php.ini-development /usr/local/php/lib/php.ini


vi /etc/profile
在最低部添加
PATH=$PATH:/usr/local/php/bin
export PATH


source /etc/profile 

cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf

cp  sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

chmod +x  /etc/init.d/php-fpm

vi /usr/local/php/etc/php-fpm.d/www.conf
修改
user = www
group = www


groupadd www
useradd -g www www

/etc/init.d/php-fpm restart


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI