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的防火墙配置!】

  • 相关阅读:
    定时任务(收集)
    命令学习(收集)
    查看进程运行时间
    Linux 中挂载 ISO 文件
    9.已知三边计算三角形的面积公式
    8.输入一个大写字母,要求小写字母输出
    1.输出三个数中的最大值
    2.依次从大到小输出三个数
    3.计算1+2+3+....100=?
    4.计算1*2*3*4........*100=?
  • 原文地址:https://www.cnblogs.com/tujia/p/5392319.html
Copyright © 2011-2022 走看看