|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26728 COM/DCOM crash on container object
Submitted: 2003-12-27 11:49 UTC Modified: 2004-01-07 16:05 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: asegu_php at borgtech dot ca Assigned: wez (profile)
Status: Closed Package: Reproducible crash
PHP Version: 5.0.0b2 (beta2) OS: windows 2000 server
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: asegu_php at borgtech dot ca
New email:
PHP Version: OS:


 [2003-12-27 11:49 UTC] asegu_php at borgtech dot ca
I'm working on a script to control IIS through COM objects.
Everything works fine under PHP4 (which I present in 'expected output'), but crashes under PHP5, either beta2, beta3 or php5-win32-200312262330 from the snapshots. (no difference in output other then the php version)

PHP4|PHP5 have the same results on my laptop as their equivalent version on my server.
The error message from php5 leads to believe that the error lies with ->Next() on the COM container.

Code in all situations is run from the command line as 'php -c c:\winnt\php.ini iis.php' where c:\winnt\php.ini is php5's php.ini-dist with minor modifications for session/temp folder paths.

I've read through some documentation on ADSI/COM, read through fully the COM support documentation of PHP, posted a message to the php windows email list

php.ini differences:
short_open_tag = Off
error_reporting  =  E_ALL
display_startup_errors = On
log_errors = On
register_long_arrays = Off
register_argc_argv = Off

extensions enabled:
php_imap.dll, php_ldap.dll, extension=php_xsl.dll

Reproduce code:

Expected result:
C:\php4>php -c c:\winnt\php.ini iis.php
Content-type: text/html
X-Powered-By: PHP/4.3.4

    [0] => Array
            [name] => 1
            [ServerComment] => ASITE1
            [bindings] => Array
                    [0] => Array
                            [hostheader] => xxxxxxxx
                            [port] => 80
                            [ip] => yyy.yyy.yyy.yyy


(continues for all sites configured on the server)

Actual result:
C:\php5>php -c c:\winnt\php.ini iis.php
Content-type: text/html
X-Powered-By: PHP/5.0.0b3

<br />
<b>Fatal error</b>:  Uncaught exception 'exception' with message 'Unknown except
ion' in C:\php5\iis.php:4
Stack trace:
#0 C:\php5\iis.php(19): iis::getSites()
#1 {main}
  thrown in <b>C:\php5\iis.php</b> on line <b>4</b><br />


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-27 20:10 UTC]
Assigning to Wez, the author of this code.
 [2004-01-07 05:01 UTC] phpmsql at yahoo dot com
I've got something similar on W2K using COM-object on PHP 5 beta 3. 

Some COM-object methods are working fine but using my login-method results in 
"Fatal error: Uncaught exception 'exception' with message 'Unknown exception' in c:\Inetpub\wwwroot\starado\menu.php:13 Stack trace: #0 {main} thrown in c:\Inetpub\wwwroot\starado\menu.php on line 13".
Arthur de Groot
 [2004-01-07 16:05 UTC]
Not really a bug, and not really a crash either (you
are responsible for catching exceptions if your code
is wrong).

The old PHP 4 hack:
    while( $obj = $iis->Next() ) {

is not supported under PHP 5.  Instead, use the much more
sensible foreach syntax:
    foreach ($iis as $obj) {

Having said that, there was a problem with the raising of
exceptions (which is why you got a not very useful
error message), and some issues with mapping of variants
into PHP; these issues have been resolved in CVS.

If you continue to have problems after you update your
script to PHP 5 syntax, please try the next php5 snapshot

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Feb 04 10:04:08 2023 UTC