Andrew DeFaria wrote:[color=blue]
> Jerry Stuckle wrote:
>[color=green]
>> Andrew DeFaria wrote:
>>[color=darkred]
>>> I have somebody or some people who are abusing a Perl based .cgi
>>> script. I have written a PHP page which reports this abuse as per
>>> $_SERVER[REMOTE_ADDR]. My intentions were to replace the .cgi script
>>> with this .php script. Problem is these people are coming in with
>>> some web crawler or something like that (i.e. wget
>>>
http://myserver.com/thescript.cgi). Now if I replace thescript.cgi
>>> with thescript.php they will not hit it. And if I replace
>>> thescript.cgi with my PHP page, because it's not a Perl script yet
>>> ends in .cgi Apache is saying "Exec format error: exec of
>>> '/path/to/script/thescript.cgi' failed". Is there a way I can
>>> configure Apache or otherwise have thescript.cgi execute PHP code
>>> (without crippling other .cgi Perl scripts on my site)?[/color]
>>
>>
>> You'll need to tell Apache to parse this file as PHP. I haven't tried
>> it, but something like this might work in you httpd.conf:
>>
>> AddType application/x-httpd-php thescript.cgi
>>
>> If you don't have access to httpd.conf, you probably can add it to
>> your .htaccess file, but I haven't tried it.[/color]
>
>
> That would cripple all the other .cgi Perl scripts on my site. I have
> configured the CGIType in Apache and normally I want .cgi files to
> execute Perl. But in this instance I want the .cgi to be executed by PHP.
>
> I may try a redirect later tonight. Either that or instead of a web page
> with embedded PHP I might try the shebang line of #!/usr/bin/php and
> have it write out all of the necessary HTML - you know the content
> header, etc...[/color]
Andrew,
No, it will only execute "thescript.cgi". If you put in there "*.cgi"
it would cripple all the other scripts.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================