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?>
Large-Scale Price Reduction
  • 59% Max. and 23% Avg.
  • Price Reduction for Core Products
  • Price Reduction in Multiple Regions
undefined. /
Connect with us on Discord
  • Secure, anonymous group chat without disturbance
  • Stay updated on campaigns, new products, and more
  • Support for all your questions
undefined. /
Free Tier
  • Start free from ECS to Big Data
  • Get Started in 3 Simple Steps
  • Try ECS t5 1C1G
undefined. /

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.