• 编译安装apache+php(加常见问题解决)


    【编译apache】点这里下载(wget之类的),解压到 /usr/local/lamp/httpd,进入httpd目录

    ./configure --prefix=/usr/local/lamp/httpd
    make && make install

    【可能出现的问题--缺少apr或说apr版本不对(apr 、apr-util 、pcre)】
    请到http://archive.apache.org上下载最新的apr来编译安装

    编译apr

    ./configure --prefix=/usr/local/apr
    make && make install

    apr-util 和 pcre也一样


    编译apr-util

    ./configure --prefix=/usr/local/lamp/apr-util -with-apr=/usr/local/apr/bin/apr-1-config
    make && make install

    编译pcre(可以到 https://sourceforge.net/projects/pcre/files/ 上下载)

    ./configure --prefix=/usr/local/pcre
    make && make install

     

    上面三个东西都全了的话,编译apache应该就没问题了!!(如果提示没有c编译器,请用yum安装gcc、gcc-c++)

    ./configure --prefix=/usr/local/lamp/httpd -with-apr=/usr/local/apr -with-apr-util=/usr/local/apr-util -with-pcre=/usr/local/pcre

    *********************************************************************************************************************************************

    【编译php(使用./configure --help|grep Apache可以查看相关配置参数)】

    ./configure --prefix=/usr/local/lamp/php -with-apxs2=/usr/local/lamp/httpd/bin/apxs
    make && make install

    【可能出现的问题--缺少libxml2】
    使用yum安装libxml2、libxml2-devel

    yum install libxml2 libxml2-devel

    【修改apache配置 /usr/local/lamp/httpd/conf/httpd.conf】
    配置.php后缀的处理程序

    AddType application/x-httpd-php .php

    【大功告成!!!,如果ip访问不是apache服务,检查一下centos的防火墙配置!】

  • 相关阅读:
    四种wordpress常用的循环结构
    自动创建网页文章目录结构
    shell
    SSH
    架构
    Https
    if-else、switch、while、for
    do-while
    const
    Tail Call
  • 原文地址:https://www.cnblogs.com/tujia/p/5392319.html
Copyright © 2020-2023  润新知