You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

EasyPHP 1.8默认页异常:访问本地Web时index.php不显示自动打开index.html

Fixing Index.php Not Loading in EasyPHP 1.8

Hey there! I totally get your frustration—let's break down why your index.php isn't showing up instead of index.html, and how to fix it.

The Root Cause

EasyPHP uses Apache under the hood, and Apache has a setting called DirectoryIndex that tells it which files to look for first when accessing a folder. By default in older versions like 1.8, index.html is listed before index.php in this priority order. That means if both files exist in your www folder, Apache will load index.html automatically instead of index.php.

How to Fix It

There are two simple ways to adjust this:

1. Modify Apache's Global Configuration (Applies to All Sites)

  • Open your EasyPHP installation folder (usually something like C:\Program Files\EasyPHP-1.8 or wherever you installed it).
  • Navigate to the apache\conf folder and open the httpd.conf file with a text editor (like Notepad or VS Code).
  • Use the search function to find the line starting with DirectoryIndex. It’ll look something like this:
    DirectoryIndex index.html index.php
    
  • Swap the order so index.php comes first:
    DirectoryIndex index.php index.html
    
  • Save the file, then restart the Apache server from the EasyPHP control panel. Now Apache will check for index.php first!

2. Use a .htaccess File (Only Applies to Your www Folder)

If you don’t want to mess with the global Apache settings, you can create a local configuration file just for your website folder:

  • Open a text editor and paste this line:
    DirectoryIndex index.php index.html
    
  • Save the file as .htaccess (make sure the filename starts with a dot and there’s no .txt extension at the end).
  • Move this file into your EasyPHP www folder. Apache will automatically pick up this setting for that directory.

Either method should make your index.php load by default when you access your local site. Let me know if you run into any hiccups!

内容的提问来源于stack exchange,提问作者user9311878

火山引擎 最新活动