zoukankan      html  css  js  c++  java
  • 编译安装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的防火墙配置!】

  • 相关阅读:
    有没有对象???new一个???
    原生数组的方法--翻转
    rclone的基本用法
    golang 文件操作
    记一次挖矿程序处理 firstpress
    python 第三方库 网络 requests
    python 第三方库 时间 arrow
    ansible playbook loop 翻译
    硬盘性能测试工具之bonnie++
    磁盘性能测试工具之fio
  • 原文地址:https://www.cnblogs.com/tujia/p/5392319.html
Copyright © 2011-2022 走看看