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
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