March 2010
M T W T F S S
« Feb   Apr »
1234567
891011121314
15161718192021
22232425262728
293031  
  1. We welcome any feedback, questions or comments

How do I enable openssl extension on PHP

I used a custom php build on My Centos server. Now I want to enable openssl extension in order to communicate with SSL.

Solution.

Download and install openssl

 #wget http://www.openssl.org/source/openssl-1.0.0.tar.gz
#./configure && make && make install

You may use yum method to install it (yum install openssl*)

2. Next step is to start the php re-compilation. For this, have modified my config parameter in order to work with ‘openssl’

./configure –prefix=/usr/local/php –with-apxs2=/usr/sbin/apxs –with-xsl –with-mysql –with-config-file-scan-dir=/etc/php.d –prefix=/usr –exec-prefix=/usr –bindir=/usr/bin –sbindir=/usr/sbin –sysconfdir=/etc –datadir=/usr/share –includedir=/usr/include –libdir=/usr/lib –libexecdir=/usr/libexec –with-config-file-path=/etc –with-bz2 –with-curl –with-exec-dir=/usr/bin –with-png –with-zlib –with-pear=/usr/share/pear –with-zml –with-gd –with-libxml=/usr/lib –enable-calendar –with-openssl=shared –with-png –with-bcmath –with-mysqli –enable-soap -with-jpeg –enable-sockets –enable-mbstring –enable-shared –with-jpeg-dir=/usr/local –with-freetype-dir=/usr/local/lib –with-pdo-mysql=shared –with-gettext

[root@rc-040 php-5.2.9]# mv  /usr/lib/httpd/modules/libphp5.so  /tmp/
# cd php-5.2.9
#make && make install

I have modify the ext_dir (extension_dir = “/usr/lib/extensions/no-debug-non-zts-20060613″)  location on php.ini and add a new line “extension=openssl.so” at the end of  /etc/php/ini “file

#service httpd restart
[root@rc-040 php-5.2.9]# php -r 'phpinfo();' | grep openssl
openssl

Open the browser and verify “openssl “ is showing on phpinfo() function.

Author: Liju Mathew
Visit Liju's Website - Email Liju
I'm Liju, one linux enthusiastic who have been playing with Linux for more than 7 years. I'm curious about to read blog, learning and implementing new technologies from my personal experience. Like to be play with burning head on busy schedule :-) This is a bookmark of all challenges that I'd faced which would be helpful to others sometimes as I'd learn it from the same way :-) Nothing more, I have to go miles, before I sleep

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>