title: Recompile PHP with OpenSSL on CentOS
body: <p>I have upgraded openssl version to <code>1.02l</code> from <code>1.0.1e</code> and PHP version from PHP <code>5.6</code> to <code>PHP 7.1.8</code> (PHP is installed using yum)</p>
  
  <p>The problem is, PHP still detects openssl version to <code>1.0.1e</code> whereas I want it to be updated to latest openssl version installed i.e <code>1.0.2l</code></p>
  
  <p>I want to know what are my options here, how do I go about telling PHP to use the latest installed openssl version?</p>
  
  <p>My finding tells me that the only way to do it is by recompiling PHP? (will appreciate if someone can tell me if there is other way) If the only way is by recompiling, I need help on how to go about it? what are the steps involved. From my understanding, here is how I think I have to do.</p>
  
  <ul>
  <li>Remove PHP version installed from YUM</li>
  <li>Download latest version of PHP from source and unzip in tmp directory</li>
  <li>Compile &amp; Install PHP</li>
  </ul>
  
  <p>Am I missing anything here?</p>
  
  <p>** <strong>UPDATE</strong> **</p>
  
  <p>Here are the list of php extensions installed using yum</p>
  
  <pre><code> php-bcmath                        x86_64       7.1.8-1.el7.remi             @remi-php71        94 k
   php-common                        x86_64       7.1.8-1.el7.remi             @remi-php71       7.9 M
   php-fedora-autoloader             noarch       0.2.1-2.el7                  @epel              14 k
   php-gd                            x86_64       7.1.8-1.el7.remi             @remi-php71       204 k
   php-intl                          x86_64       7.1.8-1.el7.remi             @remi-php71       947 k
   php-json                          x86_64       7.1.8-1.el7.remi             @remi-php71        80 k
   php-mbstring                      x86_64       7.1.8-1.el7.remi             @remi-php71       2.8 M
   php-mysqlnd                       x86_64       7.1.8-1.el7.remi             @remi-php71       850 k
   php-pdo                           x86_64       7.1.8-1.el7.remi             @remi-php71       386 k
   php-pecl-zip                      x86_64       1.13.5-2.el7.remi.7.1        @remi-php71       175 k
   php-php-gettext                   noarch       1.0.12-1.el7                 @epel              57 k
   php-process                       x86_64       7.1.8-1.el7.remi             @remi-php71       180 k
   php-tcpdf                         noarch       6.2.13-1.el7                 @epel              11 M
   php-tcpdf-dejavu-sans-fonts       noarch       6.2.13-1.el7                 @epel             1.5 M
   php-tidy                          x86_64       7.1.8-1.el7.remi             @remi-php71       106 k
   php-xml                           x86_64       7.1.8-1.el7.remi             @remi-php71       851 k
  </code></pre>
  
  <p>I now want to configure PHP to use this extensions, so far I have comeup with following</p>
  
  <pre><code>./configure --with-openssl --with-openssl-dir=/usr/bin \
      --with-zlib \
      --enable-zip \
      --enable-xmlreader \
      --enable-xmlwriter \
      --enable-opcache \
      --enable-simplexml \
      --with-sqlite3 \
      --with-pdo-sqlite \
      --with-pdo-mysql=mysqlnd \
      --with-mysqli=mysqlnd \
      --with-mysql-sock=/var/lib/mysql/mysql.sock \
      --enable-mysqlnd \
      --with-mcrypt \
      --enable-mbstring \
      --enable-intl \
      --with-png-dir \
      --with-jpeg-dir \
      --enable-gd-native-ttf \
      --with-gd \
      --with-curl \
      --with-bz2 \
      --enable-bcmath
  </code></pre>
  
  <p>I just want to know now, If I need to enable any extension from above list do I use --enable or --with ? for example how do I enable php-xml. Do I only use --enable-php-xml ?</p>