Path problems in PHP and set

Source: Internet
Author: User
Tags pear php and php code

This article mainly introduces the path problem and Set_include_path in PHP, need friends can refer to the following

first:php Common Path Current file path: d:phpwebphp_exampleinclude_path.php code as follows: 1.dirname (__file__); Output d:phpwebphp_example 2.$_server[' script_filename ']; Output d:/phpweb/php_example/include_path.php second:php Set_include_path in PHP, include files when the include path is not relative or absolute (for example: inclu De ("example.php"), finds the directory set by Include_path, and then looks in the current directory, which is why a lot of information mentions include ("./example.php") than include ("    example.php ") The reason for the high efficiency. Methods: 1.ini_set ("Include_path", "/usr/lib/pear"); All versions 2.set_include_path ("/usr/lib/pear");  VERSION>=4.3.0 can use the following method to add the directory code to the original directory as follows: <?php $path = '/usr/lib/pear '; Set_include_path (Get_include_path (). Path_separator. $path);//set Include_path to resemble/usr/lib/function;/usr/lib/pear?>
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.