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

实用的LAMP配置

[日期:2013-04-21] 来源:Linux社区  作者:weihong [字体:大 中 小]

4.编译安装php,请配置好yum源(可以是本地系统光盘)后执行如下命令:

# yum -y groupinstall "X Software Development"

如果想让编译的php支持mcrypt扩展,此处还需要下载安装

libmcrypt-2.5.7-5.el5.i386.rpm

libmcrypt-devel-2.5.7-5.el5.i386.rpm

(可以在rpmfind.net找到,下载与平台好人操作系统对应的安装包)

(1)编译安装,这里以php-5.4.13为例

# tar xf php-5.4.13.tar.bz2

# cd php-5.4.13

# ./configure --prefix=/usr/local/php --with-MySQL=/usr/local/mysql --with-openssl  --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --enable-fpm --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2

# make

# make intall

(2)为php提供配置文件:

# cp php.ini-production /etc/php.ini

(3)vim /etc/httpd/httpd.conf

添加AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

修改为DirectoryIndex index.php index.html

5.安装xcache,为php加速:

(1)安装

# tar xf xcache-3.0.1.tar.gz

# cd xcache-3.0.1

# /usr/local/php/bin/phpize

# ./configure --enable-xcache --with-php-config=/usr/local/php/bin/php-config 准备好扩展进行编译

# make && make install

安装结束时,会出现类似如下行:

Installing  sharedextensions:    /usr/local/php/lib/php/extensions/no-debug-zts-20100525/

(2)编辑php.ini,整合php和xcache:

首先将xcache提供的样例配置导入php.ini

# mkdir /etc/php.d

# cp xcache.ini /etc/php.d

说明:xcache.ini文件在xcache的源码目录中。

接下来编辑/etc/php.d/xcache.ini,找到zend_extension开头的行,修改为如下行:

zend_extension = /usr/local/php/lib/php/extensions/no-debug-zts-20100525/xcache.so

注意:如果php.ini文件中有多条zend_extension指令行,要确保此新增的行排在第一位。

启用状态页面的方法很简单,只需要在主配置文件中添加如下内容即可:

vim /etc/htpd/httpd.conf

<Location /server-status>

SetHandler server-status

Require all granted

</Location>

Ok!这就完成啦

linux
相关资讯       lamp  LAMP配置 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

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