LAMP安装与Zabbix3.2编译安装(2)

yum install -y gcc \ gcc-c++ \ autoconf \ libjpeg \ libjpeg-devel \ libpng \ libpng-devel \ freetype \ freetype-devel \ libpng \ libpng-devel \ libxml2 \ libxml2-devel \ zlib \ zlib-devel \ glibc \ glibc-devel \ glib2 \ glib2-devel \ bzip2 \ bzip2-devel \ ncurses \ curl \ openssl-devel \ db4-devel \ libXpm-devel \ libX11-devel \ gmp-devel \ readline-devel \ libxslt-devel \ expat-devel \ xmlrpc-c \ libcurl \ libcurl-devel  

安装加密扩展库,先安装Libmcrypt

1 tar zxvf libmcrypt-2.5.8.tar.gz 2 3 cd libmcrypt-2.5.8 4 5 ./configure 6 7 make 8 9 make install 

编译安装

./configure \ --prefix=/usr/local/php \ --with-config-file-path=/etc \ --with-apxs2=/usr/sbin/apxs \ --with-mysql=/usr/local/mysql \ --with-mysqli=/usr/local/mysql/bin/mysql_config \ --enable-inline-optimization \ --enable-fpm \ --enable-soap \ --with-libxml-dir \ --with-xmlrpc \ --with-openssl \ --with-mcrypt \ --with-mhash \ --with-pcre-regex \ --with-sqlite3 \ --with-zlib \ --enable-bcmath \ --with-iconv \ --with-bz2 \ --enable-calendar \ --with-curl \ --with-cdb \ --enable-dom \ --enable-exif \ --enable-fileinfo \ --enable-filter \ --with-pcre-dir \ --enable-ftp \ --with-gd \ --with-openssl-dir \ --with-jpeg-dir \ --with-png-dir \ --with-zlib-dir \ --with-freetype-dir \ --enable-gd-native-ttf \ --with-gettext \ --with-gmp \ --with-mhash \ --enable-json \ --enable-mbstring \ --disable-mbregex \ --disable-mbregex-backtrack \ --with-libmbfl \ --with-onig \ --enable-pdo \ --with-pdo-mysql \ --with-zlib-dir \ --with-pdo-sqlite \ --with-readline \ --enable-session \ --enable-shmop \ --enable-simplexml \ --enable-sockets \ --enable-sysvmsg \ --enable-sysvsem \ --enable-sysvshm \ --enable-wddx \ --with-libxml-dir \ --with-xsl \ --enable-zip \ --enable-mysqlnd-compression-support \ --with-pear

 

其中--with-apxs2是用来生成Apache的PHP模块libphp5.so的,不需要可以去掉.

make
make install php配置 php.ini是php运行核心配置文件 php-fpm.conf是php-fpm进程服务的配置文件

1 # cd php-5.6.28 2 3 # cp php.ini-production /etc/php.ini 4 5 # cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf 6 7 # cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm 8 9 # chmod +x /etc/init.d/php-fpm

  fpm测试php配置

# /usr/local/php/sbin/php-fpm -t [23-May-2016 20:03:52] NOTICE: configuration file /usr/local/php/etc/php-fpm.conf test is successful

添加到server里管理启动:

# chkconfig --add php-fpm # chkconfig php-fpm on # service php-fpm start Starting php-fpm done netstat –anpt tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 705/php-fpm

  修改PHP默认端口:

vi /usr/local/php/etc/php-fpm.conf listen = 127.0.0.1:8000

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/4661c07bfe0a362147be619bf290fdfe.html