yum -y update && yum -y upgrade
yum -y install net-tools wget nmap gcc ctags
yum -y install php httpd
yum -y install libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel
vi /etc/sudoers
user ALL=(ALL) ALL
./configure
–prefix=/usr/local/php7 \ [PHP7安装的根目录]
–exec-prefix=/usr/local/php7 \
–bindir=/usr/local/php7/bin \
–sbindir=/usr/local/php7/sbin \
–includedir=/usr/local/php7/include \
–libdir=/usr/local/php7/lib/php \
–mandir=/usr/local/php7/php/man \
–with-config-file-path=/usr/local/php7/etc \ [PHP7的配置目录]
–with-mysql-sock=/var/run/mysql/mysql.sock \ [PHP7的Unix socket通信文件]
–with-mcrypt=/usr/include \
–with-mhash \
–with-openssl \
–with-mysql=shared,mysqlnd \ [PHP7依赖mysql库]
–with-mysqli=shared,mysqlnd \ [PHP7依赖mysql库]
–with-pdo-mysql=shared,mysqlnd \ [PHP7依赖mysql库]
–with-gd \
–with-iconv \
–with-zlib \
–enable-zip \
–enable-inline-optimization \
–disable-debug \
–disable-rpath \
–enable-shared \
–enable-xml \
–enable-bcmath \
–enable-shmop \
–enable-sysvsem \
–enable-mbregex \
–enable-mbstring \
–enable-ftp \
–enable-gd-native-ttf \
–enable-pcntl \
–enable-sockets \
–with-xmlrpc \
–enable-soap \
–without-pear \
–with-gettext \
–enable-session \ [允许php会话session]
–with-curl \ [允许curl扩展]
–with-jpeg-dir \
–with-freetype-dir \
–enable-opcache \ [使用opcache缓存]
–enable-fpm \
–enable-fastcgi \
–with-fpm-user=nginx \ [php-fpm的用户]
–with-fpm-group=nginx \ [php-fpm的用户组]
–without-gdbm \
–disable-fileinfo
实际安装参数
./configure –prefix=/usr/local/php7 –exec-prefix=/usr/local/php7 –bindir=/usr/local/php7/bin –sbindir=/usr/local/php7/sbin –includedir=/usr/local/php7/include –libdir=/usr/local/php7/lib/php –mandir=/usr/local/php7/php/man –with-config-file-path=/usr/local/php7/etc –with-mysql-sock=/var/run/mysql/mysql.sock –with-mcrypt=/usr/include –with-mhash –with-openssl –with-mysql=shared,mysqlnd –with-mysqli=shared,mysqlnd –with-pdo-mysql=shared,mysqlnd –with-gd –with-iconv –with-zlib –enable-zip –enable-inline-optimization –disable-debug –disable-rpath –enable-shared –enable-xml –enable-bcmath –enable-shmop –enable-sysvsem –enable-mbregex –enable-mbstring –enable-ftp –enable-gd-native-ttf –enable-pcntl –enable-sockets –with-xmlrpc –enable-soap –without-pear –with-gettext –enable-session –with-curl –with-jpeg-dir –with-freetype-dir –enable-opcache –enable-fpm –enable-fastcgi –with-fpm-user=nginx –with-fpm-group=nginx –without-gdbm –disable-fileinfo
make && make install
配置tengine
location ~ \.php$ {
root /usr/local/web/tv;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
运行php7/sbin/php-fpm
./php-fpm
wegt http://home.tiscali.cz/~cz210552/distfiles/webbench-1.5.tar.gz
webbench -c 500 -t 30 http://127.0.0.1/phpionfo.php
查看物理CPU的个数
#cat /proc/cpuinfo |grep “physical id”|sort |uniq|wc -l
查看逻辑CPU的个数
#cat /proc/cpuinfo |grep “processor”|wc -l
查看CPU是几核
#cat /proc/cpuinfo |grep “cores”|uniq