How do you know the correct path to use in a PHP require_once() statement

后端 未结 9 2127
别跟我提以往
别跟我提以往 2021-01-31 22:02

As many do I have a config.php file in the root of a web app that I want to include in almost every other php file. So most of them have a line like:

require_on         


        
9条回答
  •  日久生厌
    2021-01-31 22:58

    The only place I've seen the path evaluated from is the file that you are currently editing. I've never had any problems with it, but if you are, you might want to provide more information (PHP version, OS, etc).

提交回复
热议问题