你好,游客 登录 注册 搜索
背景:
阅读新闻

Ubuntu 11.04 Server X86-64 + ICC 12.0.4 编译 Nginx 1.0.4 与 PHP 5.3.6

[日期:2011-07-05] 来源:iamalex.org  作者:iamalex [字体: ]
Step 5:安装 PHP


创建编译文件


cd /software
tar zxf php-5.3.6.tar.gz
cd php-5.3.6
nano compiler-php.sh


输入以下内容,注意请按照你的 CPU 规格填写 CFLAGS 及 CXXFLAGS 特征,在此采用 Mysqlnd 实现 Mysql / Mysqli / PDO


#!/bin/bash
make distclean
DEST=/usr/local/webserver/php
CFLAGS='-O3 -axsse4.2 -ip -unroll2 -no-prec-div -fp-model source -restrict -static-intel' \
CXXFLAGS='-O3 -axsse4.2 -ip -unroll2 -no-prec-div -fp-model source -restrict -static-intel -fno-implicit-templates -fno-exceptions -fno-rtti' \
CC=icc \
CXX=icpc \
LD=xild \
AR=xiar \
./configure \
-prefix=$DEST \
-enable-fpm \
-enable-force-cgi-redirect \
-enable-fastcgi \
-enable-mbstring \
-enable-mbregex \
-enable-pcntl \
-enable-exif \
-enable-sockets \
-enable-sysvsem \
-enable-sysvshm \
-enable-inline-optimization \
-enable-zend-multibyte \
-enable-xml \
-enable-discard-path \
-enable-bcmath \
-enable-shmop \
-enable-sysvsem \
-enable-sockets \
-enable-gd-native-ttf \
-with-mcrypt \
-with-gd \
-with-openssl \
-enable-inline-optimization \
-disable-ipv6 \
-disable-debug \
-disable-rpath \
-with-mysql=mysqlnd \
-with-mysqli=mysqlnd \
-with-pdo-mysql=mysqlnd \
-with-config-file-path=$DEST/etc \
-with-config-file-scan-dir=$DEST/etc/php.d \
-with-zlib \
-with-curl \
-with-curlwrappers \
-with-gettext \
-with-freetype-dir \
-with-iconv-dir=/usr/local \
-with-jpeg-dir \
-with-png-dir \
-with-libxml-dir=/usr \
-with-mhash \
-with-xmlrpc \
-enable-zip \
-enable-soap \
-with-pcre-regex


对编译文件授权并执行配置编译


chmod 777 compiler-php.sh
./compiler-php.sh
make ZEND_EXTRA_LIBS='-liconv'
make install
cp php.ini-production /usr/local/webserver/php/etc/php.ini


编译安装 Memcached 及 PHP5 扩展模块


cd /software
tar zxf memcached-1.4.5.tar.gz
cd memcached-1.4.5
CC=icc \
CXX=icpc \
LD=xild \
AR=xiar \
CFLAGS='-O3 -axsse4.2 -ip -unroll2 -no-prec-div -fp-model source -restrict -static-intel' \
CXXFLAGS='-O3 -axsse4.2 -ip -unroll2 -no-prec-div -fp-model source -restrict -static-intel -fno-implicit-templates -fno-exceptions -fno-rtti' \
make
make install
cd ../


tar zxvf memcache-2.2.6.tgz
cd memcache-2.2.6/
/usr/local/webserver/php/bin/phpize
./configure --with-php-config=/usr/local/webserver/php/bin/php-config CC=icc CXX=icpc CFLAGS=-O3 CXXFLAGS=-O3
make
make install
cd ../

tar jxvf eaccelerator-0.9.6.1.tar.bz2
cd eaccelerator-0.9.6.1/
/usr/local/webserver/php/bin/phpize
./configure –enable-eaccelerator=shared –with-php-config=/usr/local/webserver/php/bin/php-config CC=icc CXX=icpc CFLAGS=-O3 CXXFLAGS=-O3
make
make install
cd ../

修改 php.ini 配置

nano /usr/local/webserver/php/etc/php.ini
修改以下部分
extension_dir = “/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20090626/”
output_buffering = On
cgi.fix_pathinfo=0

在最后添加
extension = “memcache.so”

[eaccelerator]
zend_extension=”/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20090626/eaccelerator.so”
eaccelerator.shm_size=”64″
eaccelerator.cache_dir=”/usr/local/webserver/eaccelerator_cache”
eaccelerator.enable=”1″
eaccelerator.optimizer=”1″
eaccelerator.check_mtime=”1″
eaccelerator.debug=”0″
eaccelerator.filter=”"
eaccelerator.shm_max=”0″
eaccelerator.shm_ttl=”3600″
eaccelerator.shm_prune_period=”3600″
eaccelerator.shm_only=”0″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″

创建 eaccelerator 缓存文件夹

mkdir -p /usr/local/webserver/eaccelerator_cache

linux
相关资讯       Ubuntu 11.04 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款