Quantcast
Channel: PHP relative path: can I configure it? - Stack Overflow
Browsing latest articles
Browse All 6 View Live

Answer by Chris G for PHP relative path: can I configure it?

<?php $path = $_SERVER['DOCUMENT_ROOT']; $path .= "/Folder/File.php"; include_once($path);?>That should do the trick :)

View Article



Answer by Vineet1982 for PHP relative path: can I configure it?

You have to use auto_prepend_file. if PHP is run as an Apache module then .htaccess file to the path to your config.php file and any PHP file accessed will automatically have the contents of the config...

View Article

Answer by Nick Kuznia for PHP relative path: can I configure it?

If you want to override existing functionality in place you need to either install an external library or use namespaces. Both are extra work. I'm guessing that installing an extra library probably...

View Article

Answer by Progrock for PHP relative path: can I configure it?

index.php:chdir('webroot');require_once('home.php');

View Article

Answer by IMSoP for PHP relative path: can I configure it?

The path used to resolve relative URLs like this is configured by the include_path configuration option which has a dedicated function for setting it at runtime: set_include_path. Note that the set of...

View Article


PHP relative path: can I configure it?

tl;dr: How do I make PHP interpret relative paths in include/require statement from the perspective of the current file?This is yet another question about that old issue in PHP about relative paths....

View Article
Browsing latest articles
Browse All 6 View Live


Latest Images