|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-12-27 11:49 UTC] asegu_php at borgtech dot ca
Description: ------------ 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: --------------- http://borgtech.ca/php/iis.phps Expected result: ---------------- C:\php4>php -c c:\winnt\php.ini iis.php Content-type: text/html X-Powered-By: PHP/4.3.4 Array ( [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 /> PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 21:00:01 2025 UTC |
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 GrootNot 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 from snaps.php.net.