Building a PHP Extension
CloudPanel v1 is obsolete
CloudPanel v1 is obsolete; check out the CloudPanel v2 Docs.
On this site, you find a step-by-step guide on how to build a PHP Extension for a specific PHP Version.
Building a PHP Extension
Make a backup of your server.
Install the dev package for the PHP Version.
- Go to https://pecl.php.net/ and search for the extension like ssh2:
- Download the tgz via cURL:
- Extract the tgz:
- phpize the extension:
- Compile and build the extension:
- Register the extension for CLI and FPM in the php.ini:
CLI
Add the following line at the end:
FPM
Add the following line at the end:
- Restart the PHP-FPM service:
Testing
After registering the PHP Extension, you can check if the extension is loaded for CLI and FPM correctly.
CLI
You can use grep to check if the extension is loaded:
If you don't get an output, then the extension is NOT loaded.
FPM
To check if the extension is loaded for FPM, you can check the phpinfo.
Create the file t.php in the root directory.
Put the following content in the file:
- Open t.php in your browser and search for the extension.
If you don't find information about the extension, then it's NOT loaded.