473,785 Members | 2,575 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Are PHP libraries linked dynamically or statically?

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
Jul 19 '07
36 3201
Martin Larsen kirjoitti:
Hi Henk,
>This may be true from a strict technical definition, but juridical
reasoning may not be that strict.

Thank you for making clear what I was trying to say. It is in fact a
juridical matter.

If we agree that the term linking might not be entirely irrelevant,
which kind of linking would you say is in effect when a PHP program
links to a script: dynamically or statically.

The reason why this is important is that dynamically linking is often
seen as a licence boundary
(http://en.wikipedia.org/wiki/Library...ynamic_linking)
Looking at this definition:

"Dynamic linking means that the subroutines of a library are loaded into
an application program at runtime, rather than being linked in at
compile time, and remain as separate files on disk."

Based on that I'd say php "linking" resembles more dynamic linking than
static linking, since there is no separate "compile time" per se, a
script is each time recompiled at runtime. Plus the included scripts are
separate files on disk, they are not "built" into one executable.

And the reason I say it _resembles more_ is the basic problem that
neither of these terms can really be applied to php scripts, what you
need is a new term: call it including.

--
Ra*********@gma il.com

"Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze
Jul 21 '07 #11
On Fri, 20 Jul 2007 01:14:02 +0200, Martin Larsen
<ma************ ********@bigfoo t.comwrote:
>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.
Have you seen the following - not sure if it helps, or muddies the waters
further:

http://www.gnu.org/licenses/gpl-faq....terpreterIsGPL

In particular the final two paragraphs:

"Another similar and very common case is to provide libraries with the
interpreter which are themselves interpreted. For instance, Perl comes with
many Perl modules, and a Java implementation comes with many Java classes.
These libraries and the programs that call them are always dynamically linked
together.

A consequence is that if you choose to use GPL'd Perl modules or Java classes
in your program, you must release the program in a GPL-compatible way,
regardless of the license used in the Perl or Java interpreter that the
combined Perl or Java program will run on. "
The implication appears to be that loading Perl modules is treated as "dynamic
linking" for the purposes of the license (pure technical definitions aside).
Perl modules are often "pure-Perl" and so very closely match "require/include"
for PHP libraries.

--
Andy Hassall :: an**@andyh.co.u k :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jul 21 '07 #12
Jerry Stuckle wrote:
Ah, but OpenOffice is not MS Word. And just because OpenOffice
implements something one way doesn't mean Word does.
No, no -- the quotes from the OpenOffice.org developers were regarding
the MS Word ".doc" file format -- which they had to reverse engineer --
they were not on the subject of OpenOffice.org' s behaviour.

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

Parsing an HTML Table with PEAR's XML_HTTPSax3
http://tobyinkster.co.uk/blog/2007/0...table-parsing/
Jul 23 '07 #13
Jerry Stuckle wrote:
Martin Larsen wrote:
>Is there a way to contact the PHP Group directly?
Why?

If you understood the technology, the answer would be clear. Rather, I
suggest you visit your local library or bookstore and find out how
interpreters work.
Ok, I will tell you why. I had hoped it was not necessary, but here it is...

I do in fact know how interpreters work. I have actually written one
myself. Being a professional windows programmer for ages, I have also
learned the hard way the distinct difference between dynamic and static
libraries: missing DLL files on the end user's computer preventing the
programs from even starting.

I deliberately asked the question in a simple minded manner as I did not
want my own view of the matter to bias the replies. The thing is that
the core team behind a major CMS (Joomla) has recently changed their
mind about non-GPL plugins (or scripts, if you like). Until then they
accepted and welcomed proprietary plugins, but now they say that since
the CMS is GPL, the plugins must also be GPL to comply.

Now, I don't wish this thread to be for or against GPL. I only want to
discuss the reasoning behind their claims. The point is that they argue
that most extensions are *derivative work* of the CMS (even though they
normally don't include a single line of code from it) because they are
statically linked to the CMS. If they were dynamically linked, the
matter would be different.

Yep, that is what they say. While you and I can agree that it doesn't
make much sense to talk about linking for interpreters, they
nevertheless use it in their argumentation. And that is why I asked the
question: Are PHP libraries linked dynamically or statically?

In my opinion they make two mistakes: the first is to talk about linking
at all, the second is to claim that the plugins are statically linked.

As I see it, even when we are not really talking linking, the
characteristics of the processes involved in the INCLUDE more closely
resembles dynamic linking than static linking. Which means that their
argumentation is wrong no matter what.

As it happens, we (third-party developers for Joomla) have tried hard to
make them see that their arguments are wrong. But they keep claiming
that the scripts are statically linked and thus derivative works of the CMS.

And now to my question: Is there a way to contact the PHP Group directly?

I have an idea that if we could get a "official" statement of the
linking or non-linking involved, they might be more prone to listening.

And again, I certainly don't want the PHP Group or any other to comment
on the good or bad of plugins being GPL because that is entirely
irrelevant. I just sincerely believe that their technical resoning is
entirely wrong.

Thanks,
Martin
Jul 23 '07 #14
Martin Larsen wrote:
Jerry Stuckle wrote:
>Martin Larsen wrote:
>>Is there a way to contact the PHP Group directly?
>Why?

If you understood the technology, the answer would be clear. Rather,
I suggest you visit your local library or bookstore and find out how
interpreters work.

Ok, I will tell you why. I had hoped it was not necessary, but here it
is...

I do in fact know how interpreters work. I have actually written one
myself. Being a professional windows programmer for ages, I have also
learned the hard way the distinct difference between dynamic and static
libraries: missing DLL files on the end user's computer preventing the
programs from even starting.
Wow. A WINDOWS programmer. So you've been programming for what - 15
years, maybe? And you've programmed for ONE OS? Wow.

And you wrote an interpreter? Golly, Gee, Batman. I guess that makes
you an expert on everything! ROFLMAO!

I deliberately asked the question in a simple minded manner as I did not
want my own view of the matter to bias the replies. The thing is that
the core team behind a major CMS (Joomla) has recently changed their
mind about non-GPL plugins (or scripts, if you like). Until then they
accepted and welcomed proprietary plugins, but now they say that since
the CMS is GPL, the plugins must also be GPL to comply.
You got answers to the question you asked.
Now, I don't wish this thread to be for or against GPL. I only want to
discuss the reasoning behind their claims. The point is that they argue
that most extensions are *derivative work* of the CMS (even though they
normally don't include a single line of code from it) because they are
statically linked to the CMS. If they were dynamically linked, the
matter would be different.
This has nothing to do with PHP programming. I suggest you take it over
to the Joomla newsgroup.
Yep, that is what they say. While you and I can agree that it doesn't
make much sense to talk about linking for interpreters, they
nevertheless use it in their argumentation. And that is why I asked the
question: Are PHP libraries linked dynamically or statically?
That's their problem. If you understood as well as you say, you would
have the answer to your question.
In my opinion they make two mistakes: the first is to talk about linking
at all, the second is to claim that the plugins are statically linked.
That could be. But it's not a topic for this newsgroup.
As I see it, even when we are not really talking linking, the
characteristics of the processes involved in the INCLUDE more closely
resembles dynamic linking than static linking. Which means that their
argumentation is wrong no matter what.
It resembles INCLUDES. It has nothing to do with linking.
As it happens, we (third-party developers for Joomla) have tried hard to
make them see that their arguments are wrong. But they keep claiming
that the scripts are statically linked and thus derivative works of the
CMS.
Then build your own CMS.
And now to my question: Is there a way to contact the PHP Group directly?
Why? They can't change Joomla's mind, either. Nor are they going to
change Joomla's terminology.
I have an idea that if we could get a "official" statement of the
linking or non-linking involved, they might be more prone to listening.
This has nothing to do with their use of terminology. It is a licensing
issue, and they have a write to require licenses for their CMS to follow
their rules.
And again, I certainly don't want the PHP Group or any other to comment
on the good or bad of plugins being GPL because that is entirely
irrelevant. I just sincerely believe that their technical resoning is
entirely wrong.
You're discussing legal issues, and should be talking to an attorney.
But historically Joomla is on solid legal ground. The terminology they
use is not important. The fact your tools ARE derivative works is.
Thanks,
Martin
Please don't bring your argument over here. We're not interested.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jul 23 '07 #15
Jerry Stuckle wrote:
Wow. A WINDOWS programmer. So you've been programming for what - 15
years, maybe? And you've programmed for ONE OS? Wow.

And you wrote an interpreter? Golly, Gee, Batman. I guess that makes
you an expert on everything! ROFLMAO!
Excuse me, but why are you flaming like this? Did I ever call myself an
expert? Did I ever use bad language or something? Did I ever call you
stupid things? Was I ever impolite?

I really can't understand why so many people in these newsgroups are so
hostile to each other. I think you should apologize, but I don't expect
that you will.
The terminology they
use is not important. The fact your tools ARE derivative works is.
Aha. A fact?

Then please tell me why it is a fact.

Sincerely,
Martin
Jul 23 '07 #16
On Mon, 23 Jul 2007 11:40:02 +0200, Martin Larsen
<ma************ ********@bigfoo t.comwrote:
>And now to my question: Is there a way to contact the PHP Group directly?
According to license.txt in the PHP distribution:

"The PHP Group can be contacted via Email at gr***@php.net."

I wonder if you might have more luck with Zend, the company behind the core of
PHP (the Zend engine). Since this includes the compiler + bytecode interpreter
anyway, they should be well-placed to answer.

http://www.zend.com/company/contact_us

Have you contacted the FSF as well? Since they produced the GPL license, they
may be able to clarify its terms.
>I have an idea that if we could get a "official" statement of the
linking or non-linking involved, they might be more prone to listening.

And again, I certainly don't want the PHP Group or any other to comment
on the good or bad of plugins being GPL because that is entirely
irrelevant. I just sincerely believe that their technical resoning is
entirely wrong.
If it were "libraries" then I'd interpret it as "dynamic linking" in the
context of the GPL. This seems to be backed up with the already-quoted:

http://www.gnu.org/licenses/gpl-faq....terpreterIsGPL
"Another similar and very common case is to provide libraries with the
interpreter which are themselves interpreted. For instance, Perl comes with
many Perl modules, and a Java implementation comes with many Java classes.
These libraries and the programs that call them are always dynamically linked
together.

A consequence is that if you choose to use GPL'd Perl modules or Java classes
in your program, you must release the program in a GPL-compatible way,
regardless of the license used in the Perl or Java interpreter that the
combined Perl or Java program will run on."
Introducing the term "plugin" seems to point to the following, though:

http://www.gnu.org/licenses/gpl-faq.html#GPLAndPlugins
"If the program dynamically links plug-ins, and they make function calls to
each other and share data structures, we believe they form a single program,
which must be treated as an extension of both the main program and the
plug-ins. This means the plug-ins must be released under the GPL or a
GPL-compatible free software license, and that the terms of the GPL must be
followed when those plug-ins are distributed."
There does seem to be a valid distinction between a library, which implements
a particular function and makes that available to /any/ other application that
loads it, versus a plug-in that explicitly extends one application - which
makes the argument of "derivative work" plausible.

It's not entirely clear, so it's an interesting question.

--
Andy Hassall :: an**@andyh.co.u k :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jul 23 '07 #17
Andy Hassall wrote:
According to license.txt in the PHP distribution:

"The PHP Group can be contacted via Email at gr***@php.net."
Thanks!
I wonder if you might have more luck with Zend, the company behind the core of
PHP (the Zend engine). Since this includes the compiler + bytecode interpreter
anyway, they should be well-placed to answer.
I think you are right, Zend would be a good source of info.
It's not entirely clear, so it's an interesting question.
Indeed it is.

Thanks for your comments. After getting flamed by Jerry, it was a
pleasence to read a decent post like yours :-)

Martin
Jul 23 '07 #18
Martin Larsen wrote:
Jerry Stuckle wrote:
>Wow. A WINDOWS programmer. So you've been programming for what - 15
years, maybe? And you've programmed for ONE OS? Wow.

And you wrote an interpreter? Golly, Gee, Batman. I guess that makes
you an expert on everything! ROFLMAO!

Excuse me, but why are you flaming like this? Did I ever call myself an
expert? Did I ever use bad language or something? Did I ever call you
stupid things? Was I ever impolite?
You came across as arrogant and self serving. If you weren't trying to
prove yourself an expert, why come up with all of that junk?
I really can't understand why so many people in these newsgroups are so
hostile to each other. I think you should apologize, but I don't expect
that you will.
Probably because you came across as self-serving and arrogant. And no,
I won't apologize for your arrogance.
>The terminology they use is not important. The fact your tools ARE
derivative works is.

Aha. A fact?

Then please tell me why it is a fact.
You want legal advice, talk to an attorney. Any one who is familiar
with computer law will tell you the same thing.

But I know you won't.
Sincerely,
Martin

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jul 23 '07 #19
Jerry Stuckle wrote:
Martin Larsen wrote:
>Excuse me, but why are you flaming like this? Did I ever call myself
an expert? Did I ever use bad language or something? Did I ever call
you stupid things? Was I ever impolite?

You came across as arrogant and self serving. If you weren't trying to
prove yourself an expert, why come up with all of that junk?
Sheesh, Jerry! You do this a lot. Your blood sugar gets out of whack
or something and you go BALLISTIC on some poor fool.

Not all of us are here to prove that we're experts.
Some of just like having conversations about things we're interested in.
Jul 23 '07 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1844
by: Kwan | last post by:
Hi All, In a Unix system (I am using Solaris, but not limited to it), who will dynamically linked libraries been linked to a multithreaded process? Will it have a different instance for every single thread, or just one copy and shared amough all threads? I have some static member variables in the class suggested that every single threads is having their own instance. Is that true?
3
10320
by: daniel_shaw01 | last post by:
I want to link the C++ standard libraries statically for my application because I don't space for the .so files on my target platform. After quite a bit of searching, I found very little information that was helpful. The best information I found was at this link http://fresco.org/~njs/c++-without-stdc++ I followed the approach here and used -nostdlib to disable the default linking. Instead I use the options:
4
2270
by: RobG | last post by:
I have a function whose parameter is a reference the element that called it: function someFunction(el) { ... } The function is assigned to the onclick event of some elements in the HTML source:
13
1561
by: tsoukase | last post by:
Hello, two questions: 1) Why is a library a collection of compiled source-files while each header-file is a single source? Would it be more efficient if they were both either compiled or not? Could a "header-library" exist? 2) Why do libraries have extensions .a and .so and modules .o, which should be reserved for cc -c output? Would it be better: module.m, lib.sl, lib.dl or something
7
5213
by: Steve | last post by:
Hi, We have an application framework library that gets statically linked to any applications we produce. (Windows apps, but I don't think that matters here). The framework is based heavily on the STL and the API uses many STL constructs. Because of the static linking, and the fact that both app and framework are built by the same compiler, we don't have any problems.
8
2080
by: bonk | last post by:
Is it generally OK for an EXE that has MFC linked statically to load an use another DLL wich has MFC linked as shared DLL ? To be more specific: I have an EXE that links a lib. Let's call it mylib.lib. That Lib as well as the EXE have MFC linked statically. Then in a completely different project I have a regular DLL, wich is compiled with the /CLR switch and therefore needs the special CRT libs as
4
1635
by: utab | last post by:
Dear all, I want to be able to use C++ libraries(maybe this is too abstract). Is there a source or tutorial giving the general details on the use of C++ libraries. (Sth like, to use all C++ libraries you have to complete these common steps and make the following configurations according to your OS.) I am looking for a step-by-step introduction to library usage. I also checked out the boost web page which seemed to me a bit confusing.
5
1962
by: Chris | last post by:
I have a page with mixture of static and dynamically added controls is there any way of controlling the order which they are added to the page. My submit button (statically added) appears before some textboxes (dynamically added). I know I could move it around with CSS but I want to move towards an accessible site that will display forms in the right order without CSS. Regards, Chris.
20
2144
by: pratap | last post by:
Could someone clarify how could one reduce the size of an executable code during compile time. Could one use specific compile time flag with makefile or is it advisable to go for dynamic linking. The idea here is that smaller the code size the faster is the code. Is Dynamically linked executable really faster than a single executable file which is not linked dynamically.? Is there any performance measuring metrics on gcc version 3.2.2
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10148
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3646
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.