PHP script gets called without extension

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

    #1

    PHP script gets called without extension

    Hi,

    I've seen a behavior on both my windows machine and a Linux server that
    php scripts get called even when called without a .php extension.

    for example,

    gets executed even when called as


    (you can actually verify by opening both those links)

    Is anyone aware of this behaviour ? This works for all PHP files and
    I've not put any configuration directive in place to make this happen.
    Anyone has any clue why this happens ? .. What default configuration
    can be making this happen ?

    thank you,

    regards,
    -Puneet Arora.

  • Andy Hassall

    #2
    Re: PHP script gets called without extension

    On 7 Dec 2006 15:59:46 -0800, "arorap" <arorap@gmail.c omwrote:
    >I've seen a behavior on both my windows machine and a Linux server that
    >php scripts get called even when called without a .php extension.
    >
    >for example,
    >http://srlchem.com/company/about.php
    >gets executed even when called as
    >http://srlchem.com/company/about
    >
    >(you can actually verify by opening both those links)
    >
    >Is anyone aware of this behaviour ? This works for all PHP files and
    >I've not put any configuration directive in place to make this happen.
    >Anyone has any clue why this happens ? .. What default configuration
    >can be making this happen ?
    Apache's MultiViews option is most likely - ask in alt.apache.conf iguration
    for more details.

    --
    Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
    http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

    Comment

    • theCancerus

      #3
      Re: PHP script gets called without extension


      expose_php = Off
      in php.ini can easily do this have a look and let me know

      arorap wrote:
      Hi,
      >
      I've seen a behavior on both my windows machine and a Linux server that
      php scripts get called even when called without a .php extension.
      >
      for example,

      gets executed even when called as

      >
      (you can actually verify by opening both those links)
      >
      Is anyone aware of this behaviour ? This works for all PHP files and
      I've not put any configuration directive in place to make this happen.
      Anyone has any clue why this happens ? .. What default configuration
      can be making this happen ?
      >
      thank you,
      >
      regards,
      -Puneet Arora.

      Comment

      • clb

        #4
        Re: PHP script gets called without extension

        I don't know your exact config but I use a CLI and you can do the same w/ PHP as
        you would do with Perl, that is, start the file with a line like:
        #!/usr/local/bin/php
        <?php
        ...
        ?>

        This will execute the program same as a perl might.

        Andy Hassall wrote:
        On 7 Dec 2006 15:59:46 -0800, "arorap" <arorap@gmail.c omwrote:
        >
        I've seen a behavior on both my windows machine and a Linux server that
        php scripts get called even when called without a .php extension.

        for example,

        gets executed even when called as


        (you can actually verify by opening both those links)

        Is anyone aware of this behaviour ? This works for all PHP files and
        I've not put any configuration directive in place to make this happen.
        Anyone has any clue why this happens ? .. What default configuration
        can be making this happen ?
        >
        Apache's MultiViews option is most likely - ask in alt.apache.conf iguration
        for more details.
        >
        --
        Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
        http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

        Comment

        Working...