0

I'm having an issue with using XAMPP and the ability to use an includes folder in php etc. I'm learning how to use a single point access for my php files, by that I mean, you put only an index.php in the main folder to be accessed and it is it use classes that are located in the Includes folder outside the public_php folder.

Here is the current config inside the httpd.conf (located in the apache2 folder)

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>

Here is a screenshot of my file structure, is someone able to help me on how to use the DirectoryIndex setting so that my program is able to just use the require_once 'bla/bla.php';

File structure screenshot

Thanks for any contribution given.

4

1 回答 1

0

require_once(以及其他变体)在本地包含文件。

您不必使用别名来访问它们,只需编写完整的本地路径

如果您的文件位于/Applications/XAMPP/bla/bla.php

require_once('/Applications/XAMPP/bla/bla.php');
于 2013-11-06T21:17:31.410 回答