A
A
Andrey2015-11-04 15:07:49
htaccess
Andrey, 2015-11-04 15:07:49

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

3 answer(s)
D
Dokuro, 2015-11-04
@andreyk0

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.

Z
zooks, 2015-11-04
@zooks

In most cases, these are problems in the paths.

D
Dmitry, 2015-11-04
@mytmid

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 question

Ask a Question

731 491 924 answers to any question