Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
stylenone

Overview

Websites frequently use the PHP scripting language for applications and content. EasyApache allows you to easily install and modify PHP for your server.

When you install cPanel & WHM, the installation process automatically installs PHP with some common PHP options. 

For more information about PHP, read the PHP website. 

How Apache handles PHP

By default, cPanel & WHM configures your Apache web server to use the CGI PHP handler to handle requests that it receives for PHP content.

Note
titleNote:

The PHP handler that you select affects the speed and security of your web server. For more information about PHP handlers, read our PHP Handlers documentation.


PHP versions

Include Page
LIB:_AvailableVersionsPHP
LIB:_AvailableVersionsPHP

EasyApache 4 adheres to the php.net supported versions timelineThe profiles that we supply in WHM's EasyApache 4 interface (WHM >> Home >> Software >> EasyApache 4) only provide PHP versions that php.net currently supports

RPMs for unsupported versions of PHP will remain on the cPanel Inc. mirrors and servers, but we will not provide any further updates.

When the PHP development team makes a new version of PHP available, we test and then make the new version available in EasyApache.

Minor version number changes do not impact functionality, but major updates may require changes to your configuration. In many cases, the EasyApache software will make the necessary adjustments automatically. Custom configurations may require further manual adjustments. For more information on PHP versions and extensions available in EasyApache 4, read our  PHP Options documentation. 

MultiPHP

EasyApache 4 supports multiple versions of PHP.

To change your server's default version of PHP or a virtual host's version of PHP, use WHM's  MultiPHP Manager interface (WHM >> Home >> Software >> MultiPHP Manager). 

If the version of PHP that you wish to use does not exist on your server, you can install it with the EasyApache 4 interface (WHM >> Home >> Software >> EasyApache 4). To install your PHP version with yum, read our How to Locate and Install a PHP Version or Extension documentation. 

Vendor-provided PHP versions

Include Page
LIB:_EA4VendorProvidedPHP
LIB:_EA4VendorProvidedPHP

Modify PHP

You can use several methods to modify your PHP configuration. For more information, read the following documentation:

  • PHP Options — A list of the available options in EasyApache that directly modify PHP.
  • PHP Handlers — The PHP handler that you select determines how Apache handles requests for PHP content.

To more easily allow you to call the PHP binaries directly, we provide the following symlinks for each version of PHP installed on your system:

  • PHP CLI — /usr/local/bin/ea-php##, where ## represents the two-digit PHP version.
  • PHP CGI — /usr/bin/ea-php## command, where ## represents the two-digit PHP version.

To more easily allow you to install PECL and PEAR extensions, we provide the following symlinks:

  • PECL — /usr/bin/ea-php##-pecl, where ## represents the two-digit PHP version.
  • PEAR — /usr/bin/ea-php##-pear, where ## represents the two-digit PHP version.

Adjust configuration files

To further customize your PHP configuration, you can edit your .ini files. We strongly recommend that you only edit your configuration files with cPanel's  MultiPHP INI Editor interface (cPanel >> Home >> Software >> MultiPHP INI Editor). To edit your files manually, adjust the following files in your document root:

Apache handlerPHP configuration file
suPHP

.user.ini

Note
titleNote:

 If you enabled the suPHP_ConfigPath directive in your .htaccess file, read our The cPanel PHPRC PHP Patch for EasyApache 4 documentation.


CGIphp.ini
DSO.htaccess


PHP Security

To ensure that your PHP version stays up to date, use one of the following options:

  • Set the Operating System Package Updates section of WHM's Update Preferences interface (WHM >> Home >> Server Configuration >> Update Preferences) to Automatic
  • As a root-enabled user, run yum update on the command line. 
  • Install the CentOS-provided yum-cron package with the following command: yum install yum-cron.

For more information about PHP security, read the following documentation:

Additional documentation

Localtab Group


Localtab
activetrue
titleSuggested documentation

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel in ("ea4","php") and label = "whm" and space = currentSpace()


Localtab
titleFor cPanel users

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel in ("ea4","php") and label = "cpanel" and space = currentSpace()


Localtab
titleFor WHM users

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel in ("ea4","php") and label = "whm" and space in ("CKB",currentSpace())


Localtab
titleFor developers

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel in ("ea4","php") and space = "DD"