php 5.5.12 安装,(一)ubuntu 12.04 安装php5.5

(一)ubuntu 12.04 安装php5.5

发布时间:2020-07-18 18:41:57

来源:51CTO

阅读:927

作者:星之殇洋

1、创建用户

/usr/sbin/groupadd www

/usr/sbin/useradd -r www -g www

2、安装依赖包

apt-get install -y make gcc g++ curl libxml2 libxml2-dev libssl-dev libcurl4-openssl-dev libjpeg-dev libpng12-dev bzip2 libbz2-dev libxpm-dev libfreetype6-dev libedit-dev libxslt-dev

tar zxvf libmcrypt-2.5.8.tar.gz -C /home/tbt/src/

cd /home/tbt/src/libmcrypt-2.5.8/

/sbin/ldconfig

cd libltdl/

./configure --enable-ltdl-install

make && make install

cd ..

./configure

make && make install

tar zxvf libiconv-1.14.tar.gz -C /home/tbt/src/

cd /home/tbt/src/libiconv-1.14

sed -i -e '/gets is a security/d' ./srclib/stdio.in.h

./configure --prefix=/usr/local

make && make install

3、编译安装php

tar zxvf php-5.5.14.tar.gz -C /home/tbt/src/

cd /home/tbt/src/php-5.5.14

./configure --prefix=/home/tbt/php \

--with-mysql=/home/tbt/mysql \

--with-mysqli=/home/tbt/mysql/bin/mysql_config \

--with-pdo-mysql=/home/tbt/mysql \

--enable-fpm \

--with-fpm-user=www \

--with-fpm-group=www \

--with-curl \

--with-pear \

--with-gd \

--with-jpeg-dir \

--with-png-dir \

--with-zlib \

--with-xpm-dir \

--with-freetype-dir \

--with-mcrypt \

--with-mhash \

--with-openssl \

--with-xmlrpc \

--with-xsl \

--with-bz2 \

--with-gettext \

--disable-debug \

--enable-exif \

--enable-wddx \

--enable-zip \

--enable-bcmath \

--enable-calendar \

--enable-ftp \

--enable-mbstring \

--enable-soap \

--enable-sockets \

--enable-shmop \

--enable-dba \

--enable-sysvsem \

--enable-sysvshm \

--enable-sysvmsg \

--enable-pcntl \

--with-libedit \

--with-readline

make ZEND_EXTRA_LIBS='-liconv'

make install

注:如果mysql与php不在同一服务器,则需要将上面关于mysql的参数修改为如下

--with-mysql \

--with-mysqli \

--with-pdo-mysql \

4、修改配置文件并启动php

cp php.ini-production /home/tbt/php/lib/php.ini

cd /home/tbt/php/etc/

cp php-fpm.conf.default php-fpm.conf

cd ..

sed -i 's/^;date.timezone =/date.timezone = PRC/' /home/tbt/php/lib/php.ini

chown -R www:www /home/tbt/php

cp php.ini-production /home/tbt/php/lib/php.ini

cd /home/tbt/php/etc/

cp php-fpm.conf.default php-fpm.conf

cd ..

sed -i 's/^;date.timezone =/date.timezone = PRC/' /home/tbt/php/lib/php.ini

chown -R www:www /home/tbt/php

/home/tbt/php/sbin/php-fpm

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值