Hi,
Yes I have used --enable-discard-path, the script work with 
#!/usr/local/bin/php 

I'll give the full configuration later 

Philippe 


Stefan Siefert writes: 

> Hi, 
> 
> well I do understand your needing. 
> 
> First a question. What are your compile options, e.g. your configure call?
> Do you use --enable-discard-path ? If not, try this. You need this option to
> run Phpscripts from cgi-bin folders!!! 
> 
> Greetings, 
> 
> Stefan Siefert 
> 
> -----Ursprüngliche Nachricht-----
> Von: Philippe [mailto:[EMAIL PROTECTED]]
> Gesendet: Sonntag, 21. Oktober 2001 17:53
> An: Stefan Siefert; php-general; php-install
> Betreff: Re: PHP/CGI problem: #!/path/php at top of CGI script appears
> in output 
> 
> 
> Hi,
> Thanks Stefan for your answer 
> 
> First, I'll explain why I want to use php in cgi
> I'ts a simple reason, some users want to use php without safemode (which is
> required with Apache due to safety problems). So I want to use php in cgi
> mode with suexec. 
> 
> I've tryed your solution, it works in all non-cgi directory
> But it doesn't work in cgi directory with suexec or not 
> 
> If I put #/usr/local/bin/php in the script, the script work but we can see
> #/usr/local/bin/php at the top. 
> 
> If I don't put it, there is an 500 error (Internal Server Error)
> In error_log, we can see these lines 
> 
> [Sun Oct 21 17:30:10 2001] [error] (8)Exec format error: exec of
> /home/webbourse/cgi-bin/php.cphp failed
> [Sun Oct 21 17:30:10 2001] [error] [client 212.103.7.98] Premature end of
> script headers: /home/webbourse/cgi-bin/php.cphp 
> 
> Someone has an idea ???? 
> 
> Thanks
> Philippe 
> 
> Stefan Siefert writes: 
> 
>> Hi @all.. 
>>
>> I'm not sure if this can fix (or explain) your problem (cause I didn't
> tried
>> it in lack of time) but theoretical it could be :). 
>>
>> I think you only need the #!/usr/local/bin/php if you would like to run
>> scripts from the bash, or as a "real" cgi. But I think, there could be
>> another solution .. compile your php as cgi like you did and add these
> lines
>> in your httpd.conf 
>>
>> ScriptAlias /php/ "/usr/local/bin/" 
>>
>> AddType application/x-httpd-php .php .phtml .cgi 
>>
>> Action application/x-httpd-php "/php/php" 
>>
>> This should also launch the cgi - version of php, but doesn't requires the
>> #! line in the scripts. I'm not sure, but it should work. 
>>
>> Hope this helps you, 
>>
>> Stefan Siefert 
>>
>> 
>>
>> ----- Original Message -----
>> From: Dave Goodrich <[EMAIL PROTECTED]>
>> To: Philippe <[EMAIL PROTECTED]>
>> Cc: php-general <[EMAIL PROTECTED]>; php-install
>> <[EMAIL PROTECTED]>
>> Sent: Saturday, October 20, 2001 6:05 PM
>> Subject: [PHP-INST] Re: [PHP] PHP/CGI problem: #!/path/php at top of CGI
>> script appears in output 
>>
>>
>>> It's not you. I just built a bare cgi version of php, nothing but
>>> './configure' and got the same result. 
>>>
>>> I used this simple script to be sure I was in fact running the cgi binary
>>> and it showed I was. 
>>>
>>> info.cgi
>>> #!/usr/local/bin/php
>>> <?php
>>> phpinfo();
>>> ?> 
>>>
>>> I got the correct info page, but with the #!/usr/local/bin/php at the top
>>> as you stated. Odd, but I've never used the cgi version so other than
>>> confirming your problem I am afraid I'm no help. 
>>>
>>> DAve 
>>>
>>> On Sat, Oct 20, 2001 at 03:31:06PM +0000, Philippe wrote:
>>> > Hi,
>>> > I'll synthetize the problem with the response I have givven to Curt.
>>> >
>>> > I've FreeBSD 4.2/Apache 1.3.9/PHP 4.0.6
>>> > I've installed PHP in Apache, it works very well
>>> > I need to have too PHP 4.0.6 in CGI mode (With Suexec but I don't think
>> it's
>>> >
>>> > the problem) but I've a problem.
>>> >
>>> > In CGI mode, the path of PHP is always written at the top of the result
>>> >
>>> > I'll take for example this script which is in the cgi-bin with the
>> execute
>>> > mod (755), the extension is .cgi :
>>> >
>>> > ----
>>> > #!/usr/local/bin/php
>>> > <?
>>> > print "Hello World";
>>> > ?>
>>> > ----
>>> >
>>> > When the file is called by the browser, the result is :
>>> > ----
>>> > #!/usr/local/bin/php
>>> > Hello World
>>> > ----
>>> >
>>> > Does someone know the problem and the solution ?
>>> > Have I forgotten something ?
>>> >
>>> > I think that's a misconfiguration in PHP
>>> >
>>> > Thanks for your help
>>> >
>>> > Philippe
>>> >
>>> >
>>> > --
>>> > PHP General Mailing List (http://www.php.net/)
>>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> > For additional commands, e-mail: [EMAIL PROTECTED]
>>> > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
>>> > 
>>>
>>> --
>>> My other computer is your Windows machine... 
>>>
>>> 
>>>
>>> --
>>> PHP Install Mailing List (http://www.php.net/)
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>> To contact the list administrators, e-mail: [EMAIL PROTECTED] 
>>>
>>>
>>
>  
> 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to