1、编译php扩展模块
freetype- 2.1.10/
./configure && make && make install
libevent-1.4.11-stable/
./configure && make && make install
libpng-1.2.37
./configure --with-binconfigs=/usr/bin/pkg-config --with-pkgconfigdir=/usr && make && make install
libmcrypt-2.5.8
./configure --enable-static && make && make install
ldconfig
cd libltdl/ ####<----这个注意编译,否这php编译报错
./configure --enable-ltdl-install
ldconfig
mhash-0.9.9
拥有帝国一切,皆有可能。欢迎访问phome.net ./configure && make && make install
jpeg-6b
./configure --enable-shared --enable-static
mkdir -p /usr/local/man/man1/
make && make install
libxml2-2.7.3
./configure --with-history --enable-ipv6=no
make && make install
shell> vim /etc/ld.so.conf
/usr/local/lib
shell> ldconfig
mcrypt-2.6.7
./configure && make && make install
libiconv-1.12./configure --prefix=/usr/local && make && make install
ldconfig
gd-2.0.35
./configure --with-libiconv-prefix=/usr/local --with-png=/usr/local --with-freetype=/usr/local --with-fontconfig=/lib --with-jpeg=/usr/local
make && make install
ldconfig
确保以下几个包安装
shell>
拥有帝国一切,皆有可能。欢迎访问phome.net yum install crul-devel ncurses-devel net-snmp-devel -y
shell> vim ~/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/libexec
# service mysql5 start
# tar xvf pcre-8.01.tar.gz -C /usr/src
# cd /usr/src/pcre-8.01
# ./configure && make && make install
安装MySQL-devel-community-5.1.39-0.rhel5.i386.rpm
不安装的话,编译php 会提示找不到mysql 文件头的 ,如果出现
Preparing... ########################################### [100%]
file /usr/bin/mysql_config from install of MySQL-devel-community-5.1.39-0.rhel5.i386 conflicts with file from package mysql-5.0.77-4.el5_4.1.i386
file /usr/share/man/man1/mysql_config.1.gz from install of MySQL-devel-community-5.1.39-0.rhel5.i386 conflicts with file from package mysql-5.0.77-4.el5_4.1.i386
-------------------------------------------
说明跟
拥有帝国一切,皆有可能。欢迎访问phome.net5.077那个包冲突,要现删掉,或者安装加上 --froce参数,强制安装.
rpm -ivh MySQL-devel-community-5.1.39-0.rhel5.i386.rpm --force
开始编译php
# tar xvf php-5.2.13.tar.gz -C /usr/src
# gzip -cd php-5.2.13-fpm-0.5.13.diff.gz | patch -d /usr/src/php-5.2.13/ -p1
# cd /usr/src/php-5.2.13/
./configure --sysconfdir=/usr/local/php --with-mcrypt --with-mhash --with-mysql --with-mysqli --with-mysql-sock=/usr/local/mysql/sock/mysql.sock --enable-sockets --enable-zip --enable-mbstring --with-openssl --with-config-file-path=/usr/local/lib/ --with-gd --enable-gd-native-ttf --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-pcntl --with-ldap --with-ldap-sasl --with-xmlrpc --enable-soap --enable-fpm --enable-force-cgi-redirect --enable-fastcgi
make ZEND_EXTRA_LIBS=''-liconv''
make install
继续php
拥有帝国一切,皆有可能。欢迎访问phome.net第三方模块
加速模块
tar xvf eaccelerator-0.9.6.tar.bz2 -C /usr/src
cd /usr/src/eaccelerator-0.9.6/
/usr/local/bin/phpize
./configure --with-php-config=/usr/local/bin/php-config --enable-eaccelerator=shared
make && make install
安装完毕,注意一下输出
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
缓存模块
tar xvf memcache-2.2.5.tgz -C /usr/src
cd /usr/src/memcache-2.2.5/
/usr/local/bin/phpize
./configure --with-php-config=/usr/local/bin/php-config
make && make install
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
tar xvf ImageMagick.tar.gz -C /usr/src
cd /usr/src/ImageMagick-6.5.1-2/
./configure && make && make install
tar xvf imagick-2.3.0.tgz -C /usr/src
cd /usr/src/imagick-2.3.0/
/usr/local/bin/phpize
./configure --with-php-config=/usr/local/bin/php-config
make && make install
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
tar xvf PDO_MYSQL-1.0.2.tgz -C /usr/src
拥有帝国一切,皆有可能。欢迎访问phome.net
cd /usr/src/PDO_MYSQL-1.0.2/
/usr/local/bin/phpize
./configure --with-php-config=/usr/local/bin/php-config --with-pdo-mysql=/usr/local/mysql
make && make install
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
# vim /etc/ld.so.conf
/usr/local/lib/php/extensions/no-debug-non-zts-20060613/
# ldconfig
配置php的配置文件
# cp /usr/src/php-5.2.13/php.ini-dist /usr/local/lib/php.ini
# vim /usr/local/lib/php.ini
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613/"
extension = "imagick.so"
extension = "memcache.so"
extension = "pdo_mysql.so"
output_buffering = On
max_execution_time = 30 <---根据应用程序实际调整
memory_limit = 128M <---根据应用程序实际调整
# shift g 来到配置文件的底部添加:
[eaccelerator]
zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so" 《--根据编译获得路径修改
eaccelerator.shm_size="64"
eaccelerator.cache_dir="/wwwroot/eaccelerator_cache" #缓存路径
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
拥有帝国一切,皆有可能。欢迎访问phome.net auth_basic "Nginx_Panel";
auth_basic_user_file "www.password";
deny 10.1.1.18;
allow all;
}
# htpasswd -c ./www.password tom
本文出自 “小才” 博客,谢绝转载!
拥有帝国一切,皆有可能。欢迎访问phome.net |