Add handler ? #!/usr/local/bin/php

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

    Add handler ? #!/usr/local/bin/php

    I have a web page like this
    #!/usr/local/bin/php
    <?
    echo "hello";
    ?>


    It always shows the first line as text output. Does anyone know how to
    let web server or intepreter ignor this line.

    I try to add the following line in the httpd.conf
    AddHandler cgi-script .php

    And make the file executable. It shows " internal server error".
    Since this package has around 40 or 50 pages. I do not want to get
    into each file and comment it out. Any idea about this?

    Thanks.
  • matty

    #2
    Re: Add handler ? #!/usr/local/bin/php

    grant wrote:[color=blue]
    >
    > It always shows the first line as text output. Does anyone know how to
    > let web server or intepreter ignor this line.
    >
    > I try to add the following line in the httpd.conf
    > AddHandler cgi-script .php
    >
    > And make the file executable. It shows " internal server error".
    > Since this package has around 40 or 50 pages. I do not want to get
    > into each file and comment it out. Any idea about this?
    >[/color]

    You could try

    Options +ExecCGI

    in your .htaccess, but it may be that your server config doesn't allow cgi
    scripts in that directory

    Comment

    Working...