Answer the question
In order to leave comments, you need to log in
Misunderstandings with .htaccess and require_once, how to solve?
the folder contains the file run.php with the content
<
require_once '../plus.php';
>
and a .htaccess file with the content
<
Order Deny,Allow
Deny from all
>
so the question is, why including an existing plus.php file outside of the folder gives an error - PHP Fatal error: require_once(): Failed opening required?
Answer the question
In order to leave comments, you need to log in
open_basedir can interfere?
The current htaccess rules do not affect php and require_once, check the path, try to set the full path instead of relative.
Similar question
And if on business:
1. It is not necessary to use require, require_once, include and include_once.
2. Check out PSR-4
3. If it's not possible to write normal code, for whatever reason, then use absolute paths instead of relative ones in require_once.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question