cPanel

Select a PHP Binary


Overview

The cPanel Server Daemon (cpsrvd) must know the path to the specific PHP binary that you wish to use to process PHP scripts (for example, phpMyAdmin). There are several PHP binaries from which you may choose.

The cPanel-provided PHP binary

The /var/cpanel/usecpphp file, when it exists, causes the cpsrvd daemon to use a non-system PHP that cPanel, L.L.C. provides. You may wish to use this functionality if Apache’s version of PHP does not include all of the features to run inside of the cpsrvd daemon. This PHP binary contains all of the necessary options to run inside of the cpsrvd daemon.

The cPanel-provided PHP binary exists on the system as one of the following files:

  • /usr/local/cpanel/3rdparty/bin/php
  • /usr/local/cpanel/3rdparty/bin/php-cgi
Note:
The system prefers the php-cgi file over the php file if both are available and executable.

PHP binary use

If /var/cpanel/usecpphp does not exist, WHM uses the PHP binary (/usr/local/cpanel/3rdparty/bin/php-cgi). You can modify the behavior in the /var/cpanel/3rdparty/bin/php file. If the binary exists, is executable, and the /var/cpanel/usecpphp file exists, then the cpsrvd daemon will always use this binary.

Use the following flowchart to determine which PHP binary the cpsrvd daemon uses:


cPanel & WHM PHP binary flowchart

Remember:
  • The system prefers the php-cgi file over the php file if both are available and executable.
  • The system only uses the /usr/bin/php file if the usecpphp file does not exist and the request is for a third-party product.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *