linux上php环境安装(包含svn的使用、php扩展安装)

1.checkout项目到linux

svn co/checkout svnPath targetPath

之后根据提示输入svn用户名及密码就好

2.修改配置文件/etc/httpd/conf下httpd.conf
70行:timeout为10

76行:KeepAlive off改为:on

89行:KeepAliveTimeout 15改为 120

3.安装memcache扩展
安装libevent:
----1>检查是否安装libevent
ls -al /usr/lib | grep libevent
无大量lib信息表示未安装
下载libevent,网址:http://libevent.org/ 2.0.21版本
----2>安装libevent
# tar zxvf libevent-1.2.tar.gz //解压
# cd libevent-1.2 //进入目录
# ./configure --prefix=/usr
# make
# make install
----3>安装memcache
(1)yum install memcache*

此方法针对对php版本无要求的情况,yum安装的php版本是5.1(未更新版本库的情况)

(2)针对php5.3版本的memcache安装

首先
可以安装pear工具:
yum install php-pear

然后安装zlib的开发库:
yum install zlib-devel

最后进行如下操作:

    1. cd /files/download/
    2. wget http://pecl.php.net/get/memcache-2.1.2.tgz
    3. tar -xvf memcache-2.1.2.tgz
    4. cd memcache-2.1.2
    5. phpize && ./configure --enable-memcache && make && make install

若未安装phpize,需先进行安装

 

编辑php配置文件
vi /etc/php.ini

添加上memcache的扩展:
extension=memcache.so

重启apache即可:
/etc/init.d/httpd restart
----4>安装mongodb
# wget -P /home http://pecl.php.net/get/mongo-1.2.2.tgz //下载mongo,注意版本号...
#cd /home
#tar zxf mongo-1.2.2.tgz
#cd mongo-1.2.2
#/usr/bin/phpize
#./configure --with-php-config=/usr/bin/php-config

----5>开启curl扩展

allow_call_time_pass_reference = On

4.重启动php
service httpd restart

3.查看php关联,确保所有扩展安装成功

php -m


5.修改配置文件php.ini
error_reporting = E_ALL & ~E_DEPRECATED
改为error_reporting = E_ALL

开启curl扩展
allow_call_time_pass_reference = On


6.修改权限,赋予cache文件夹下可读写权限
/opt/top/public/cache/top/resxml
/opt/top/public/cache/top/search
/opt/top/public/cache/top/mediafile
/opt/top/public/cache/top/callback

posted on 2014-02-28 12:29  木采薇  阅读(376)  评论(0编辑  收藏  举报