[erlang-questions] Re: [Erlyaws-list] YAWS with PHP on Windows XP problem

Colm Dougan colm.dougan@REDACTED
Fri Aug 7 15:45:20 CEST 2009


Carl,

I duplicated your config on Windows XP and was able to get it working
on yaws-1.84.  However I firstly had to work-around a problem with my
php-cgi binary which was giving me empty HTTP response which may or
may not be what you are running into.

When I created a shell script and manually defined the same
environment variables that yaws was passing to the php binary I got
the following error :

###

<b>Security Alert!</b> The PHP CGI cannot be accessed directly.

<p>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.</p>
<p>For more information as to <i>why</i> this behaviour exists, see
the <a href="http://php.net/security.cgi-bin">manual page for CGI
security</a>.</p>
<p>For more information about changing this behaviour or re-enabling
this webserver,
consult the installation file that came with this distribution, or visit
<a href="http://php.net/install.windows">the manual page</a>.</p>

###

Speculatively I patched yaws to define the REDIRECT_STATUS environment
variable (with a value of "1") and when I recompiled yaws and
re-requested my test.php it worked fine.

I then realized that this behavior must be configurable in php.ini but
I wasn't sure where php was looking for the php.ini.  When I printed
out phpinfo() in my php script I could see it was looking for php.ini
in C:\WINDOWS.  When I copied the sample php.ini to that location and
altered it to have the following setting :

   cgi.force_redirect = 0

... then my php script worked fine with an unpatched yaws.

I'm not sure if this is the same issue you were running into but I
just wanted to confirm that it is possible to get php working on
Windows in yaws-1.84.

Colm



On Tue, Aug 4, 2009 at 2:28 PM, Carl McDade<carlmcdade@REDACTED> wrote:
> Is this being worked on? Or is it marked for testing/improvement in a
> later version?
>
> On Wed, Jul 29, 2009 at 6:49 AM, Carl McDade<carlmcdade@REDACTED> wrote:
>> Just to make sure I rolled back from 1.84 to 1.82 and received the same result.
>>
>> On Wed, Jul 29, 2009 at 6:19 AM, Carl McDade<carlmcdade@REDACTED> wrote:
>>> Hi,
>>>
>>> Confirming: I just tried this on Vista,PHP-CGI.exe and got the same
>>> result, which is a blank page and no error outside of the path error
>>> in the interactive window.
>>>
>>> /Carl
>>>
>>>
>>>
>>> On Tue, Jul 21, 2009 at 3:14 AM, andrew mmc<andrewmmc@REDACTED> wrote:
>>>> Forgive me if I'm stating the obvious now, but I think the first problem was
>>>> because the file extension was cgi, it tried to execute the file, which it
>>>> couldn't do because it is on windows.  When you changed the extension to
>>>> php, yaws knew to pass through the file as a parameter to the php executable
>>>> - the correct behaviour.
>>>>
>>>> I think the problem is now with php.  PHP has some default behaviour set for
>>>> security reasons.  e.g. on *nix you have to explicitly compile it with the
>>>> option to run as cgi.  It also by default will not allow itself to execute
>>>> anything outside of its docroot, so perhaps the test file isn't in or below
>>>> the docroot set in php.ini?
>>>>
>>>> Otherwise, perhaps some of the other cgi specific options there could have
>>>> an effect?
>>>>
>>>>
>>>> 2009/7/21 Claes Wikstrom <klacke@REDACTED>
>>>>>
>>>>> > Yes, this path exists. And it's correct - YAWS throws an error with
>>>>> > incorrect path.
>>>>> >
>>>>> > ("serwer" it's a Polish pronounceation of server, sorry for that - I've
>>>>> >  to change it but later ;))
>>>>> >
>>>>>
>>>>> Nice :-)
>>>>>
>>>>> > Still, problem is unresolved...
>>>>>
>>>>> I'll take a look at it - but not now. As I said before, this just
>>>>> needs to be debugged. I.e yaws_cgi.erl needs to be debug modified
>>>>> so that we
>>>>>
>>>>> 1. see what get's open_ported() ed
>>>>> 2. figure out why that doesn't work.
>>>>>
>>>>>
>>>>>
>>>>> /klacke
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Enter the BlackBerry Developer Challenge
>>>>> This is your chance to win up to $100,000 in prizes! For a limited time,
>>>>> vendors submitting new applications to BlackBerry App World(TM) will have
>>>>> the opportunity to enter the BlackBerry Developer Challenge. See full
>>>>> prize
>>>>> details at: http://p.sf.net/sfu/Challenge
>>>>> _______________________________________________
>>>>> Erlyaws-list mailing list
>>>>> Erlyaws-list@REDACTED
>>>>> https://lists.sourceforge.net/lists/listinfo/erlyaws-list
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Enter the BlackBerry Developer Challenge
>>>> This is your chance to win up to $100,000 in prizes! For a limited time,
>>>> vendors submitting new applications to BlackBerry App World(TM) will have
>>>> the opportunity to enter the BlackBerry Developer Challenge. See full prize
>>>> details at: http://p.sf.net/sfu/Challenge
>>>> _______________________________________________
>>>> Erlyaws-list mailing list
>>>> Erlyaws-list@REDACTED
>>>> https://lists.sourceforge.net/lists/listinfo/erlyaws-list
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Carl McDade
>>> Lead Developer
>>> ____________________
>>>
>>> FireOrb CMS
>>> www.fireorb.info
>>>
>>
>>
>>
>> --
>> Carl McDade
>> Lead Developer
>> ____________________
>>
>> FireOrb CMS
>> www.fireorb.info
>>
>
>
>
> --
> Carl McDade
> Lead Developer
> FireOrb CMS - www.fireorb.info
> __________________________
>
> Publisher and Editor
> Hiveminds Magazine -www.hiveminds.co.uk
>
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
>
>


More information about the erlang-questions mailing list