PHP include file in webroot from file outside webroot

后端 未结 5 1349
没有蜡笔的小新
没有蜡笔的小新 2020-12-03 20:02

I have a php file outside my webroot in which I want to include a file that is inside the webroot.

folder outside webroot
- > php file in which

5条回答
  •  一个人的身影
    2020-12-03 20:14

    This should work

    $_SERVER['DOCUMENT_ROOT']/home/xx/xx/domains/mydomain/webroot/file-to-include.php
    

    And make sure you have access to that level.

提交回复
热议问题