The standard term for a PHP configuration file is php.ini. However, DreamHost uses the term phprc file instead. This acts the same way – only the name is different. In this article, only the term phprc is used.
Loaders and Extensions
PHP Loaders are extensions to PHP which load special types of PHP files that have been encoded with an encoding product such as ionCube Loader.
To activate the loader, you must add a line to your phprc file. Below are links to pages that provide further instructions on installing and using the various PHP loaders:
The XML-RPC extension is no longer supported and has been removed from PHP versions 8.0 and above. Adding extension=xmlrpc.so to the phprc file will no longer work.
PHP Extensions are libraries of pre-built code. They allow you to use specific functions already created to simplify your code. The following is a current list of PHP Extensions:
Some extensions are already activated by default (such as Phar). Others are not, but can be activated by adding a line to your phprc file.
Checking if an Extension is already active
Before adding an extension, make sure it's not already activated by default. For example, the Phar extension is already activated with any version of PHP at DreamHost. If you then add the phar.so extension to your phprc file, your site will throw an error, so it's important to only add an extension if needed.
You can view any active extension by adding a phpinfo.php file to your site.
If an extension is active, you'll see its corresponding block when visiting the phpinfo.php file. For example, search for the word Phar, and you should see Phar: PHP Archive support and enabled.
Adding an extension
Step 1 — Create a phprc file
View the following articles for instructions on how to create a phprc file:
If the file already exists, view the following articles for instructions on how to update it (depending on if you're using an FTP client or SSH):
Step 2 — Load the extension
To load an extension, add the following line your phprc file (make sure to change extension_name to the actual extension.):
extension = extension_name.so
Step 3 — Kill off all running php processes
Make sure to kill running php processes to ensure your new settings take effect.
Step 4 — Confirming your changes
After you've edited the file and killed off all PHP processes, check to confirm the extension has been enabled. You can do this by creating a phpinfo.php file. When you view this file in a browser, you should see the extension listed.
If you do not see your changes have updated, try killing off your PHP processes again:
Compiling PHP extensions
Some extensions are not complied with PHP. In these instances, you must download the extension and compile it manually.
Visit the following links for a list of available extensions:
If any installation requires sudo privileges, you must upgrade to a Dedicated Server.
If any installation requires you to run phpize, just specify the full path to your desired version of PHP. This command can be run in any directory. For example, for PHP 8.2 run the following:
[server]$ php /usr/local/php82/bin/phpize
Support for the WebP image format is available via GD, which is activated by default on DreamHost servers.