473,811 Members | 2,756 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 3564
>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
5700
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" section of my website. The cron script is sitting in the root of my home directory (non web...
23
5691
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 glitch for over a year. Basically, if i enter queries such as ; "select * from table" "select * from...
7
9594
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 file. Instead of display the info of PHP, I got the text of the file as:
4
4317
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
2819
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 external internet connection up. But if I unplug my LAN from the world, my app locks up. Before I...
3
2757
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
2587
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
4821
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 recompiled from scratch, I get everything to startup and static html is displayd, but phpinfo produces...
0
1208
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
9727
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10647
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10386
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10133
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9204
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6889
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5554
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3017
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.