php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79123 Failed to init .Net runtime
Submitted: 2020-01-15 18:09 UTC Modified: 2020-01-22 20:26 UTC
From: v-altruo at microsoft dot com Assigned: cmb (profile)
Status: Closed Package: Testing related
PHP Version: 7.3.14RC1 OS: Windows Server 2012 R2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: v-altruo at microsoft dot com
New email:
PHP Version: OS:

 

 [2020-01-15 18:09 UTC] v-altruo at microsoft dot com
Description:
------------
Test fails for x64 builds (did not have x86 machine to test this) regardless of nts/ts and opcache on/off. It also fails for php-7.4.2RC1. 

Failed Test Location: ext\com_dotnet\tests\bug73679.phpt

Test script:
---------------
<?php

$stack = new DOTNET("mscorlib", "System.Collections.Stack", -2200000000);
$stack->Push(".Net");
$stack->Push("Hello ");
echo $stack->Pop() . $stack->Pop();

?>


Expected result:
----------------
Fatal error: Uncaught com_exception: Could not create .Net object - invalid codepage! in %sbug73679.php:%d
Stack trace:
#0 %sbug73679.php(%d): dotnet->dotnet('mscorlib', 'System.Collecti...', -2200000000)
#1 {main}
  thrown in %sbug73679.php on line %d

Actual result:
--------------
Fatal error: Uncaught com_exception: Failed to init .Net runtime [CoCreateInstance] Class not registered
 in C:\..\php-test-pack-7.4.2RC1\ext\com_dotnet\tests\bug73679.php:3
Stack trace:
#0 C:\..\php-test-pack-7.4.2RC1\ext\com_dotnet\tests\bug73679.php(3): dotnet->dotnet('mscorlib', 'System.Collecti...', -2200000000)
#1 {main}
  thrown in C:\..\php-test-pack-7.4.2RC1\ext\com_dotnet\tests\bug73679.php on line 3

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-01-16 08:12 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-01-16 08:12 UTC] cmb@php.net
Is .NET Framework installed on that machine?  If so, which
version(s)?
 [2020-01-16 17:48 UTC] v-altruo at microsoft dot com
-Status: Feedback +Status: Assigned
 [2020-01-16 17:48 UTC] v-altruo at microsoft dot com
The test also fails for Windows Server 2016 and 2019.

All 3 of these OS have .NET framework installed. The versions installed are:
1.0.3705
1.1.4322
2.0.50727
4.0.30319
 [2020-01-17 15:42 UTC] cmb@php.net
-Status: Assigned +Status: Feedback
 [2020-01-17 15:42 UTC] cmb@php.net
Okay, but the error message hints at CLRMetaData.CorRuntimeHost
not being registered.  Please search the registry's
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID hive for the key

  {CB2F6723-AB3A-11d2-9C40-00C04FA30A3E}
 [2020-01-17 18:00 UTC] v-altruo at microsoft dot com
-Status: Feedback +Status: Assigned
 [2020-01-17 18:00 UTC] v-altruo at microsoft dot com
I searched each OS and all of them have that key in their registry.
 [2020-01-17 18:37 UTC] cmb@php.net
-Status: Assigned +Status: Feedback
 [2020-01-17 18:37 UTC] cmb@php.net
Umm, I still think this is some setup issue, but to be sure, would
that test pass with PHP 7.3.13 or 7.4.1 (checking one of these
machines should be sufficient)?
 [2020-01-17 18:52 UTC] v-altruo at microsoft dot com
-Status: Feedback +Status: Assigned
 [2020-01-17 18:52 UTC] v-altruo at microsoft dot com
The test does not pass with the 7.4.1 build. However, I do believe you are correct about it being a setup issue. I ran the test locally (Windows 10), and the test passed.
 [2020-01-22 20:26 UTC] v-altruo at microsoft dot com
-Status: Assigned +Status: Closed
 [2020-01-22 20:26 UTC] v-altruo at microsoft dot com
It was indeed a setup error. This test works correctly now.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 02:01:28 2024 UTC