473,508 Members | 3,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

does the phpinfo() command ever lie?

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
4 3550
>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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5684
by: Shawn Wilson | last post by:
Hi, My host keeps messing things up and not telling me. I am trying to write a cron job that will test to make sure the "unusual" functions I use work and, if not, email me. I want it to send...
23
5641
by: ian justice | last post by:
Before i post actual code, as i need a speedyish reply. Can i first ask if anyone knows off the top of their head, if there is a likely obvious cause to the following problem. For the moment i've...
7
9583
by: Phong Ho | last post by:
I have this problem with PHP that someone might be able to help. With CLI, I am able to execute my .php files. For example, if I type "php phpinfo.php" , this works fine on my system. If I...
4
4300
by: lawrence | last post by:
I want to edit the php.ini file. How do I find it? I tried phpinfo() and saw a bunch of path info, but none to php.ini.
4
2782
by: MLH | last post by:
A programmer developed an AMP (Apache/MySQL/PHP) application for me. When he was done, he sent me the PHP files and the MySQL dump file. Now, when I connect to the application on my LAN using...
3
2735
by: nsh | last post by:
mailing.database.mysql, comp.lang.php subject: does "LOAD DATA" EVER work?!? I've tried EVERYTHING! version info: my isp is running my web page on a linux box with php ver. 4.4.1 according to...
2
2575
by: Stefan Huber | last post by:
Hi I've got a really strange problem, and can't find out why it's not working as intended. in order to use php4 and 5 together on a webserver and the requirement for running as different...
1
4792
by: Randell D. | last post by:
Folks, I consider myself well versed with Apache 1.3 and PHP4 - I found drupal and wanted to try it out - I had problems getting it working with Apache2/PHP5/MySQL5 so I downgraded... Note: I...
0
1196
by: Jack Arnst | last post by:
installed and enabled. When I run curl_exec, result is always false. Is it because curl is not configured for the php in command? Thanks for any help. phpinfo() says Configure command has ...
0
7229
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,...
0
7129
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...
0
7333
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,...
1
7061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5637
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,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1566
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 ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
428
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...

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.