Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 4 Years, 8 Months, 1 Week ago [Performance] Registration page very slow or not loading at all
#11
Solved: 4 Years, 8 Months, 1 Week ago
After some more investigating we found this error in the php-error log:
[06-Feb-2015 14:23:31] PHP Fatal error: Maximum execution time of 30 seconds exceeded in D:\Websites\carisForums\inc\functions.php on line 7282

So I commented out the code from line 7280 to 7301:

// Windows
// Use OpenSSL when available
// PHP <5.3.4 had a bug which makes that function unusable on Windows
//if(function_exists('openssl_random_pseudo_bytes') && version_compare(PHP_VERSION, '5.3.4', '>='))
// {
// $output = openssl_random_pseudo_bytes($count);
// }
// // Try mcrypt
// elseif(function_exists('mcrypt_create_iv'))
// {
// $output = mcrypt_create_iv($count, MCRYPT_RAND);
// }
// // Try Windows CAPICOM before using our own generator
// elseif(class_exists('COM'))
// {
// try
// {
// $CAPI_Util = new COM('CAPICOM.Utilities.1');
// if(is_callable(array($CAPI_Util, 'GetRandom')))
// {
// $output = $CAPI_Util->GetRandom($count, 0);
// }
// } catch (Exception $e) {
// }
// }

Now the forum is very responsive but I'm a little concerned about the code that is no longer running if it could effect our security in any way.
Reply
#12
Solved: 4 Years, 8 Months, 1 Week ago
Line 7282 is $output = openssl_random_pseudo_bytes($count);, right? Which PHP version are you using?
Reply
#13
Solved: 4 Years, 8 Months, 1 Week ago
We are using 5.3.5
Reply
#14
Solved: 4 Years, 8 Months, 1 Week ago
Looks like that function may be just slow on Windows:
https://bugs.php.net/bug.php?id=51636
http://stackoverflow.com/a/4140626
http://laravel.io/forum/05-22-2014-opens...pplication

You can leave
//if(function_exists('openssl_random_pseudo_bytes') && version_compare(PHP_VERSION, '5.3.4', '>='))
//	{
//	$output = openssl_random_pseudo_bytes($count);
//	}
commented, uncomment the rest and replace the first elseif with if.

I also opened a github issue for possibly switching the order of the conditionals: https://github.com/mybb/mybb/issues/1815
Reply
#15
Solved: 4 Years, 8 Months, 1 Week ago
Ok I did the same with that snippet of code. 

So no security issues with these edits then?
Reply
#16
Solved: 4 Years, 8 Months, 1 Week ago
No. The other 2 functions will be used if they're available or the MyBB generator if they're not.
Reply
#17
Solved: 4 Years, 8 Months, 1 Week ago
(02-06-2015, 08:26 PM)Destroy666 Wrote: No. The other 2 functions will be used if they're available or the MyBB generator if they're not.

Nice. Well thanks for the info.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)