配置 Apache 和 PHP
打开 Apache 安装目录下的 conf 子目录中的 httpd.conf 文件。
1. 找到:
DocumentRoot “xxxxxxx”
改成你本机的网站内容的目录。例如我的:
DocumentRoot “E:/web”
改完之后往下稍微拉动一下,找到“# This should be changed to whatever you set DocumentRoot to.”,然后把下面这个地方也改过来
<Directory “E:/web”>
2. 找到 LoadModule,根据你的 php 安装目录,在下面空白处加上这两行:
LoadModule php5_module “D:/PHP/php5apache2_2.dll”
PHPIniDir 
“D:/PHP”
3. 找到:
DirectoryIndex index.html
修改为:
DirectoryIndex index.php index.html
4. 找到:
AddType application/x-gzip .gz .tgz
添加这几行:
AddType application/x-httpd-php .php .inc
AddType application/x-httpd-php .html
AddType application/x-httpd-php-source .phps
5. 保存 httpd.conf
                  
                  
                  
                  
本文指导如何在本地服务器上配置Apache与PHP,包括修改httpd.conf文件以指向网站内容目录,加载PHP模块,调整目录索引及类型,确保本地开发环境的正确设置。
          
      
          
                
                
                
                
              
                
                
                
                
                
              
                
                
              
            
                  
					1425
					
被折叠的  条评论
		 为什么被折叠?
		 
		 
		
    
  
    
  
            


            