On 9/25/06, C. Michael Pilato <cmpilato@xxxxxxxxxx> wrote:
Brian G. Peterson wrote:
>> Brian, I'm having a little trouble with the archive URL you provided.
>> The text of one of the mails says "Add this file to your web tree (I
>> put it in /, but you don't have to) source_highlight.php", but I don't
>> actually see such a file's contents (or a link thereto) in the post.
>> (Maybe an attachment stripped from the archive?)
>
> Attached to this email.
Thanks.
>> At any rate, please allow me to ask a silly question. The error
>> message that PHP is reportedly giving is:
>>
>> Security Alert! The PHP CGI cannot be accessed directly. This PHP
>> CGI binary was compiled with force-cgi-redirect enabled. This means
>> that a page will only be served up if the REDIRECT_STATUS CGI
>> variable is set, e.g. via an Apache Action directive.
>> For more information as to why this behaviour exists, see the manual
>> page for CGI security.
>> (http://www.php.net/manual/en/security.cgi-bin.php)
>> For more information about changing this behaviour or re-enabling
>> this webserver, consult the installation file that came with this
>> distribution, or visit the manual page.
>>
>> Can ViewVC not just set the REDIRECT_STATUS environment variable before
>> calling the PHP binary? And if so, to what should it be set? Does PHP
>> care?
>
> In theory, yes, ViewVC could set this environment variable. Here is the
> current PHP doc page:
>
> http://www.php.net/manual/en/security.cgi-bin.force-redirect.php
>
> The manual doesn't say what it should be set to, so I'd guess anything
> other than FALSE or NULL. Try TRUE or 1 ?
I don't have a setup that includes PHP with this restriction. Are you
able to test stock ViewVC (without your tweaks) with the following added
just before the call to MarkupPHP():
os.putenv('REDIRECT_STATUS', '200 OK')
> Thanks for looking into this. It would be nice to get PHP source
> highlighting working in the ViewVC core again.
Sure. (Though, my Ubuntu PHP5 cli interface has none of the problems
you guys are seeing.)
--
C. Michael Pilato <cmpilato@xxxxxxxxxx>
CollabNet <> www.collab.net <> Distributed Development On Demand
I tried just adding the os.putenv('REDIRECT_STATUS', '200 OK') line in
and I eneded up with this error when viewing code:
An Exception Has Occurred
Error running external program. Command line was: "/usr/bin/php -q -s -n"
Python Traceback
Traceback (most recent call last):
File "./viewvc.py", line 3639, in main
request.run_viewvc()
File "./viewvc.py", line 388, in run_viewvc
self.view_func(self)
File "./viewvc.py", line 1451, in view_markup
generate_page(request, "markup", data)
File "./viewvc.py", line 837, in generate_page
template.generate(request.server.file(), data)
File "./ezt.py", line 326, in generate
self._execute(self.program, ctx)
File "./ezt.py", line 455, in _execute
step[0](step[1], ctx)
File "./ezt.py", line 460, in _cmd_print
_write_value(value, args, ctx)
File "./ezt.py", line 636, in _write_value
apply(value, [ctx] + list(args))
File "./viewvc.py", line 1214, in __call__
' | '))
ViewVCException: ViewVC Unrecoverable Error: Error running external
program. Command line was: "/usr/bin/php -q -s -n"
--
Mark
"Blessed is he who finds happiness in his own foolishness, for he will
always be happy."
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxxx
|