I get this error when using some library called: Mcrypt extension:
Fatal error:
Uncaught exception 'Exception' with message 'I cannot generate a secure
pseudo-random key. Please use PHP >= 5.3 or Mcrypt extension'
in C:\xampp\htdocs\PoliticalForum\Administrator\secure_session.php:74
Stack trace:
#0 C:\xampp\htdocs\PoliticalForum\Administrator\secure_session.php(107): SecureSession->_randomKey(32)
#1 [internal function]: SecureSession->open('C:\xampp\htdocs...', 'PHPSESSID')
#2 C:\xampp\htdocs\PoliticalForum\User\User\headerSite.php(31): session_start()
#3 C:\xampp\htdocs\PoliticalForum\mainHome.php(14): include_once('C:\xampp\htdocs...')
#4 {main} thrown in C:\xampp\htdocs\PoliticalForum\Administrator\secure_session.php on line 74
I found the class in this link:
I dont understand what version of php do I have!?!? and why hasnt the php updated, I have only updated my xamp to the newest version right now..
Note: there is no mistake in the class as it was made by one of Oreilly books’ author and was used and recommended by a few people in here.
You can find your php version on the command line using:
php -vYou can find out your php version, loaded extensions, and just about everything about PHP by putting the following in a file and calling it from your web browser:
Of course, don’t leave that up on your production server.
As for the error, you need to find your php.ini, which will be at
C:\xampp\php\php.iniand uncomment or add the lineextension=php_mcrpyt.dllYou might want to have a peek in
C:\xampp\php\extensions\and make sure that dll actually exists. If not (and you have verified you do have PHP 5.3) you can go download the “Zip” version of the windows installer which matches your version, unzip it, and then simply copy that file to your extensions.EDIT:
I had a look at the php manual for mcrypt and found this: “mcrypt is built in for PHP 5.3.x on windows, you don’t need to do anything with a dll anymore.”; I think it’s entirely possible that you upgraded PHP to a different directory than your XAMPP install; check those versions (http://localhost should take you to the xampp panel where you can find phpinfo() in the sidebar)