By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,906 Members | 1,771 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,906 IT Pros & Developers. It's quick & easy.

does the phpinfo() command ever lie?

P: n/a
I wanted to use the AddType directive in an .htaccess file. So I used
phpinfo() to get the path info for PHP. I found this line:

PATH /bin:/usr/bin
So I tried this, but it did not work:

AddType application/x-php .htm Action application/x-php
/bin:/usr/bin/php
AddType application/x-php .html Action application/x-php
/bin:/usr/bin/php

I also tried this:

AddType application/x-php .htm Action application/x-php /usr/bin/php
AddType application/x-php .html Action application/x-php /usr/bin/php

I also tried this:

AddType application/x-php .htm Action application/x-php /bin:/usr/bin/
AddType application/x-php .html Action application/x-php
/bin:/usr/bin/

I tried a few other variations as well. Nothing.

Then I went looking for a file called "php".

I looked in /bin/ but it wasn't there.

I looked in /usr/bin/, but it wasn't there.

Does it go by another name? Why isn't it where PATH said it would be?
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
>I wanted to use the AddType directive in an .htaccess file. So I used
phpinfo() to get the path info for PHP.
If you are using PHP as an Apache module, there may not BE
any executable named php, nor is one necessary.
I found this line:

PATH /bin:/usr/bin
This is a list of directory names separated by colons. It is NOT
a single directory name. It is set from the environment of whatever
started Apache. PHP doesn't set it, it just reports it.

So I tried this, but it did not work:

AddType application/x-php .htm Action application/x-php
/bin:/usr/bin/php
AddType application/x-php .html Action application/x-php
/bin:/usr/bin/php
With PHP as an Apache module, leave out the Action
stuff, it's not necessary. In my setup, the MIME type
for the module is application/x-httpd-php.
Does it go by another name? Why isn't it where PATH said it would be?


PATH is the system startup routines telling Apache where to find
executables. Not modules. And if you really intend to use PHP as
a CGI, PATH doesn't indicate where you installed it or if you forgot
to build it (I don't think the default configuration builds both the
module AND the CGI).

Gordon L. Burditt
Jul 17 '05 #2

P: n/a
go***********@burditt.org (Gordon Burditt) wrote in message news:<ce********@library1.airnews.net>...
I wanted to use the AddType directive in an .htaccess file. So I used
phpinfo() to get the path info for PHP.


If you are using PHP as an Apache module, there may not BE
any executable named php, nor is one necessary.
I found this line:

PATH /bin:/usr/bin


This is a list of directory names separated by colons. It is NOT
a single directory name. It is set from the environment of whatever
started Apache. PHP doesn't set it, it just reports it.

So I tried this, but it did not work:

AddType application/x-php .htm Action application/x-php
/bin:/usr/bin/php
AddType application/x-php .html Action application/x-php
/bin:/usr/bin/php


With PHP as an Apache module, leave out the Action
stuff, it's not necessary. In my setup, the MIME type
for the module is application/x-httpd-php.
Does it go by another name? Why isn't it where PATH said it would be?


PATH is the system startup routines telling Apache where to find
executables. Not modules. And if you really intend to use PHP as
a CGI, PATH doesn't indicate where you installed it or if you forgot
to build it (I don't think the default configuration builds both the
module AND the CGI).


I don't know if this is a PHP or an Apache question, but how can I
tell if I'm dealing with an Apache module or the CGI version? I looked
in cgi-bin and there was nothing there, can I conclude from that that
I'm dealing with an Apache module version of PHP?
Jul 17 '05 #3

P: n/a
You wrote:
In my setup, the MIME type
for the module is application/x-httpd-php.

And where do I find that information for my own server? phpinfo()????

go***********@burditt.org (Gordon Burditt) wrote in message news:<ce********@library1.airnews.net>...I wanted to use the AddType directive in an .htaccess file. So I used
phpinfo() to get the path info for PHP.


If you are using PHP as an Apache module, there may not BE
any executable named php, nor is one necessary.
I found this line:

PATH /bin:/usr/bin


This is a list of directory names separated by colons. It is NOT
a single directory name. It is set from the environment of whatever
started Apache. PHP doesn't set it, it just reports it.

So I tried this, but it did not work:

AddType application/x-php .htm Action application/x-php
/bin:/usr/bin/php
AddType application/x-php .html Action application/x-php
/bin:/usr/bin/php


With PHP as an Apache module, leave out the Action
stuff, it's not necessary. In my setup, the MIME type
for the module is application/x-httpd-php.
Does it go by another name? Why isn't it where PATH said it would be?


PATH is the system startup routines telling Apache where to find
executables. Not modules. And if you really intend to use PHP as
a CGI, PATH doesn't indicate where you installed it or if you forgot
to build it (I don't think the default configuration builds both the
module AND the CGI).

Gordon L. Burditt

Jul 17 '05 #4

P: n/a
In article <da**************************@posting.google.com >,
lawrence <lk******@geocities.com> wrote:
You wrote:
In my setup, the MIME type
for the module is application/x-httpd-php.


And where do I find that information for my own server? phpinfo()????


I found it in the Apache Server Information page (this is NOT enabled
by default in sample Apache configuration files) in the section
on the mod_php4 module, line starting "Content Handlers:".
It is often called as http://localhost/server-info from the server
itself, *IF* the page is enabled.

Looking at that page requires module mod_info and that ths sample
configuration for it <Location /server-info> be uncommented.
Making the page accessible world-wide is somewhat of a security risk
as everyone can see your configuration and any security mistakes
you made with it.

another approach is to try MIME types for PHP pages until one works.
There aren't that many likely suspects.

Gordon L. Burditt
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.