PHP库是动态链接还是静态链接? [英] Are PHP libraries linked dynamically or statically?

查看:97
本文介绍了PHP库是动态链接还是静态链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




当PHP程序使用include或require(或他们的

_once变体)链接到库时,库是否会动态链接或静态地?


虽然从技术角度来看似乎无关紧要,但是当涉及许可问题时,

链接方法很重要/>
许可证,如GPL,在这些链接类型之间有所不同

将库视为主程序的衍生作品。


因此,在包含库时,知道什么样的链接在

效果中是非常重要的,我希望这个组中的某个人能够对这个问题有所了解。事情。


非常感谢您提前,

Martin

解决方案

7月19日下午4:14,Martin Larsen< martin + spamfree + lar ... @ bigfoot.com>

写道:


>

当PHP程序使用include

或require(或它们的_once变体)链接到库时,库是

然后动态或静态链接?



两者都没有。 include / require不是一种链接机制;这是一种在解释之前汇总完整源代码块的方法。

任何静态链接都发生在服务器进程启动时(即,

在任何include / require之前可能发生);动态链接(如果有的话)

在执行期间发生(即,在源代码被解释为
之后,因此,在任何include / require之后)。


知道什么样的链接在包含库时的
效果非常重要,



仅当库是真正的库(即编译成

本机可执行代码的库)时。使用PHP库,使用include / require

并不意味着任何链接...


干杯,

NC


Martin Larsen写道:


当PHP程序使用include或者链接到库时require(或他们的

_once变种),然后动态或静态链接库?



动态。


-

Toby A Inkster BSc(荣誉)ARCS

[极客HTML / SQL / Perl / PHP / Python / Apache / Linux]

[操作系统:Linux 2.6.12-12mdksmp,上传29天,14:30。]


使用PEAR的XML_HTTPSax3解析HTML表
http://tobyinkster.co.uk/blog/2007/0...table-parsing/


谢谢NC,

我知道PHP与Windows可执行文件非常不同,

并且可能链接不是发生什么事情的正确的术语。


无论如何,在您看来,机制是重新构成动态还是静态

链接最多?


顺便说一句,如果我得到一个官方的话。声明,您是否偶然知道谁应该联系?b / b
马丁


Hi,

When a PHP program links to a library using include or require (or their
_once variations), is the library then linked dynamically or statically?

While it might seem irrelevant from a technical point of view, the
linking method is important when it comes to licencing issues as some
licences, like GPL, differ between those kinds of linking when it comes
to viewing the library as a derivative work of the main program.

Therefore it is quite important to know what kind of linking is in
effect when including libraries, and I hope someone in this group can
shed some light on this matter.

Thank you very much in advance,
Martin

解决方案

On Jul 19, 4:14 pm, Martin Larsen <martin+spamfree+lar...@bigfoot.com>
wrote:

>
When a PHP program links to a library using include
or require (or their _once variations), is the library
then linked dynamically or statically?

Neither. include/require is not a linking mechanism; it is a way to
assemble a complete block of source code prior to its interpretation.
Any static linking takes place at the server process start-up (i.e.,
before any include/require can happen); dynamic linking (if any)
occurs during execution (i.e., after the source code has been
interpreted, and, therefore, after any include/require).

it is quite important to know what kind of linking is in
effect when including libraries,

Only if the libraries are true libraries (i.e., those compiled into
native executable code). With PHP "libraries", using include/require
does not imply any linking...

Cheers,
NC


Martin Larsen wrote:

When a PHP program links to a library using include or require (or their
_once variations), is the library then linked dynamically or statically?

Dynamically.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 29 days, 14:30.]

Parsing an HTML Table with PEAR''s XML_HTTPSax3
http://tobyinkster.co.uk/blog/2007/0...table-parsing/


Thanks NC,

I understand that PHP is very different than say a Windows executable,
and perhaps linking is not the right term for what happens.

Anyway, in your opinion, does the mechanism rememble dynamic or static
linking most?

Btw, if I were to get an "official" statement, do you by chance know who
I should contact?

Martin


这篇关于PHP库是动态链接还是静态链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