PHP安装:

系统环境: RHEL5.4 x86-64

 

tar jxflibmcrypt-2.5.8.tar.bz2    ##解压安装包

./configure prefix=/usr/local/php with-config-file-path=/usr/local/php/etc--with-mysql=/usr/local/mysql/

--with-openssl--with-snmp --with-gd --with-zlib --with-curl --with-libxml-dir --with-png-dir--with-jpeg-dir --with-

freetype-dir with-pear --with-gettext --with-gmp --with-mcrypt--enable-inline-optimization --enable-soap

--enable-ftp--enable-sockets --enable-mbstring--with-mysqli=/usr/local/mysql/bin/mysql_config --enable-fpm

--with-fpm-user=wwwwith-fpm-group=www with-libdir=lib64


cgi.fix_path info=0  #防止 Nginx 文件类型错误解析漏洞

: ln -s /usr/local/mysql/lib/usr/local/mysql/lib64 不然 php 编译的时候找不到mysql 的库文件

PHP安装:_php

PHP安装:_php_02

PHP安装:_lamp_03

 操作步骤

 (1)安装

  241  tarjxf php-5.6.20.tar.bz2

  242  ls

  243  cdphp-5.6.20/

  244  ls

PHP安装:_lamp_04

  245  cd..

  246  yum install  curl-devellibjpeg-turbo-devel-1.2.1-1.el6.x86_64 libpng-devel  freetype-devel  net-snmp-devel bison  gmp-devel 

  248  ls

  259 rpm -ivh libmcrypt-devel-2.5.8-9.el6.x86_64.rpmlibmcrypt-2.5.8-9.el6.x86_64.rpm ###解决依赖性的软件。

  250  ls

  251 rpm -ivh re2c-0.13.5-1.el6.x86_64.rpm  ###以上都是加载过程中需要的安装包。Yum库中没有就去网上下载

  252  cdphp-5.6.20/

  253 ./configure --prefix=/usr/local/lnmp/php--with-config-file-path=/usr/local/lnmp/php/etc --with-mysql=mysqlnd--with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --with-snmp--with-gd --with-zlib --with-curl --with-libxml-dir --with-png-dir--with-jpeg-dir --with-freetype-dir --with-gmp --with-gettext--enable-inline-optimization --enable-soap --enable-ftp --enable-sockets--enable-mbstring --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx--with-mcrypt --with-mhash

  254 make && make install

PHP安装:_php_05

 在加载过程中缺什么安装什么。

PHP安装:_php_06

PHP安装:_lamp_07

PHP安装:_lamp_08

 (2)配置

  257  cp php.ini-production /usr/local/lnmp/php/etc/php.ini

  258  cd sapi/

  259  ls

  260  cdfpm/

  261  ls

  262  cp init.d.php-fpm /etc/init.d/php-fpm

  263 chmod +x /etc/init.d/php-fpm

  264  cd ..

  265  cd/usr/local/lnmp/php/etc/

PHP安装:_lamp_09

  266  ls

  267 vim php.ini  ###改时区

        925 date.timezone = Asia/shanghai

截图

PHP安装:_lamp_10

  268  cpphp-fpm.conf.default php-fpm.conf

  269 vim php-fpm.conf

截图

PHP安装:_php_11

  270 /etc/init.d/php-fpm start

PHP安装:_php_12

  276 vim  ~/.bash_profile

截图:

PHP安装:_php_13

  277 source  ~/.bash_profile

  278 php -m

  279 netstat -antlp | grep :9000

  281  cd..

  282  cdnginx/

  283  ls

  284  cdconf

  285  ls

  286 vim nginx.conf

截图:

PHP安装:_lamp_14

PHP安装:_php_15

PHP安装:_lamp_16

  287  cd..

  288  cdhtml/

  289  ls

  291 vim index.php  ## 完整路径vim /usr/local/lnmp/nginx/conf/nginx.conf

截图:

PHP安装:_php_17

  296 nginx -t    #检查nginx有没有语法错误

  297 nginx   ###开启服务


测试:输入IP

PHP安装:_php_18