473,545 Members | 1,638 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 3555
>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***********@b urditt.org (Gordon Burditt) wrote in message news:<ce******* *@library1.airn ews.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***********@b urditt.org (Gordon Burditt) wrote in message news:<ce******* *@library1.airn ews.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******@geoci ties.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
5686
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 me the build date as well. The weird thing is, my cron script (using phpinfo) gives me a different build date than phpinfo() in an "admin tool"...
23
5649
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 reduced my form request to a simple text string entry, instead of my desired optional parameters. As i have been stuck with a single unfathomable...
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 put the phpinfo.php file is in /var/www/html and I try to access it through the browser, I get the content of the file and not the execution of the...
4
4303
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
2785
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 http://192.168.1.106/~mlh/credifree/index.php the AMP app still thinks the data resides somewhere else. It runs fine - as long as I leave my LAN's...
3
2737
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 phpinfo, the "mysql api client is ver. 4.0.25" - I have no idea how this relates, if at all, to the mysql engine's version. background:
2
2578
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 users, I use suexec and a wrapper script for php files. to make it a bit clearer, i'll post the different snippets: httpd.conf:
1
4794
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 did have Apache2/ PHP5 working... I confirmed this via phpinfo output... But now that I removed my original directory containing Apache/PHP, and...
0
1200
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 Configure Command './configure' '--enable-pic' '--with- libdir=lib64' '--prefix=/usr' '--with-xml' '--enable-bcmath' '--enable-
0
7459
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...
0
7393
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...
0
7803
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...
1
7411
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7749
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
4942
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...
0
3439
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1871
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
1
1012
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.