简体   繁体   English

php include_path本地值和主值有什么区别?

[英]What is difference between php include_path Local Value and Master Value?

I am trying to use PEAR classses. 我正在尝试使用PEAR类。

When i check phpinfopear path is in master value , but not in Local value. 当我检查phpinfopear路径是主值,但不是本地值。 What is the difference? 有什么区别?

How can i check pear is enabled or not? 如何检查梨是否已启用?

In php 5.3 Phar and pear are same or not? 在PHP 5.3 Phar和梨是否相同?

If any one can provide a very simple program to check that am able to include pear class and working fine will be great 如果任何人可以提供一个非常简单的程序来检查是否能够包括梨类和工作正常将是伟大的

PHAR (PHP archive) is only a way to deploy php application in an archived form. PHAR(PHP存档)只是一种以存档形式部署php应用程序的方法。 PEAR (PHP Extension and Application Repository) doesn't have anything to do with that. PEAR(PHP扩展和应用程序存储库)与此无关。

The master value is the one that is set in php.ini whereas the local value can come from your vhost config, .user.ini (in PHP 5.3) or even be set by your own script using ini_set . 主值是在php.ini中设置的值,而本地值可以来自您的vhost配置,.user.ini(在PHP 5.3中),甚至可以使用ini_set由您自己的脚本设置。

PEAR classes are plain PHP code and you don't need to install anything in order to use them. PEAR类是普通的PHP代码,您无需安装任何东西即可使用它们。 PEAR provides a command line installer that takes care of downloading all required stuff, dependencies and all, but it's basically a commodity. PEAR提供了一个命令行安装程序,负责下载所有必需的东西,依赖项和所有内容,但它基本上是一种商品。

I assume that you want to add your PEAR directory to the include_path directive so PEAR code actually works (PEAR makes heavy use of it when including files). 我假设您要将PEAR目录添加到include_path指令中,以便PEAR代码实际工作(PEAR在包含文件时大量使用它)。 You can do so with the set_include_path() function. 您可以使用set_include_path()函数执行此操作。 If you run phpinfo() to see current values, you should see the system-wide default value in the Master column and your local changes in the Local column. 如果运行phpinfo()以查看当前值,则应在“ 主”列中看到系统范围的默认值,在“ 本地”列中看到本地更改。

As about PHAR , it's an archive format to pack PHP code. 关于PHAR ,它是一种打包PHP代码的存档格式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM