centos php运行环境

download

yum

yum -y update
yum install -y ntp vim-enhanced gcc gcc-c++ gcc-g77 flex bison autoconf automake libtool make bzip2-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel kernel 
yum install -y rsync xinetd vixie-cron patch
yum -y install  libxml2 libxml2-devel curl curl-devel 

自动化安装脚本

##mysql
groupadd mysql
useradd -d /dev/null -g mysql -s /sbin/nologin mysql
tar zxvf mysql-5.1.49.tar.gz 
cd 
./configure --prefix=/usr/local/mysql --with-charset=gbk --localstatedir=/data/mysql 
 
 
##php
tar zxvf php-5.2.14.tar.gz 
gzip -cd php-5.2.14-fpm-0.5.14.diff.gz | patch -d php-5.2.14 -p1
 
cd php-5.2.14
./configure --prefix=/usr/local/php-fcgi  --with-config-file-path=/usr/local/php-fcgi/etc --with-mysql=/usr/local/mysql --with-zlib-dir --with-png-dir --with-jpeg-dir --with-gd --enable-soap --with-iconv  --enable-sockets --enable-mbstring=all --with-curl --with-libxml-dir --with-freetype-dir  --enable-zend-multibyte --disable-ipv6 --enable-fastcgi --enable-force-cgi-redirect  --enable-fpm 
make
make install
cp php.ini-dist /usr/local/php-fcgi/etc/php.ini
cd ..
##memcache##
yum -y install libevent libevent-devel
tar zxvf libmemcached-0.42.tar.gz 
tar zxvf memcached-1.0.2.tgz
tar zxvf memcached-1.4.5.tar.gz
cd memcached-1.4.5
./configure --enable-64bit
make
make install
cd ..
cd libmemcached-0.42
./configure --with-memcached
make
make install
cd ..
cd memcached-1.0.2
/usr/local/php-fcgi/bin/phpize 
./configure --with-php-config=/usr/local/php-fcgi/bin/php-config --enable-memcached
make
make install
cd ..
 
##eacc
wget http://bart.eaccelerator.net/source/0.9.6.1/eaccelerator-0.9.6.1.tar.bz2
tar jxvf eaccelerator-0.9.6.1.tar.bz2 
cd eaccelerator-0.9.6.1
/usr/local/php-fcgi/bin/phpize 
./configure --enable-eaccelerator --with-php-config=/usr/local/php-fcgi/bin/php-config   
make
make install
mkdir /tmp/eaccelerator && chmod 777 /tmp/eaccelerator && touch /var/log/eaccelerator_log
cd ..
##nignx
yum -y install pcre pcre-devel
tar zxvf nginx-0.7.67.tar.gz 
cd nginx-0.7.67
./configure  --with-http_gzip_static_module  --with-http_sub_module  --with-http_stub_status_module --prefix=/usr/local/nginx
make
make install
cd ..

MySQL

可以直接使用 : mysql-5.1.41-linux-i686-icc-glibc23.tar.gz

   shell> groupadd mysql
   shell> useradd -g mysql -s /sbin/nologin -d /dev/null mysql
   shell> cd /usr/local/mysql
   shell> chown -R mysql .
   shell> chgrp -R mysql .
   shell> scripts/mysql_install_db --user=mysql
   shell> chown -R root .
   shell> chown -R mysql data
   shell> bin/mysqld_safe --user=mysql &

配置:

cp /usr/local/mysql/support-files/my-huge.cnf /etc/my.cnf
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql 
##start
/etc/init.d/mysql start

##my.cnf
wait_timeout=2880000
interactive_timeout=2880000

max_connections = 2680
key_buffer_size = 512M

#long_query_time = 20
#log-slow-queries = slow.log

max_heap_table_size = 128M
tmp_table_size = 78M


#server-id X  ##need modify

PHP

./configure --prefix=/usr/local/php-fcgi  --with-config-file-path=/usr/local/php-fcgi/etc --with-mysql=/usr/local/mysql --with-zlib-dir --with-png-dir --with-jpeg-dir --with-gd --enable-soap --with-iconv  --enable-sockets --enable-mbstring=all --with-curl --with-libxml-dir --with-freetype-dir  --enable-zend-multibyte --disable-ipv6 --enable-fastcgi --enable-force-cgi-redirect
make
make install

cp php.ini-dist /usr/local/php-fcgi/etc/php.ini

memcache

yum -y install libevent libevent-devel

memcached

cd memcached-1.4.5
 ./configure & make & make install 

memcache-2.2.5.tgz

cd memcache-2.2.5
/usr/local/php-fcgi/bin/phpize
./configure --enable-memcache --with-php-config=/usr/local/php-fcgi/bin/php-config
make
make install

修改 /usr/local/php-fcgi/etc/php.ini

extension_dir = "/usr/local/php-fcgi/lib/php/extensions/no-debug-non-zts-20060613/"

extension=memcache.so

eaccelerator


cd eaccelerator-0.9.6.1
/usr/local/php-fcgi/bin/phpize 
./configure --enable-eaccelerator --with-php-config=/usr/local/php-fcgi/bin/php-config   

mkdir /tmp/eaccelerator && chmod 777 /tmp/eaccelerator && touch /var/log/eaccelerator_log

#php.ini
extension=eaccelerator.so
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.log_file = "/var/log/eaccelerator_log"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

spawn-fcgi

已经成为独立项目,从 http://redmine.lighttpd.net/projects/spawn-fcgi/news 下载,http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.gz

./configure ;make;make install安装

得到: /usr/local/bin/spawn-fcgi

linux/centos_php运行环境.txt · 最后更改: 2010/08/28 08:07 由 kenvin
到顶部
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0 红麦软件 红麦软件