Archive for April, 2011

SBDavid

The update_php_mime_types Script

The update_php_mime_types Script

There is a command line tool for managing these settings called update_php_mime_types, located in the /usr/local/cpanel/bin/ directory.

Run the following command for detailed information about how this tool works:

/usr/local/cpanel/bin/update_php_mime_types –man

The update_php_mime_types script is run automatically as part of the EasyApache3.

It will update or remove PHP AddHandler directives in .htaccess files down to, by default, 3 levels deep within users’ home directories.

note Note: You can configure the depth for update_php_mime_types from the Tweak Settings page.

To prevent this update from occurring, create a file named:

/var/cpanel/easy_skip_update_php_mime_types

Reference: http://cpanel.net/

User-Level PHP Handling Customization

When PHP 4 and PHP 5 are both enabled and served using the CGI, DSO, or suPHP configurations, cPanel lets the user select the default PHP version that processes .php files for all domains assigned to that account.

This interface is available in cPanel’s X3 theme under Software/Services >> PHP Configuration. Available settings are PHP 4, PHP 5, and System Default.

The chosen value is reflected in the .htaccess file in the user’s home directory. If a user requires file extensions other than .php to be processed by the selected version of PHP, add those file extensions after .php to the AddHandler line in the .htaccess file.

SBDavid

SafePHPCGI PHP options

SafePHPCGI PHP options

SafePHPCGI — This option sets 2 flags for PHP that attempt to lock PHP to system php.ini files. This prevents users from using custom php.ini files when PHP is served via CGI. However, enabling this option does not prevent the use of custom php.ini files if PHP is running via mod_suphp.

SBDavid

The usecpphp File

The usecpphp File

/var/cpanel/usecpphp, when it exists, causes cpsrvd to use a non-system PHP provided by cPanel. You may want to do this if the version of PHP that you have built for Apache does not have all of the features required to run inside of cpsrvd.

This cPanel-provided PHP binary exists on the system as 1 of the 2 following files:

/usr/local/cpanel/3rdparty/bin/php
/usr/local/cpanel/3rdparty/bin/php-cgi

php-cgi is preferred over php if both are available and executable.

This particular PHP binary contains all of the necessary options to run inside of cpsrvd. However, if you experience linking issues or require additional features in the PHP binary that cpsrvd uses, you will need to build an additional local PHP binary. You can do this by running the following script:

/scripts/makecpphp

This script uses the EasyApache framework to build a PHP configuration that will work with cpsrvd. This PHP binary will exist as 1 of the following 2 files:

/var/cpanel/3rdparty/bin/php
/var/cpanel/3rdparty/bin/php-cgi

php-cgi is preferred over php if both are available and executable.

However, if /var/cpanel/usecpphp does not exist, 1 of the the following 2 PHP binaries will be used:

/usr/bin/php
/usr/bin/php-cgi

Reference: http://www.cpanel.net/

SBDavid

Cpanel Important PHP options

Cpanel Important PHP options

Most PHP options simply enable an extension that is shipped with PHP.

CGI — This option is enabled by default. Disabling this option will cause a PHP CLI binary to install in /usr/bin/php and /usr/local/bin/php. When no CGI binary is available, your server will be unable to serve PHP requests without DSO.

Concurrent DSO patch — By default, Apache is unable to load libphp4 and libphp5 simultaneously. This option applies a patch to PHP that versions objects in libphp4 and libphp5. This option will also create new Apache directives so that both PHP 4 and 5 can be communicated with separately.

This option is not required if you will serve both versions of PHP via SuPHP, CGI, or FCGID.

Important: Compiled PHP extensions other than those shipped with PHP will not function correctly with this patch enabled. Enabling this module may also render some PECL and PEAR modules nonfunctional. Do not use this module unless you must serve both PHP 4 and 5 as DSOs and can work around other issues it will case.

Reference: http://cpanel.net/

« Prev - Next »