Project

General

Profile

Actions

Bug #23860

closed

Installation on Windows causes Fatal error: Call to undefined method com::GetRandom() during 1-2-3 installer.

Added by Peter Beernink over 13 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2010-10-28
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When installing on Windows Vista in a WAMP environment the install tool gives a fatal error:
Fatal error: Call to undefined method com::GetRandom() in t3lib\class.t3lib_div.php on line 1612

This seems to be caused by the CAPICOM service which is not registred.
For some reason (perhaps PHP changed some functionality) a Fatal error is given instead of an exception. Which is currently expected in that function.

As Microsoft no longer supports this object and advices to use a .NET object for this, the functionality need to be reviewed.

(issue imported from #M16154)


Files

afoeder_0046393.patch (532 Bytes) afoeder_0046393.patch Administrator Admin, 2011-01-20 12:33
afoeder_0046393_2.patch (533 Bytes) afoeder_0046393_2.patch Administrator Admin, 2011-01-21 10:12

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #23355: Speed up / restructure of random byte generator to address e.g. WIN OS specificsClosed2010-08-05

Actions
Actions #1

Updated by Jean-Sébastien Gervais over 13 years ago

For windows users experiencing the same bug on windows XP / windows server 2003, it can easily be fixed by theses few steps :

1 - Download and install CAPICOM sdk from microsoft
http://www.microsoft.com/downloads/details.aspx?FamilyId=860EE43A-A843-462F-ABB5-FF88EA5896F6&displaylang=en

2 - register the dll for COM service (the newly installed dll can be found in the folder C:\Program Files\Fichiers communs\Microsoft Shared\CAPICOM) with this command :
regsvr32 capicom.dll

3 - Enjoy !


For devellopers,

maybe adding a better message could help people resolving the issue, as an alternative for a better workaround

new COM or die ('Please install CAPICOM ... ');

(EDIT: Had the issue with TYPO3 4.5 beta1, on windows XP)

Actions #2

Updated by Steffen Gebert over 13 years ago

Jens-Sebastian, could you be so kind and provide a patch against a subversion checkout of TYPO3, please?

Actions #3

Updated by Adrian Föder about 13 years ago

afraid I'm not able to provide a patch because I don't know how; but I patched the following:

try {
$com = new COM;
if(is_callable(array($com,'GetRandom')) {
$output = base64_decode($com->GetRandom($count, 0));
}
}

I "wrapped" the if() block around the $output-line to make sure the function call won't crash.
I had the same problem on my machine and this fix fixed it.

Actions #4

Updated by Adrian Föder about 13 years ago

oh, by the way, when the error reads "Call to undefined method com::GetRandom()" it is not a problem of lacking a registered CAPICOM dll. IF the CAPICOM DLL was not present, it would read "Invalid Syntax" and run into the exception, because new COM throws that error.
I was able to reproduce that; compare http://bugs.php.net/bug.php?id=48498

Reaching the line $output... means that the COM initialisation succeeded, but the lacking function "GetRandom" throws the fatal error.

Actions #5

Updated by Adrian Föder about 13 years ago

...just found out how to create a patch file on windows and added it.

Actions #6

Updated by Marcus Krause about 13 years ago

I'll have a look at the patch next week.

Actions #7

Updated by Adrian Föder about 13 years ago

two of our customers that were having this problem independently confirmed that the patch works.
I also evaluated that the is_callable returns true if the CAPICOM is installed and works.

Actions #8

Updated by Mcenal about 13 years ago

Found a solution using the new code in .NET for Windows 7 that replaces part of CAPICOM. Looks to work the same as the original.

try {
$com = new COM;
$output = base64_decode($com->GetBytes($count));
} catch (Exception $e) {
// RNGCryptoServiceProvider not installed
}

Actions #9

Updated by Anonymous over 12 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100
Actions #10

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF