Try installing with:
yum install php-openssl
If you also need to install the apache module, and if the command is not specified above, follow these steps:
yum install mod_ssl
Then check if php.ini supports the extension, if you do not know which php.ini you are using, you can put the following in your php file:
echo php_ini_loaded_file();
Since you are using linux, find the line below in the file if it does not add it to the end:
extension=openssl.so
After that restart the apache server using
service httpd restart
You must have ssl installed and you can check it with the following php file:
phpinfo();
source share