FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Php windows system(whois) not working
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Php windows system(whois) not working [message #170289] Wed, 27 October 2010 03:11 Go to next message
Chuck Anderson is currently offline  Chuck Anderson
Messages: 63
Registered: September 2010
Karma: 0
Member
I downloaded a Windows version of whois.
Whois v1.01 from technet.microsoft.com.

It works fine from a windows command line, but when I try to run it from
Php running as an Apache module (Windows XP - Apache2.2.16 PHP 5.2.14),
it will not execute. The page never finishes loading.

i.e.,

<?php
system("whois example.com", $retval)
?>

.... saved as a file and run under localhost it never stops loading
(browser just "sits and spins").

If I use Php from a Windows command line it works:
php -r "system(\"whois example.com\", $retval);"
I get the expected whois output.

I have another Windows executable that does this, too (Clamp - Command
line Win Amp controls). From a Windows Command window it works. Using
a system call in Php from the windows command line, it works. If I try
to run it from localhost using the Php Apache module, it does the same
as above. The page never stops trying to load.

I have searched high and low and can not find an explanation for either
of these and am fishing for ideas. What could it be?

--
*****************************
Chuck Anderson • Boulder, CO
http://www.cycletourist.com
Turn Off, Tune Out, Drop In
*****************************
Re: Php windows system(whois) not working [message #170290 is a reply to message #170289] Wed, 27 October 2010 03:16 Go to previous messageGo to next message
Magno is currently offline  Magno
Messages: 49
Registered: October 2010
Karma: 0
Member
On 10/27/2010 12:11 AM, Chuck Anderson wrote:
> I downloaded a Windows version of whois.
> Whois v1.01 from technet.microsoft.com.
>
> It works fine from a windows command line, but when I try to run it from
> Php running as an Apache module (Windows XP - Apache2.2.16 PHP 5.2.14),
> it will not execute. The page never finishes loading.
>
> i.e.,
>
> <?php
> system("whois example.com", $retval)
> ?>
>
> ... saved as a file and run under localhost it never stops loading
> (browser just "sits and spins").
>
> If I use Php from a Windows command line it works:
> php -r "system(\"whois example.com\", $retval);"
> I get the expected whois output.
>
> I have another Windows executable that does this, too (Clamp - Command
> line Win Amp controls). From a Windows Command window it works. Using a
> system call in Php from the windows command line, it works. If I try to
> run it from localhost using the Php Apache module, it does the same as
> above. The page never stops trying to load.
>
> I have searched high and low and can not find an explanation for either
> of these and am fishing for ideas. What could it be?
>

Never tried any of this in Windows... but did you try checking the
Apache logs?
Re: Php windows system(whois) not working [message #170291 is a reply to message #170290] Wed, 27 October 2010 04:54 Go to previous messageGo to next message
Chuck Anderson is currently offline  Chuck Anderson
Messages: 63
Registered: September 2010
Karma: 0
Member
Magno wrote:
> On 10/27/2010 12:11 AM, Chuck Anderson wrote:
>
>> I downloaded a Windows version of whois.
>> Whois v1.01 from technet.microsoft.com.
>>
>> It works fine from a windows command line, but when I try to run it from
>> Php running as an Apache module (Windows XP - Apache2.2.16 PHP 5.2.14),
>> it will not execute. The page never finishes loading.
>>
>> i.e.,
>>
>> <?php
>> system("whois example.com", $retval)
>> ?>
>>
>> ... saved as a file and run under localhost it never stops loading
>> (browser just "sits and spins").
>>
>> If I use Php from a Windows command line it works:
>> php -r "system(\"whois example.com\", $retval);"
>> I get the expected whois output.
>>
>> I have another Windows executable that does this, too (Clamp - Command
>> line Win Amp controls). From a Windows Command window it works. Using a
>> system call in Php from the windows command line, it works. If I try to
>> run it from localhost using the Php Apache module, it does the same as
>> above. The page never stops trying to load.
>>
>> I have searched high and low and can not find an explanation for either
>> of these and am fishing for ideas. What could it be?
>>
>>
>
> Never tried any of this in Windows... but did you try checking the
> Apache logs?
>

I looked in the logs and there is nothing ... just a POST request
(Post'ed form data to the script).

.............. Then ..... it just started working.

I've just seen something else kind of strange now, though. I get an
error from the Windows command line when running an exec call if there
is another exec call in progress. At least that's how it appears.

There's some strange interaction going on here that I don't understand.
At this point I'm thinking that it has little to do with Php, but if
anyone has any ideas .... I'm open to them. Otherwise, I think I need
to tinker with this some more and see where the problem might really be.

Thanks for listening (and responding).

--
*****************************
Chuck Anderson • Boulder, CO
http://www.cycletourist.com
Turn Off, Tune Out, Drop In
*****************************
Re: Php windows system(whois) not working [message #170293 is a reply to message #170291] Wed, 27 October 2010 08:12 Go to previous message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma: 0
Senior Member
El 27/10/2010 6:54, Chuck Anderson escribió/wrote:
> Magno wrote:
>> On 10/27/2010 12:11 AM, Chuck Anderson wrote:
>>> I downloaded a Windows version of whois.
>>> Whois v1.01 from technet.microsoft.com.
>>>
>>> It works fine from a windows command line, but when I try to run it from
>>> Php running as an Apache module (Windows XP - Apache2.2.16 PHP 5.2.14),
>>> it will not execute. The page never finishes loading.
>>>
>>> i.e.,
>>>
>>> <?php
>>> system("whois example.com", $retval)
>>> ?>
>>>
>>> ... saved as a file and run under localhost it never stops loading
>>> (browser just "sits and spins").
>>>
>>> If I use Php from a Windows command line it works:
>>> php -r "system(\"whois example.com\", $retval);"
>>> I get the expected whois output.
>>>
>>> I have another Windows executable that does this, too (Clamp - Command
>>> line Win Amp controls). From a Windows Command window it works. Using a
>>> system call in Php from the windows command line, it works. If I try to
>>> run it from localhost using the Php Apache module, it does the same as
>>> above. The page never stops trying to load.
>>>
>>> I have searched high and low and can not find an explanation for either
>>> of these and am fishing for ideas. What could it be?
>>>
>>
>> Never tried any of this in Windows... but did you try checking the
>> Apache logs?
>
> I looked in the logs and there is nothing ... just a POST request
> (Post'ed form data to the script).
>
> ............. Then ..... it just started working.
>
> I've just seen something else kind of strange now, though. I get an
> error from the Windows command line when running an exec call if there
> is another exec call in progress. At least that's how it appears.
>
> There's some strange interaction going on here that I don't understand.
> At this point I'm thinking that it has little to do with Php, but if
> anyone has any ideas .... I'm open to them. Otherwise, I think I need to
> tinker with this some more and see where the problem might really be.
>
> Thanks for listening (and responding).

If you are not using the full path but relying on the system PATH
variable, you may need to restart Apache or even the computer. (That
wouldn't explain the unresponsiveness though.)


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Array_multisort help please
Next Topic: array_merge vs just doing it
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 14:14:34 GMT 2024

Total time taken to generate the page: 0.02799 seconds