Path Problems in php and set_include_path_PHP tutorial

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.