Re: How to know which PHP is used by Apache

Re: How to know which PHP is used by Apache

am 01.04.2010 15:29:52 von Ashley Sheridan

--=-2s1uNAs76xUfIVJ130Uy
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Thu, 2010-04-01 at 19:00 +0530, Devendra Jadhav wrote:

> Hi All,
>
> In the situation if there are two PHP's installed on the Linux box.
> How to know which PHP is used by Apache?
>
> Another question is do Apache need PHP's binary to execute PHP Scripts? If
> yes what is the role of libphp5.so in Apache?
>
> Note: PHP is configured as module under Apache.
>
> Appreciate your thoughts.
>


The libphp5.so is the Apache module that links PHP into Apache. You need
this and PHP installed if you want to use PHP in Apache.

The module itself indicates what version of PHP Apache will be using.

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



--=-2s1uNAs76xUfIVJ130Uy--

How to know which PHP is used by Apache

am 01.04.2010 15:30:57 von Devendra Jadhav

--0016e68ee02e752b6c04832cdf94
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi All,

In the situation if there are two PHP's installed on the Linux box.
How to know which PHP is used by Apache?

Another question is do Apache need PHP's binary to execute PHP Scripts? If
yes what is the role of libphp5.so in Apache?

Note: PHP is configured as module under Apache.

Appreciate your thoughts.

--=20
Devendra Jadhav
देवेंदॠà¤° =
जाधव

--0016e68ee02e752b6c04832cdf94--

Re: How to know which PHP is used by Apache

am 01.04.2010 15:37:44 von Devendra Jadhav

--00c09f8a4e33b2e99504832cf757
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Thu, Apr 1, 2010 at 6:59 PM, Ashley Sheridan w=
rote:

> On Thu, 2010-04-01 at 19:00 +0530, Devendra Jadhav wrote:
>
> Hi All,
>
> In the situation if there are two PHP's installed on the Linux box.
> How to know which PHP is used by Apache?
>
> Another question is do Apache need PHP's binary to execute PHP Scripts? I=
f
> yes what is the role of libphp5.so in Apache?
>
> Note: PHP is configured as module under Apache.
>
> Appreciate your thoughts.
>
>
>
> The libphp5.so is the Apache module that links PHP into Apache. You need
> this and PHP installed if you want to use PHP in Apache.
>
> The module itself indicates what version of PHP Apache will be using.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
With my case both installation of PHP has version 5.x, so how to know which
PHP is being used?

--=20
Devendra Jadhav
देवेंदॠà¤° =
जाधव

--00c09f8a4e33b2e99504832cf757--

Re: How to know which PHP is used by Apache

am 01.04.2010 15:40:44 von Richard

Hi,

> In the situation if there are two PHP's installed on the Linux box.
> How to know which PHP is used by Apache?
>
> Another question is do Apache need PHP's binary to execute PHP Scripts? If
> yes what is the role of libphp5.so in Apache?
>
> Note: PHP is configured as module under Apache.

This may help:

phpinfo();
?>

--
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 20th March)
Lots of PHP and Javascript code - http://www.phpguru.org

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to know which PHP is used by Apache

am 01.04.2010 15:42:35 von Nilesh Govindrajan

On 04/01/10 19:00, Devendra Jadhav wrote:
> Hi All,
>
> In the situation if there are two PHP's installed on the Linux box.
> How to know which PHP is used by Apache?
>
> Another question is do Apache need PHP's binary to execute PHP Scripts? If
> yes what is the role of libphp5.so in Apache?
>
> Note: PHP is configured as module under Apache.
>
> Appreciate your thoughts.
>

First of all, libphp5.so is created during the php compilation process.
So it will use version of php with which it was compiled.

Also, I don't think php's binary is needed for execution of php scripts
is needed.

--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com
मेरा भारत महान !
मम भारत: महत्तम भवतु !

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to know which PHP is used by Apache

am 01.04.2010 15:43:48 von Teus Benschop

On Thu, 2010-04-01 at 19:07 +0530, Devendra Jadhav wrote:
> With my case both installation of PHP has version 5.x, so how to know whi=
ch
> PHP is being used?
>=20
Running this page through Apache could do it:

phpinfo ();
?>

Teus.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to know which PHP is used by Apache

am 01.04.2010 15:52:47 von Devendra Jadhav

--0016369c8f9b88197504832d2d2a
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Thu, Apr 1, 2010 at 7:13 PM, Teus Benschop wrote=
:

> On Thu, 2010-04-01 at 19:07 +0530, Devendra Jadhav wrote:
> > With my case both installation of PHP has version 5.x, so how to know
> which
> > PHP is being used?
> >
> Running this page through Apache could do it:
>
> > phpinfo ();
> ?>
>
> Teus.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
I am still confused. As per Nilesh php's binary is not required and as per
Ashley it is required.
Which one is correct?
And I am not able to find which php's binary is used by using phpinfo().



--=20
Devendra Jadhav
देवेंदॠà¤° =
जाधव

--0016369c8f9b88197504832d2d2a--

Re: How to know which PHP is used by Apache

