what does it mean “(include_path='.:/usr/share/pear:/usr/share/php')”?

后端 未结 7 2315
暗喜
暗喜 2021-02-18 16:31

I have file structure on EC2 like : but facing some file referencing problem.

index.php
-db
  -config.php
-cron
  -cron1.php

I have tried file

7条回答
  •  悲&欢浪女
    2021-02-18 16:59

    Many developers include files by pointing to a remote URL, even if the file is within the local system. For example:

    
    

    With allow_url_include disabled, this method does not work. Instead, the file must be included with a local path, and there are three methods of doing this:

    By using a relative path, such as ../includes/example_include.php. By using an absolute path (also known as relative-from-root), such as /home/username/example.com/includes/example_include.php.

    By using the PHP environment variable $_SERVER['DOCUMENT_ROOT'], which returns the absolute path to the web root directory. This is by far the best (and most portable) solution. The following example shows the environment variable in action.

    Example Include

    
    

提交回复
热议问题