From: lainme on
Hi, I recently compiled a portable portable web server for linux, using
lighttpd and php.

But it seems that php can only run on machine with the same glibc version
compiled it. How can I solve the problem?
From: Ashley Sheridan on
On Sat, 2010-08-07 at 10:22 +0800, lainme wrote:

> Hi, I recently compiled a portable portable web server for linux, using
> lighttpd and php.
>
> But it seems that php can only run on machine with the same glibc version
> compiled it. How can I solve the problem?


It's not a PHP problem. If you compile something, it's compiled to the
same architecture that you specify, which by default is yours. have you
tried compiling your executable with the same setup as you're currently
using?

Thanks,
Ash
http://www.ashleysheridan.co.uk


From: lainme on
thanks for the reply. I know it is not a PHP problem. And I want to know
whether it is possible to make it architecture independent.

On Sat, Aug 7, 2010 at 10:38 AM, Ashley Sheridan
<ash(a)ashleysheridan.co.uk>wrote:

> On Sat, 2010-08-07 at 10:22 +0800, lainme wrote:
>
> Hi, I recently compiled a portable portable web server for linux, using
> lighttpd and php.
>
> But it seems that php can only run on machine with the same glibc version
> compiled it. How can I solve the problem?
>
>
> It's not a PHP problem. If you compile something, it's compiled to the same
> architecture that you specify, which by default is yours. have you tried
> compiling your executable with the same setup as you're currently using?
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
From: Ashley Sheridan on
On Sat, 2010-08-07 at 10:43 +0800, lainme wrote:

> thanks for the reply. I know it is not a PHP problem. And I want to know
> whether it is possible to make it architecture independent.
>
> On Sat, Aug 7, 2010 at 10:38 AM, Ashley Sheridan
> <ash(a)ashleysheridan.co.uk>wrote:
>
> > On Sat, 2010-08-07 at 10:22 +0800, lainme wrote:
> >
> > Hi, I recently compiled a portable portable web server for linux, using
> > lighttpd and php.
> >
> > But it seems that php can only run on machine with the same glibc version
> > compiled it. How can I solve the problem?
> >
> >
> > It's not a PHP problem. If you compile something, it's compiled to the same
> > architecture that you specify, which by default is yours. have you tried
> > compiling your executable with the same setup as you're currently using?
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> >


You can't compile to be architecture independent. The best you can do is
convert a language to a byte-code, like java.

Thanks,
Ash
http://www.ashleysheridan.co.uk


From: "Bob McConnell" on
From: Ashley Sheridan

> On Sat, 2010-08-07 at 10:43 +0800, lainme wrote:
>
>> thanks for the reply. I know it is not a PHP problem. And I want to
know
>> whether it is possible to make it architecture independent.
>>
>> On Sat, Aug 7, 2010 at 10:38 AM, Ashley Sheridan
>> <ash(a)ashleysheridan.co.uk>wrote:
>>
>> > On Sat, 2010-08-07 at 10:22 +0800, lainme wrote:
>> >
>> > Hi, I recently compiled a portable portable web server for linux,
using
>> > lighttpd and php.
>> >
>> > But it seems that php can only run on machine with the same glibc
version
>> > compiled it. How can I solve the problem?
>> >
>> >
>> > It's not a PHP problem. If you compile something, it's compiled to
the same
>> > architecture that you specify, which by default is yours. have you
tried
>> > compiling your executable with the same setup as you're currently
using?
>
> You can't compile to be architecture independent. The best you can do
is
> convert a language to a byte-code, like java.

To expand on this, just a little, once you compile an application, you
have locked it in to a specific CPU, OS and versions of the requisite
dynamic libraries. The compiler options and your tool set define which
range of each of those it will actually run on. The only way to make
something completely independent of the architecture is to distribute it
in source code form. In this case, you are probably better off defining
minimum versions for the web server and PHP module that is required and
allow the user to install those on his own. Most distributions already
have those components packaged in an easy to manage kit.

Bob McConnell