Warning: require_once(): http:// wrapper is disabled in the server configuration by allow_url_include=0

前端 未结 9 1952
自闭症患者
自闭症患者 2020-12-02 15:44

I am trying to include a php file in a page via

  require_once(http://localhost/web/a.php)

I am getting an error

 Warning:         


        
9条回答
  •  时光取名叫无心
    2020-12-02 15:59

    You have to put the path to the file. For example:

    require_once('../web/a.php');
    

    You cannot get the file to require it from internet (with http protocol) it's restricted. The files must be on the same server. With Possibility to see each others (rights)

    Dir-1 -
             > Folder-1 -> a.php
    Dir-2 -
             > Folder-2 -> b.php
    
    To include a.php inside b.php => require_once('../../Dir-1/Folder-1/a.php');
    To include b.php inside a.php => require_once('../../Dir-2/Folder-2/b.php');
    

提交回复
热议问题