Archive for the 'cPanel Support' Category

SBDavid

update_php_mime_types Examples

update_php_mime_types Examples

update_php_mime_types –verbose

Update all user .htaccess files that already contain PHP MIME mappings.

update_php_mime_types –user=buddy –force=4 –verbose

Set buddy’s main .htaccess file to use PHP 4 by default.

update_php_mime_types –user=buddy –strip –verbose

Remove all PHP AddHandler lines and marker comments from buddy’s .htaccess files.

Reference: http://cpanel.net/

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/

« Prev - Next »