我正在学习如何使用单点访问我的php文件,我的意思是,你只在要访问的主文件夹中放置一个index.php,它使用位于public_php文件夹外的includes文件夹中的类。
以下是httpd.conf (位于apache2文件夹)中的当前配置
Here is the current config :
Alias /bitnami/ "/Applications/XAMPP/xamppfiles/apache2/htdocs/"
Alias /bitnami "/Applications/XAMPP/xamppfiles/apache2/htdocs"
<Directory "/Applications/XAMPP/xamppfiles/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.html index.php
</Directory>
这是我的文件结构的屏幕截图,是有人能够帮助我如何使用DirectoryIndex设置,以便我的程序能够只使用require_once 'bla/bla.php';
感谢您的贡献。
发布于 2013-11-07 05:17:31
require_once
(以及它的其他变体)包含本地文件。
你不必使用你的别名来访问它们,只需写下完整的本地路径
如果您的文件位于/Applications/XAMPP/bla/bla.php
require_once('/Applications/XAMPP/bla/bla.php');
https://stackoverflow.com/questions/19820956
复制相似问题