does the phpinfo() command ever lie?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lawrence

    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?
  • Gordon Burditt

    #2
    Re: does the phpinfo() command ever lie?

    >I wanted to use the AddType directive in an .htaccess file. So I used[color=blue]
    >phpinfo() to get the path info for PHP.[/color]

    If you are using PHP as an Apache module, there may not BE
    any executable named php, nor is one necessary.
    [color=blue]
    >I found this line:
    >
    >PATH /bin:/usr/bin[/color]

    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.
    [color=blue]
    >
    >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[/color]

    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.
    [color=blue]
    >Does it go by another name? Why isn't it where PATH said it would be?[/color]

    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

    Comment

    • lawrence

      #3
      Re: does the phpinfo() command ever lie?

      gordonb.uzga5@b urditt.org (Gordon Burditt) wrote in message news:<cen9qj$c0 s@library1.airn ews.net>...[color=blue][color=green]
      > >I wanted to use the AddType directive in an .htaccess file. So I used
      > >phpinfo() to get the path info for PHP.[/color]
      >
      > If you are using PHP as an Apache module, there may not BE
      > any executable named php, nor is one necessary.
      >[color=green]
      > >I found this line:
      > >
      > >PATH /bin:/usr/bin[/color]
      >
      > 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.
      >[color=green]
      > >
      > >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[/color]
      >
      > 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.
      >[color=green]
      > >Does it go by another name? Why isn't it where PATH said it would be?[/color]
      >
      > 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).[/color]

      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?

      Comment

      • lawrence

        #4
        Re: does the phpinfo() command ever lie?

        You wrote:[color=blue][color=green][color=darkred]
        >>> In my setup, the MIME type
        >>> for the module is application/x-httpd-php.[/color][/color][/color]

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





        gordonb.uzga5@b urditt.org (Gordon Burditt) wrote in message news:<cen9qj$c0 s@library1.airn ews.net>...[color=blue][color=green]
        > >I wanted to use the AddType directive in an .htaccess file. So I used
        > >phpinfo() to get the path info for PHP.[/color]
        >
        > If you are using PHP as an Apache module, there may not BE
        > any executable named php, nor is one necessary.
        >[color=green]
        > >I found this line:
        > >
        > >PATH /bin:/usr/bin[/color]
        >
        > 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.
        >[color=green]
        > >
        > >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[/color]
        >
        > 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.
        >[color=green]
        > >Does it go by another name? Why isn't it where PATH said it would be?[/color]
        >
        > 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[/color]

        Comment

        • Gordon Burditt

          #5
          Re: does the phpinfo() command ever lie?

          In article <da7e68e8.04080 51007.51dfabc4@ posting.google. com>,
          lawrence <lkrubner@geoci ties.com> wrote:[color=blue]
          >You wrote:[color=green][color=darkred]
          >>>> In my setup, the MIME type
          >>>> for the module is application/x-httpd-php.[/color][/color]
          >
          >And where do I find that information for my own server? phpinfo()????[/color]

          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

          Comment

          Working...