Skip to content

Instantly share code, notes, and snippets.

@maaarghk
maaarghk / ballache.md
Last active August 22, 2017 23:16
Dual PHP - Run PHP 5.3 using mod_php and PHP 5.6 using php_fpm on Apache 2.2, as distributed by CentOS 6.5. Also tested on CentOS 6.3!

Dual PHP - Apache 2.2 running PHP 5.3 mod_php and PHP 5.6 php_fpm on CentOS 6.5

Introduction

We have a CentOS 6.5 server in production, running sites which are not compatible with PHP 5.4+. For this reason, we are running Apache 2.2 + PHP 5.3 (mod_php). We also run some newer sites on the server and we would like to run them on PHP 5.6 in order to take advantage of the performance improvements which have been realised in the newer versions of PHP. To minimize pain, we will run both versions side by side. This will require mod_php to be overridden in the VirtualHost by mod_fastcgi. We will install PHP 5.6 FPM to achieve this.

This procedure has also been tested and works on an up to date install of CentOS 6.3!

<?php
/*
Plugin Name: WP SMTP PHP 5.6 fix
Version: 1.0
Author: unclego
Author URI: https://profiles.wordpress.org/unclego/
License: GPL2
Description: FIX for PHP Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed when using PHP 5.6+ and mail server with self signed certificate
*/