zoukankan      html  css  js  c++  java
  • php源代码安装

    1.在官网下载php安装源文件。版本选择5的最新稳定版。
    [root@trial download]# wget http://cn.php.net/distributions/php-5.5.38.tar.gz

    2.下载下来的是一个mirror文件,重命名为php-5.5.38.tar.gz,并解压到源文件目录
    [root@trial download]# tar -zxvf php-5.5.38.tar.gz -C /usr/local/src/
    [root@trial download]# cd /usr/local/src/php-5.5.38/

    1. 编译安装
      [root@trial php-5.5.38]# ./configure --prefix=/usr/local/php5.5.38 --with-mysql=mysqlnd --enable-mysqlnd --with-gd --enable-gd-native-ttf --enable-gd-jis-conv --enable-fpm
      [root@trial php-5.5.38]# make
      [root@trial php-5.5.38]# make install

    2. 配置
      [root@trial php-5.5.38]# cd /usr/local/php5.5.38/
      [root@trial php5.5.38]# cp etc/php-fpm.conf.default etc/php-fpm.conf
      [root@trial php5.5.38]# vim /usr/local/nginx1.6.3/conf/nginx.conf

       location ~ \.php$ {
           root           html;
           fastcgi_pass   127.0.0.1:9000;
           fastcgi_index  index.php;
           fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
           include        fastcgi_params;
       }
      

    此段取消注释,然后红色字体部分修改为$document_root

    1. 启动
      [root@trial php]# sbin/php-fpm

    6.验证
    [root@trial php5.5.38]# netstat -nltup |grep 9000 #若有抓到9000端口,说明php起来了。
    [root@trial html]# echo '' > phpinfo.php
    访问到php信息页,说明php配置好了

    QA:
    configure时报错误
    configure: error: xml2-config not found. Please check your libxml2 installation.
    检查libxml2已经安装,但是libxml2-devel未安装。
    解决
    [root@trial php-5.5.38]# yum -y install libxml2-devel.i686

    configure时报错误:
    configure: error: png.h not found.
    解决:
    [root@trial php-5.5.38]# yum -y install libpng libpng-devel

  • 相关阅读:
    【VUE】自定义组件
    【docker】Dockerfile
    【docker】常用命令
    【Java Web开发学习】跨域请求
    xshell6和xftp6运行提示缺少mfc110u.dll文件的解决办法
    【NPM】使用问题记录
    【Zuul】使用学习
    第八章 泛型程序设计
    第九章 集合
    分布式系列二: 分布式系统的通信
  • 原文地址:https://www.cnblogs.com/minn/p/7722955.html
Copyright © 2011-2022 走看看