编译安装php什么意思,编译安装php

安装php需要的软件。

yum �Cy

install gcc gcc-c++ libxml2 libxml2-devel libiconv libjpeg libjpeg-devel libpng libpng-d

evel gdgd-devel bzip2 bzip2-devel curl curl-devel freetype freetype-devel zlib zlib-develglibc glibc-devel glib2 glib2-devel

libtool-ltdl-devellibtool-ltdl pcre pcre-devel

安装libiconv库

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.tar.gz

tar zxf libiconv-1.14.tar.gz

cd libiconv-1.14

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

make && make install

cd ..

安装libmcrypt

tar zxf libmcrypt-2.5.8.tar.gz

cd libmcrypt-2.5.8

./configure

make && make install

cd libltdl/

./configure �Cenable-ltdl-install

make && make install

cd ..

安装mhash加密扩展库

tar zxf mhash-0.9.9.9.tar.gz

cd mhash-0.9.9.9

./configure

make && make install

####################################

安装PHP

cd /home/darren/tools

wgethttp://php.net/get/php-5.6.20.tar.gz/from/a/mirror

tar zxf php-5.3.27.tar.gz

cd php-5.3.27

�Cwith-mysql=/application/mysql/ 数据库不在本地时,换成以下参数

./configure \

-with-mysql=mysqlnd \

-prefix=/application/php \

-with-iconv-dir=/usr/local/libiconv \

-with-freetype-dir \

-with-jpeg-dir \

-with-png-dir \

-with-zlib \

-with-libxml-dir=/usr \

-enable-xml \

-disable-rpath \

-enable-safe-mode \

-enable-enable-shmop \

-enable-sysvsem \

-enable-inline-optimization \

-with-curl \

-with-curlwrappers \

-enable-mbregex \

-enable-mbstring \

-with-mcrypt \

-with-gd \

-enable-gd-native-ttf \

-with-openssl \

-with-mhash \

-enable-pcntl \

-enable-sockets \

-with-xmlrpc \

-enable-zip \

-enable-soap \

-enable-short-tags \

-enable-zend-multibyte \

-enable-static \

-with-xsl \

-enable-ftp\

-enable-fpm \

-with-fpm-user=nginx \

-with-fpm-group=nginx

make && make install

#################################################

ln -s /application/php5.3.27//application/php

复制php配置文件php.ini

cp/application/tools/php-5.3.27/php.ini-production

/application/php/lib/php.ini

复制fastcgi配置文件php-fpm.conf

cp/application/php/etc/php-fpm.conf.default /application/php/etc/php-fpm.conf

/application/php/sbin/php-fpm -t         #检查语法

/application/php/sbin/php-fpm           #启动php-fpm

#######################################################

附另一个生产环境编译参数:

./configure --prefix=/usr/local/php \

--with-mysql=mysqlnd \

--with-mysqli=mysqlnd \

--with-pdo-mysql=mysqlnd \

--with-iconv-dir \

--with-freetype-dir \

--with-jpeg-dir \

--with-png-dir \

--with-zlib \

--with-libxml-dir \

--enable-xml \

--disable-rpath \

--enable-bcmath \

--enable-shmop \

--enable-sysvsem \

--enable-inline-optimization \

--with-curl \

--with-mcrypt \

--with-curlwrappers \

--enable-mbregex \

--enable-fpm \

--enable-mbstring \

--with-gd \

--enable-gd-native-ttf \

--with-openssl \

--with-mhash \

--enable-pcntl \

--enable-sockets \

--with-xmlrpc \

--enable-zip \

--enable-soap \

--without-pear

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值