比思論壇

標題: 安裝PHP5.3.10+APC [打印本頁]

作者: LINUS    時間: 2012-2-4 01:17
標題: 安裝PHP5.3.10+APC
安裝PHP5.3.10
  1. cd /usr/local/src
複製代碼
  1. wget http://us.php.net/distributions/php-5.3.10.tar.gz
複製代碼
  1. tar zxvf php-5.3.10.tar.gz
複製代碼
  1. cd php-5.3.10
複製代碼
  1. ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/etc/cgi --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib --with-libxml-dir=/usr --with-xmlrpc --enable-xml --enable-mbstring --enable-ftp --with-gd --enable-magic-quotes --with-pear --enable-sockets --with-ttf --enable-gd-native-ttf --enable-sysvsem --enable-sysvshm --enable-shmop --enable-force-cgi-redirect --enable-fastcgi --enable-zip --enable-fpm --with-mhash --with-mcrypt --enable-discard-path --enable-bcmath --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --with-openssl
複製代碼
  1. make ZEND_EXTRA_LIBS='-liconv
複製代碼
  1. make install
複製代碼
  1. cp php.ini-production /usr/local/etc/cgi/php.ini
複製代碼
  1. cp ./sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
複製代碼
  1. cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
複製代碼
修改:php-fpm.conf
  1. vi /usr/local/php/etc/php-fpm.conf
複製代碼
user = www
group = www
pm.max_children = 248(3G RAM以下設定為128)
pm.start_servers = 20
pm.max_spare_servers = 35

增加開機支持
  1. chkconfig --add php-fpm
複製代碼

  1. chmod 755 /etc/init.d/php-fpm
複製代碼
  1. chkconfig --level 2345 php-fpm on
複製代碼
安裝APC
  1. cd /usr/local/src
複製代碼

  1. wget http://pecl.php.net/get/APC-3.1.9.tgz
複製代碼
  1. tar zxvf APC-3.1.9.tgz
複製代碼
  1. cd APC-3.1.9
複製代碼
  1. /usr/local/php/bin/phpize
複製代碼
  1. ./configure --enable-apc --enable-mmap --enable-apc-spinlocks --disable-apc-pthreadmutex --with-php-config=/usr/local/php/bin/php-config
複製代碼
  1. make
複製代碼
  1. make install
複製代碼
  1. make clean
複製代碼
  1. vi /usr/local/etc/cgi/php.ini
複製代碼
修改以下字段extension_dir = "./" 為 extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/"

在下面增加:

  1. extension=apc.so
  2. apc.enabled = 1
  3. apc.shm_size = 64M
  4. apc.stat = 1
複製代碼

此文為比思論壇原創文章,轉貼請注明出處。





歡迎光臨 比思論壇 (http://108.170.5.78/) Powered by Discuz! X2.5