zoukankan      html  css  js  c++  java
  • Php5.6与Apache2.4

    *

    参考文章:php5.5 + apache2.4 安装配置

    一,准备

     1,下载php-5.6.27-Win32-VC11-x64.zip

    2,httpd-2.4.23-win64-VC14.zip

    地址:http://www.apachelounge.com/download/

    3,之前安装过vcredist_x86.exe    (Microsoft Visual C++ 2012 Redistributable (x86) - 11.0.61030)

    此处略过,如果没有,就需要安装了

    二,配置

    1,path添加php

    在系统环境变量PATH中添加 ;D:php;D:phpext, 

    在php中

    2,

    修改D:softwareWebServerapacheApache24confhttpd.conf.

    把ServerRoot这行修改为 ServerRoot "D:softwareWebServerapacheApache24", 双引号之间的就是你的apache放置的位置

    多处有这样的路径,建议整体替换

    D:softwareWebServerapacheApache24in>httpd.exe
    AH00558: httpd.exe: Could not reliably determine the server's fully qualified domain name, using fe80::8cf8:2311:ec23:abf1. Set the 'ServerName' directive globally to suppress this message
    
    D:softwareWebServerapacheApache24in>httpd.exe

    有错误,配置以下,地址可以随便取

    ServerName localhost:8082

    3,

    修改D:Apache24confhttpd.conf.

    把DocumentRoot按照下面的内容修改:

    DocumentRoot "d:/Apache24/htdocs"

    <Directory "d:/Apache24/htdocs">

    把Listen Port修改为:Listen 8080

    4,

    # php5 support

    LoadModule php5_module D:/php/php5apache2_4.dll

    AddType application/x-httpd-php .php .html .htm

    # configure the path to php.ini

    PHPIniDir "D:/php"

    5,我没有做这步,直接在apache的bin目录,输入httpd.exe回车运行的

    保存httpd.conf, 重启Apache服务。

    小技巧:d:apache24inhttpd.exe -k install, 这句可以把apache添加到系统服务里去。(要以管理员身份运行)

    C:Windowssystem32>d:
    
    D:>cd D:softwareWebServerapacheApache24in
    
    D:softwareWebServerapacheApache24in>httpd.exe -k install
    Installing the 'Apache2.4' service
    The 'Apache2.4' service is successfully installed.
    Testing httpd.conf....
    Errors reported here must be corrected before the service can be started.
    
    D:softwareWebServerapacheApache24in>

    6,在浏览器中打开 127.0.0.1:8082, (我的监听端口是8082)是不是能看到it works,这说明你的apache已经工作了。

     三,配置虚拟主机多站点

    1,在apache的httpd.conf中打开vhost的配置

    # Virtual hosts
    Include conf/extra/httpd-vhosts.conf

    2,打开conf/extra/httpd-vhosts.conf文件,这是默认的示例,我们需要改

    <VirtualHost *:80>
        ServerAdmin webmaster@dummy-host.example.com
        DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
        ServerName dummy-host.example.com
        ServerAlias www.dummy-host.example.com
        ErrorLog "logs/dummy-host.example.com-error.log"
        CustomLog "logs/dummy-host.example.com-access.log" common
    </VirtualHost>
    
    <VirtualHost *:80>
        ServerAdmin webmaster@dummy-host2.example.com
        DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
        ServerName dummy-host2.example.com
        ErrorLog "logs/dummy-host2.example.com-error.log"
        CustomLog "logs/dummy-host2.example.com-access.log" common
    </VirtualHost>

    *

    <VirtualHost *:8082>
        DocumentRoot "D:softwareWebServerapacheApache24htdocsuilder_frontdist"
        ServerName 127.0.0.2
        
        
    </VirtualHost>

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

    遇到的问题:

    1,配置虚拟主机后,一直不能访问,我放在不同于apache的盘符,后来移到了htdocs目录下

    并且开始

    <VirtualHost *:8082>和ServerName localhost:8082

    开始都是80,但是listen是8082,然后servername www.baidu.com:80

    一直不能访问,
    改为了一致端口8082就可以
    还有一个大小目录包含的问题,在其下的目录下才有权限
    #
    # "D:/software/WebServer/apache/Apache24/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    #
    <Directory "D:/software/WebServer/apache/Apache24/">
        AllowOverride None
        Options None
        Require all granted
    </Directory>
     

    *

    有问题在公众号【清汤袭人】找我,时常冒出各种傻问题,然一通百通,其乐无穷,一起探讨


  • 相关阅读:
    解析url
    初学react
    移动端判断用户滑动方向
    冒泡排序、快速排序、数组去重
    Angular Material主题配置
    reset()方法的使用、jq下面reset()的正确使用方法
    conts、var 、let的区别
    NLP
    mybatis的执行流程
    PHP递归算法示例:打印无限级数组元素的值
  • 原文地址:https://www.cnblogs.com/qingmaple/p/6068264.html
Copyright © 2011-2022 走看看