The path problem in php and set_include_path. This article mainly introduces the path problem in php and set_include_path. if you need it, refer to the path commonly used in first: php. current file path: D: phpwebphp_exampleinclude_pat this article mainly introduces the path problem and set_include_path in php. For more information, see
First: commonly used php path current file path: D: \ phpweb \ php_example \ include_path.php code is as follows: 1. dirname (_ FILE _); // output D: \ phpweb \ php_example 2. $ _ SERVER ['script _ filename']; // Output D:/phpweb/php_example/include_path.php second: set_include_path in php is in php. when the file is included, when the include path is not relative or absolute (for example, include ("example. php "), the directory set by include_path will be searched first, and then searched in the current directory. This is why many documents mentioned include (". /example. php ") than include (" example. php ") causes of high efficiency. Method: 1. ini_set ("include_path", "/usr/lib/pear"); // All Versions 2. set_include_path ("/usr/lib/pear"); // version> = 4.3.0 you can use the following method to add the directory code to the original Directory:
Usually first: php commonly used path current file path: D: \ phpweb \ php_example \ include_pat...