0

I am working on Yii2/CentOS8/Nginx:.

require (__DIR__ . '/../test.php'); work

require (__DIR__ . '/../config/test.php'); doesn't work

test.php and config/test.php exist. why does it happen? Anybody help me please

3
  • 1
    sanity check.. does DIR . '/../config/test.php'? exist, its not a lot to go on fancy providing us with error message? Commented Jun 19, 2020 at 23:52
  • You need to show us your file/folder structure. Specifically for where the file with these require's is in relation to the files you're trying to require, or we won't know if the paths are correct or not. Commented Jun 20, 2020 at 0:22
  • I'm glad you found a solution. One thing you can add to improve the question in the future is the error you were getting. Commented Jun 20, 2020 at 2:02

1 Answer 1

2

I just fixed. that was cause of selinux permission.

chcon -Rt httpd_sys_content_t /path/to/www
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.