zoukankan      html  css  js  c++  java
  • linux下配置php Apache mysql

    一 Apache部分

    http://www.cnblogs.com/bluewelkin/p/3805107.html
    里面是纠正了原文的一些小错误,即可正常安装

    1、su 命令
    2、安装apr-1.3.5.tar.gz
    # tar zxvf apr-1.3.5.tar.gz

    # cd apr-1.3.5

    # ./configure
    出现错误
    no acceptable C compiler found in $PATH
    ---------------------------------------------
    解决方案,没有按照GCC套件
    切换到root权限: su
    输入密码后即为root权限,然后保证电脑能联网,输入:
    yum install  gcc

    #make

    #make install
    3、
    安装apr-util-1.3.7.tar.gz
    # tar zxvf apr-util-1.3.7.tar.gz

    # cd apr-util-1.3.7

    # . /configure --with-apr=/usr/local/apr
    ./configure --with-apr=/usr/local/apr(这个是修正之后的)

    # make

    # make install
    4
    安装httpd-2.2.11.tar.gz
    # tar zxvf httpd-2.2.11.tar.gz

    # ./configure --prefix=/usr/local/apache2 --enable-dav --enable-modules=so --enable-maintainer-mode --enable-rewrite

    --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config

    【bash: ./configure: 没有那个文件或目录

    --------------------------------------------------

    解决方案: chmod a+x configure 修改一下这个文件的权限即可】


    # make

    # make install

    启动Apache服务:

    # /usr/local/apache2/bin/apachectl start
    apache启动时
    出现错误 httpd: apr_sockaddr_info_get() failed for
    httpd: apr_sockaddr_info_get() failed for VM_74_204_centos
    httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
    解决方案
    --------------------------------------------
     在Apache的安装目录下的conf文件修改httpd.conf如下
       (1) ServerName localhost:80                       

       或者在 /etc/hosts 中填入自己的主机名称 bogon,如下:
       (2)127.0.0.1 bogon
    ---------------------------------------------
    并且编辑如下:
     编辑 /usr/local/apache2/conf/httpd.conf 文件       
      找到:    AddType  application/x-compress .Z    AddType application/x-gzip .gz .tgz  
     在后面添加:
       AddType application/x-httpd-php .php(使Apcche支持PHP)    A
    ddType application/x-httpd-php-source .php5     
     找到:    <IfModule dir_module>    DirectoryIndex index.html    </IfModule> 
      添加:    <IfModule dir_module>    DirectoryIndex index.html index.php    </IfModule>      
     找到:    #ServerName www.example.com:80  
     修改为:    ServerName 127.0.0.1:80或者ServerName localhost:80   
    记得要去掉前面的“#”     

    用浏览器查看http://localhost/,得到It works!

    说明apache已经配置成功了。

    ---------------------------------------------

    参考文章:http://www.cnblogs.com/lufangtao/archive/2012/12/30/2839679.html

    出现错误:libphp5.so没有编译成功

    ------------------------------

    解决方案:在Apache的安装目录下http.conf配置文件下

    增加这一行 LoadModule php5_module       /usr/local/apache2/modules/libphp5.so

  • 相关阅读:
    3-为什么很多 对 1e9+7(100000007)取模
    6-关于#include<bits/stdc++.h>
    7-n!的位数(斯特灵公式)
    5-math中函数汇总
    6-找数的倍数
    6-Collision-hdu5114(小球碰撞)
    5-青蛙的约会(ex_gcd)
    4-圆数Round Numbers(数位dp)
    4-memset函数总结
    一种Furture模式处理请求中循环独立的任务的方法
  • 原文地址:https://www.cnblogs.com/bluewelkin/p/3894647.html
Copyright © 2011-2022 走看看