背景:
阅读新闻
LNMP(Linux+Nginx+MySQL+PHP)服务器环境配置
[日期:2012-05-20] 来源:Linux社区 作者:mchina [字体:]
七、编译安装PHP5扩展模块
1.安装memcache
# tar zxvf memcache-2.2.5.tgz
# cd memcache-2.2.5/
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config
# make
# make install
# 说明:memcache库的位置
Installing shared extensions:
/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
# cd ..
2.安装eaccelerator php加速
# tar jxvf eaccelerator-0.9.5.3.tar.bz2
# cd eaccelerator-0.9.5.3/
# /usr/local/php/bin/phpize
# ./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php/bin/php-config
# make
# make install
Installing shared extensions:
/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
# cd ../
3.安装PDO_MySQL(数据库连接的支持)
# tar zxvf PDO_MYSQL-1.0.2.tgz
# cd PDO_MYSQL-1.0.2/
# /usr/local/php/bin/phpize
#./configure --with-php-config=/usr/local/php/bin/php-config
--with-pdo-mysql=/usr/local/mysql
# make
# make install
Installing shared extensions:
/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
# cd ../
4.安装ImageMagick是Linux下非常强大的图象处理函数与GD类似.
# tar zxvf ImageMagick.tar.gz
# cd ImageMagick-6.5.1-2/
#./configure
# make
# make install
# cd ../
5.安装imagick(连接PHP和ImageMagick的通道)
# tar zxvf imagick-2.2.2.tgz
# cd imagick-2.2.2/
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config
# make
# make install
Installing shared extensions:
/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
# cd ../
6.修改php.ini文件,已使php支持扩展的功能
vi /usr/local/php/etc/php.ini
查找
extension_dir = "./"
修改为
extension_dir="/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"
并在此行后增加以下几行,然后保存:
extension = "memcache.so"
extension = "pdo_mysql.so"
extension = "imagick.so"
再查找output_buffering = Off
修改为output_buffering = On
7.配置eAccelerator加速PHP:
mkdir -p /usr/local/eaccelerator_cache
vi /usr/local/php/etc/php.ini
到配置文件的最末尾,粘上以下内容:
[eaccelerator]
zend_extension="/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"
eaccelerator.shm_size="64"
eaccelerator.cache_dir="/usr/local/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"
相关资讯 LNMP
本文评论 查看全部评论 (0)
尊重网上道德,遵守中华人民共和国的各项有关法律法规 承担一切因您的行为而直接或间接导致的民事或刑事法律责任 本站管理人员有权保留或删除其管辖留言中的任意内容 本站有权在网站内转载或引用您的评论 参与本评论即表明您已经阅读并接受上述条款
评论声明
最新资讯