am 01.04.2010 17:00:18 von Devendra Jadhav

--0016369c8f9b0339be04832e1fe8
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Thu, Apr 1, 2010 at 7:22 PM, Devendra Jadhav wrot=
e:

> On Thu, Apr 1, 2010 at 7:13 PM, Teus Benschop wro=
te:
>
>> On Thu, 2010-04-01 at 19:07 +0530, Devendra Jadhav wrote:
>> > With my case both installation of PHP has version 5.x, so how to know
>> which
>> > PHP is being used?
>> >
>> Running this page through Apache could do it:
>>
>> >> phpinfo ();
>> ?>
>>
>> Teus.
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
> I am still confused. As per Nilesh php's binary is not required and as pe=
r
> Ashley it is required.
> Which one is correct?
> And I am not able to find which php's binary is used by using phpinfo().
>
>
>
>
> --
> Devendra Jadhav
> देवेंदॠà¤° =
जाधव
>

Anyone confident about either of the two answers?


--=20
Devendra Jadhav
देवेंदॠà¤° =
जाधव

--0016369c8f9b0339be04832e1fe8--

Re: How to know which PHP is used by Apache

am 01.04.2010 17:43:45 von Nilesh Govindrajan

On 04/01/10 20:30, Devendra Jadhav wrote:
> On Thu, Apr 1, 2010 at 7:22 PM, Devendra Jadhavwrote:
>
>> On Thu, Apr 1, 2010 at 7:13 PM, Teus Benschopwrote:
>>
>>> On Thu, 2010-04-01 at 19:07 +0530, Devendra Jadhav wrote:
>>>> With my case both installation of PHP has version 5.x, so how to know
>>> which
>>>> PHP is being used?
>>>>
>>> Running this page through Apache could do it:
>>>
>>> >>> phpinfo ();
>>> ?>
>>>
>>> Teus.
>>>
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>> I am still confused. As per Nilesh php's binary is not required and as per
>> Ashley it is required.
>> Which one is correct?
>> And I am not able to find which php's binary is used by using phpinfo().
>>
>>
>>
>>
>> --
>> Devendra Jadhav
>> देवेंद्र जाधव
>>
>
> Anyone confident about either of the two answers?
>
>

Well, you can do a trial test. Compile a different version of php
without libphp5.so, and replace the php interpreter of libphp5.so with
this one.

If phpinfo() from apache shows you a different version then libphp5 uses
the binary else not.

As per common logic, libphp5 embeds the php interpreter into apache,
hence it'd not make sense to say that it needs the binary.

--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com
मेरा भारत महान !
मम भारत: महत्तम भवतु !

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to know which PHP is used by Apache

am 01.04.2010 17:46:48 von Kevin Kinsey

Devendra Jadhav wrote:
>>>
>> I am still confused. As per Nilesh php's binary is not required and as per
>> Ashley it is required.
>> Which one is correct?
>> And I am not able to find which php's binary is used by using phpinfo().
>
> Anyone confident about either of the two answers?
>
Pretty confident about all of them. Nilesh probably misunderstood,
or we are misunderstanding him. PHP has to have a binary file,
whether it's the CLI interpreter or the Apache "module".

Run a script with phpinfo() in it. Look for the line that says
"Server API". If this reads something like "Apache $N.$N Handler",
then the PHP interpreter binary is something like "libphp$n.so".
If the line reads "Command Line Interface", then you are using
something like /usr/bin/php, /usr/local/bin/php, etc. (I'm from
a BSD background, your $penguin_path may vary).

If you are talking about actually having two different versions
of PHP installed, and not sure which is actually being called,
you might find out something with the Linux equivalent of the
BSD `pkg_which`:

[31] Thu 01.Apr.2010 10:39:24
[admin@archangel][/usr/local/bin]
sudo pkg_which /usr/local/bin/php
php5-5.2.11

This command is highly dependent on your Linux distro: on
RH I think it's "rpm", "dpkg" on Debian, "urpmf" on Mandriva,
etc.

If you have two installations of the same version, $deity
help you :-)

HTH,

Kevin Kinsey

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to know which PHP is used by Apache

am 01.04.2010 18:34:39 von Nilesh Govindrajan

libphp5.so doesn't need the php binary.

I've confirmed this using a test.

My local apache is configured to use libphp5.so

I moved /usr/bin/php to /root, then started apache and ran drupal. It
worked.

This confirms that libphp5.so is independent of the php binary in
/usr/bin as I suggested earlier.

--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com
मेरा भारत महान !
मम भारत: महत्तम भवतु !

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to know which PHP is used by Apache

am 01.04.2010 19:33:40 von Kevin Kinsey

Nilesh Govindarajan wrote:
> libphp5.so doesn't need the php binary.

You're right, and of course not. libphp5.so
*is* a "PHP binary" :-)

> I've confirmed this using a test.
>
> My local apache is configured to use libphp5.so
>
> I moved /usr/bin/php to /root, then started apache and ran drupal. It
> worked.
>
> This confirms that libphp5.so is independent of the php binary in
> /usr/bin as I suggested earlier.

