您的位置:首页 > 编程语言 > PHP开发

php5.6 一键编译

2016-04-10 05:27 423 查看
1. 替换成aliyun的源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo 
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm #yum localinstall --nogpgcheck http://mirrors.aliyun.com/epel/6/i386/epel-release-6-8.noarch.rpm                #[1]

yum install -y gcc bison bison-devel zlib-devel libmcrypt-devel mcrypt mhash-devel openssl-devel libxml2-devel libcurl-devel bzip2-devel readline-devel libedit-devel sqlite-devel \
libvpx libvpx-devel libjpeg-devel freetype freetype-devel libpng-devel

./configure \
--prefix=/usr/local/php_565 \
--with-config-file-path=/usr/local/php_565/etc \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-opcache \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-gettext \
--enable-mbstring \
--with-iconv \
--with-mcrypt \
--with-mhash \
--with-openssl \
--enable-bcmath \
--enable-soap \
--with-libxml-dir \
--enable-pcntl \
--enable-shmop \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-sockets \
--with-curl \
--with-zlib \
--enable-zip \
--with-bz2 \
--with-gd \
--with-freetype-dir=/usr/include/freetype2 \
--with-jpeg-dir=/usr/include/ \
--with-readline

#内存小于1G时加上
--disable-fileinfo

cp php.ini-development /usr/local/php_565/etc/php.ini
cp /usr/local/php_565/etc/php-fpm.conf.default /usr/local/php_565/etc/php-fpm.conf
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm_565
chmod +x /etc/init.d/php-fpm_565
service php-fpm_565 start

chmod +x /etc/init.d/nginx
service nginx restart
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: