Remi Collet

Recent Posts

PHP Configuration Tips

RHEL 7 provides the Apache HTTP Server version 2.4 and PHP version 5.4.

The most common configuration for Apache httpd and PHP uses, but this has some limitations and drawbacks:

  • a single PHP version of mod_php can be used
  • mod_php run in the httpd process, without any isolation
  • mod_phpis only supported for the prefork MPM

This article will explain how to configure Apache httpd to delegate PHP scripts execution to a backend using the FastCGI protocol, how to use a more recent PHP version, how to run multiple PHP versions, and how to improve Apache httpd performance.

Continue reading “PHP Configuration Tips”

Share

Running PHP FPM in Docker

Use cases

In Red Hat Enterprise Linux we support a variety of different versions of PHP. Sometimes users find they need to run a legacy application, requiring an older version of PHP, on a newer version of RHEL. Developers may want to develop an application on their Fedora Workstation and deploy it on a RHEL server or ensure it will be compatible with all available PHP versions in enterprise distributions.PHP logo

This example can be easily adapted for all PHP versions available as RPM packages in distribution repository (5.3.3 in RHEL-6, 5.4.16 in RHEL-7, 5.4.16 and 5.5.6 in RHSCL-1.2).

Here is the sample Dockerfile I use to run PHP 5.3 FPM in an CentOS-6 container:

Continue reading “Running PHP FPM in Docker”

Share

Apache with various PHP versions, using SCL

RHSCL 1.1 Beta is available and provides Apache httpd 2.4, PHP 5.4 and PHP 5.5.

The most common configuration for Apache and PHP uses mod_php, but this only allows a single PHP version. Apache httpd 2.4 introduces mod_proxy_fgci which can simply redirect requests to a php-fpm backend.

This article shows a simple way to use a single Apache server and simultaneously run 3 versions of PHP (5.3, 5.4 and 5.5). The same site will be served through 3 sub-URL.

Continue reading “Apache with various PHP versions, using SCL”

Share

PHP 5.4 on RHEL-6 using RHSCL

Official announcement : Red Hat Software Collections 1.0 Beta Now Available

More information on Software Collections

Stability addicts can keep quiet, PHP 5.3.3 is still the standard version provided with RHEL-6.

We’ll soon have an official and supported way to install PHP version 5.4, beside the system version, without any effect on installed components. The announcement tells us the life cycle will be 3 years.

Warning:  it’s a beta version, published for evaluation purposes.

Installation

Activation of the distribution channel (requires a valid subscription) from the RHN web interface or from command line:

Continue reading “PHP 5.4 on RHEL-6 using RHSCL”

Share