No one was questioning that .. or at least, I wasn't.
One is an executable binary file ... a program.

The other is also a binary file, but it's a _library_.

What I said was you need one or the other. "A" binary
file, either the Apache SO or the "binary" interpreter...

It's possible to configure Apache to use a PHP executable
(CGI), and the CGI and CLI executables are similar, if
not identical.

I dunno if anyone actually does that anymore, though. :-)

Ashley said "The libphp5.so is the Apache module that
links PHP into Apache. You need this and PHP installed
if you want to use PHP in Apache." Devendra apparently
misinterpreted this to mean that you need both the SO and
the binary interpreter, but you don't. You DO need the
rest of the PHP extensions, libraries, config files, etc.
... a "PHP installation", whether or not your have the
CLI binary is not that important, although I always do
since I like to run system scripts in PHP via cron, etc.

Kevin Kinsey

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to know which PHP is used by Apache

am 01.04.2010 20:00:01 von Nilesh Govindrajan

On 04/01/10 23:03, Kevin Kinsey wrote:
> Nilesh Govindarajan wrote:
>> libphp5.so doesn't need the php binary.
>
> You're right, and of course not. libphp5.so
> *is* a "PHP binary" :-)
>
>> I've confirmed this using a test.
>>
>> My local apache is configured to use libphp5.so
>>
>> I moved /usr/bin/php to /root, then started apache and ran drupal. It
>> worked.
>>
>> This confirms that libphp5.so is independent of the php binary in
>> /usr/bin as I suggested earlier.
>
> No one was questioning that .. or at least, I wasn't.
> One is an executable binary file ... a program.
>
> The other is also a binary file, but it's a _library_.
>
> What I said was you need one or the other. "A" binary
> file, either the Apache SO or the "binary" interpreter...
>
> It's possible to configure Apache to use a PHP executable
> (CGI), and the CGI and CLI executables are similar, if
> not identical.
>
> I dunno if anyone actually does that anymore, though. :-)
>
> Ashley said "The libphp5.so is the Apache module that
> links PHP into Apache. You need this and PHP installed
> if you want to use PHP in Apache." Devendra apparently
> misinterpreted this to mean that you need both the SO and
> the binary interpreter, but you don't. You DO need the
> rest of the PHP extensions, libraries, config files, etc.
> ... a "PHP installation", whether or not your have the
> CLI binary is not that important, although I always do
> since I like to run system scripts in PHP via cron, etc.
>
> Kevin Kinsey

LOL. Super misunderstanding. Anyway, I did that test to help Devendra.

--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com
मेरा भारत महान !
मम भारत: महत्तम भवतु !

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to know which PHP is used by Apache

am 02.04.2010 08:56:18 von Devendra Jadhav

--00c09f8e5979ee648204833b792d
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Thu, Apr 1, 2010 at 11:30 PM, Nilesh Govindarajan wrot=
e:

> On 04/01/10 23:03, Kevin Kinsey wrote:
>
>> Nilesh Govindarajan wrote:
>>
>>> libphp5.so doesn't need the php binary.
>>>
>>
>> You're right, and of course not. libphp5.so
>> *is* a "PHP binary" :-)
>>
>> I've confirmed this using a test.
>>>
>>> My local apache is configured to use libphp5.so
>>>
>>> I moved /usr/bin/php to /root, then started apache and ran drupal. It
>>> worked.
>>>
>>> This confirms that libphp5.so is independent of the php binary in
>>> /usr/bin as I suggested earlier.
>>>
>>
>> No one was questioning that .. or at least, I wasn't.
>> One is an executable binary file ... a program.
>>
>> The other is also a binary file, but it's a _library_.
>>
>> What I said was you need one or the other. "A" binary
>> file, either the Apache SO or the "binary" interpreter...
>>
>> It's possible to configure Apache to use a PHP executable
>> (CGI), and the CGI and CLI executables are similar, if
>> not identical.
>>
>> I dunno if anyone actually does that anymore, though. :-)
>>
>> Ashley said "The libphp5.so is the Apache module that
>> links PHP into Apache. You need this and PHP installed
>> if you want to use PHP in Apache." Devendra apparently
>> misinterpreted this to mean that you need both the SO and
>> the binary interpreter, but you don't. You DO need the
>> rest of the PHP extensions, libraries, config files, etc.
>> ... a "PHP installation", whether or not your have the
>> CLI binary is not that important, although I always do
>> since I like to run system scripts in PHP via cron, etc.
>>
>> Kevin Kinsey
>>
>
> LOL. Super misunderstanding. Anyway, I did that test to help Devendra.
>
>
> --
> Nilesh Govindarajan
> Site & Server Administrator
> www.itech7.com
> मेरा भारत=
महान !
> मम भारत: मà=A4=
¹à¤¤à¥à¤¤à¤=AE भवतà=A5=
=81 !
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
I think I am clear with everything now.. Good.. Thank you very much Nilesh,
kevin, Ashley & all.


--=20
Devendra Jadhav
देवेंदॠà¤° =
जाधव

--00c09f8e5979ee648204833b792d--