zoukankan      html  css  js  c++  java
  • php开发环境配置及虚拟目录设置

    php开发环境配置
        --1--apache环境配置:httpd.conf
            (1)# LoadModule rewrite_module modules/mod_rewrite.so(注意:是mod_rewrite 前面的"#"去掉)
            (2)文档中所有凡是出现 AllowOverride为None
            (3)<Directory />
                    Options FollowSymLinks
                    AllowOverride All
                    Order deny,allow
                    Deny from all(改为allow from all)
                 </Directory>
            (4)DocumentRoot "C:/wamp/www"   apache 配置虚拟路径      

                  注意:请确保路径正确,且路径存在   否则apache不能启动
                --apache2.2.22版本保留默认即可

            (5)如果此时访问应该会出现权限不够的问题
                     所以我们还需应用访问的权限AllowOverride到指定的apache配置的虚拟路径下
                  <Directory "c:/testWeb/public/">
                --apache2.2.22版本保留默认即可
        --2--php环境配置:php.ini
            (1)将library 放置好然后php.ini里配置include  library
                ; UNIX: "/path1:/path2"
                ;include_path = ".:/php/includes"
                ;
                ; Windows: "\path1;\path2"
                include_path = ".;c:\library"
                --php5.3.13版本保留默认即可
        
        --3--虚拟目录配置
            (1)去掉apache httpd.conf下面两句话前面的#

                LoadModule vhost_alias_module modules/mod_vhost_alias.so

                Include conf/extra/httpd-vhosts.conf
            (2)C:\Windows\System32\drivers\etc下找到hosts文件

                配置

                127.0.0.1 tools.localhost

                127.0.0.1 website.localhost
    以下设置虚拟目录:
            (3)找到C:\wamp\bin\apache\Apache2.2.11\conf\extra下的httpd-vhost.conf文件

                配置如下数据
                NameVirtualHost *:80(端口号被占用更改为新的,同时httpd.conf中#Listen 12.34.56.78:80 更改Listen 8080)
                <VirtualHost *:8080>
                  ServerName website.localhost
                    ServerAdmin webmaster@test.tools.directhr.net
                    DocumentRoot "C:\Users\n.zhang\Documents\Website\DHR3"
                 <Directory "C:\Users\n.zhang\Documents\Website\DHR3">
                  Options Indexes MultiViews FollowSymLinks
                  AllowOverride All
                   Order allow,deny
                   Allow from all
                  </Directory>
         
                     ErrorLog "logs/test.tools.directhr.net-error.log"
                     CustomLog "logs/test.tools.directhr.net-access.log" common
                 </VirtualHost>
     
                <VirtualHost *:8080>
                  ServerName tools.localhost
                    ServerAdmin webmaster@test.tools.directhr.net
                    DocumentRoot "C:\Users\n.zhang\Documents\Tools"
                 <Directory "C:\Users\n.zhang\Documents\Tools">
                  Options Indexes MultiViews FollowSymLinks
                  AllowOverride All
                  Order allow,deny
                  Allow from all
                 </Directory>
         
                    ErrorLog "logs/test.tools.directhr.net-error.log"
                    CustomLog "logs/test.tools.directhr.net-access.log" common
                </VirtualHost>


  • 相关阅读:
    Oracle 数据库连接很慢,服务器监听一直等待
    Maven 根据不同的环境使用不同的配置
    Maven 根据不同的包路径打出不同的Jar包
    Linux 安装Nginx并支持SSL
    Nginx OpenSSL创建自签证书实现HTTP转HTTPS
    Oracle 服务突然中断处理(检查状态、重启)
    请求转发和重定向
    PHP PDO的简单封装(使用命名空间方式)
    PHP PDO学习小结
    MYSQL预处理机制
  • 原文地址:https://www.cnblogs.com/mucaiweiblog/p/3397413.html
Copyright © 2011-2022 走看看