wget http://cn.php.net/distributions/php-5.3.9.tar.gz
tar -zxvf php-5.3.9.tar.gz
cd php-5.3.9./configure --prefix=/usr/local/webserver/php539 --with-config-file-path=/usr/local/webserver/php539/etc --enable-fpm --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-fpm-user=xafcdata --with-fpm-group=xafcdata --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --enable-ftp --enable-safe-mode
make ZEND_EXTRA_LIBS='-liconv'
make install
cp php.ini-production /usr/local/webserver/php539/etc/php.ini
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
cp sapi/fpm/php-fpm.conf /usr/local/webserver/php539/etc/php-fpm.conf
cd ..
sed -i 's#short_open_tag = Off#short_open_tag = On#g' /usr/local/webserver/php539/etc/php.ini
sed -i 's#;pid = run/php-fpm.pid#pid = run/php-fpm.pid#g' /usr/local/webserver/php539/etc/php-fpm.conf
sed -i 's#pm.max_children = 5#pm.max_children = 32#g' /usr/local/webserver/php539/etc/php-fpm.conf
sed -i 's#pm.start_servers = 2#pm.start_servers = 16#g' /usr/local/webserver/php539/etc/php-fpm.conf
sed -i 's#pm.min_spare_servers = 1#pm.min_spare_servers = 8#g' /usr/local/webserver/php539/etc/php-fpm.conf
sed -i 's#pm.max_spare_servers = 3#pm.max_spare_servers = 32#g' /usr/local/webserver/php539/etc/php-fpm.conf
sed -i 's#;pm.max_requests = 500#pm.max_requests = 120#g' /usr/local/webserver/php539/etc/php-fpm.conf
mkdir
chmod 755 /etc/init.d/php-fpm
chkconfig --add php-fpm
chkconfig --level 345 php-fpm on
/etc/init.d/php-fpm start
sed -i 's#extension_dir = "./"#extension_dir = "/usr/local/webserver/php539/lib/php/extensions/no-debug-non-zts-20090626/"\nextension = "memcache.so"\nextension = "pdo_mysql.so"\nextension = "imagick.so"\n#' /usr/local/webserver/php539/etc/php.ini
sed -i 's#output_buffering = Off#output_buffering = On#' /usr/local/webserver/php539/etc/php.ini
sed -i "s#; always_populate_raw_post_data = On#always_populate_raw_post_data = On#g" /usr/local/webserver/php539/etc/php.ini
sed -i "s#; cgi.fix_pathinfo=0#cgi.fix_pathinfo=0#g" /usr/local/webserver/php539/etc/php.ini
awk '{print $2,$3}' 44.txt |sort|uniq -c|sort -rn
统计slow.log中慢函数出现的次数和文件
转载于:https://blog.51cto.com/liang3391/769251