i am trying to make a secure log in and registration page using php. i found a code on internet that helped me alot but while debugging and clicking on the button register, an error appeared saying "Fatal error: Call to undefined function openssl_random_pseudo_bytes() " when i went to the specified line in the code i found this : "$random_salt = hash('sha512', uniqid(openssl_random_pseudo_bytes(16), TRUE));
" i think i have the 5.3.8 version of php i downloaded the php 5.5.9 thread but it think i didn't install it well. I am on windows. Can alone help me please? I am still a beginner in these stuffs Thanks in advance
Asked
Active
Viewed 505 times
1

user3359695
- 35
- 6
-
1http://stackoverflow.com/questions/11212808/fatal-error-call-to-undefined-function-openssl-random-pseudo-bytes – Nouphal.M Mar 01 '14 at 15:39
-
@Nouphal.M i saw it but i didnt understand what should i do, i need a clear explanation – user3359695 Mar 01 '14 at 16:07
2 Answers
0
You need to enable the open_ssl
extension on your PHP.ini
Open your PHP.ini , search for this line
;extension=php_openssl.dll
Remove the ;
before the line , save the file and restart your webserver and you are good to go.
How to find the right php.ini ?
Create a simple test file like test.php
, add <?php phpinfo();
and execute it. Search for Loaded Configuration File
line and see the path next to that line.

Shankar Narayana Damodaran
- 68,075
- 43
- 96
- 126
-
1Instead of using `phpinfo()` only to find what is the loaded php.ini file path, I would consider using `php_ini_loaded_file()` function (as of PHP 5.2.4) – barell Mar 01 '14 at 15:46
-
@ShankarDamodaran i didnt found php.in in the path , i found two : php.ini-Development and -production i entered them and edit it and got the same error – user3359695 Mar 01 '14 at 15:53
-
Did you follow the instructions I gave in the post ? – Shankar Narayana Damodaran Mar 01 '14 at 16:10
-
yes i changed both file : php-ini-development and production and the same error – user3359695 Mar 01 '14 at 16:24
0
In order to use OpenSSL function you need to install the OpenSSL extension for php. Documentation

Andrei Demian
- 63
- 1
- 6
-
i think i have it man , in phpinfo() i found OPENSSL_CONF C:/xampp/apache/bin/openssl.cnf – user3359695 Mar 01 '14 at 16:05