PHP extensions in applications
PHP extensions in applications
Overview
PHP extensions are additional PHP modules that extend the functionality of your application. The platform provides a simple interface to enable and disable extensions, automatically installing them during the deployment process.
Available extensions
The platform supports 27 PHP extensions that can be enabled or disabled as needed:
- bcmath - Arbitrary precision mathematics
- bz2 - Bzip2 compression
- calendar - Calendar conversion functions
- exif - EXIF image metadata
- excimer - CPU usage profiling
- gd - Image processing
- gettext - Internationalization support
- gmp - GNU multiple precision arithmetic
- imap - IMAP email functions
- imagick - ImageMagick image processing
- intl - Internationalization functions
- ldap - LDAP directory access
- mbstring - Multibyte string handling
- memcached - Memcached caching
- mongodb - MongoDB database support
- opcache - Bytecode caching
- pcntl - Process control
- pgsql - PostgreSQL database support
- redis - Redis caching
- soap - SOAP web services
- sockets - Socket communication
- sqlite3 - SQLite database support
- tidy - HTML cleanup
- xml - XML processing
- xmlrpc - XML-RPC support
- xsl - XSL transformations
- zip - ZIP archive handling
Default extensions
When you create a new application, these extensions are automatically enabled:
- zip - For handling ZIP archives
- intl - For internationalization support
- mbstring - For multibyte string operations
- xml - For XML processing
Enabling and disabling extensions
Through the settings interface
- Navigate to your application's settings tab
- Scroll to the "PHP extensions" section
- Use the checkboxes to select or deselect extensions
- Click "Save changes" to apply your configuration
- Deploy your application for the changes to take effect
Bulk selection options
- Select all - Enable all available extensions
- Deselect all - Disable all extensions
- Show more/less - Expand or collapse the extension list for easier management
How extensions are installed
During the deployment process, PHP extensions are installed using the install-php-extensions tool. This happens automatically in the build process:
- The platform generates a container configuration for your application
- Extensions are installed as root user before switching to the web server user
- All selected extensions are installed in a single command for efficiency
- The installation happens before your application code is copied into the container
Detecting missing extensions
The platform automatically detects when your application requires extensions that aren't enabled:
During build process
When your application's dependencies require extensions that aren't enabled, the build process will:
- Analyze composer error messages for "requires ext-" patterns
- Extract the specific extension names from error logs
- Generate clear recommendations for which extensions to enable
Error messages
If a required extension is missing, you'll see:
- Build failure notifications in the deployment logs
- Specific error messages identifying the missing extension
- Recommendations to enable the extension in settings
Automatic detection examples
The system can detect missing extensions from these types of error messages:
- Composer dependency errors: "requires ext-gd"
- Build log analysis showing missing extension requirements
- Application startup failures due to missing extensions
Recommendations system
When missing extensions are detected, the platform provides helpful recommendations:
Recommendation: Enable the [extension name] extension in settings > PHP extensions
Multiple missing extensions are combined into a single recommendation for easier resolution.
Important notes
- Deployment required: Changing PHP extensions requires a new deployment to take effect
- Build time: Extensions are installed during the build process, which may slightly increase build time
- WordPress applications: WordPress applications automatically receive the mysqli and imagick extensions
- Performance: Only enable extensions that your application actually uses to minimize resource usage
Troubleshooting
Build failures
If your deployment fails due to missing extensions:
- Check the deployment logs for error messages
- Look for "requires ext-" patterns in the error output
- Enable the required extensions in settings
- Redeploy your application
Common issues
- Image processing: Enable gd or imagick for image manipulation
- Database connections: Enable pgsql for PostgreSQL or mongodb for MongoDB
- Caching: Enable redis or memcached for caching solutions
- Internationalization: Enable intl for locale-specific functions
Getting help
If you encounter issues with PHP extensions:
- Review the build logs in your application's deployment history
- Check the debug information for specific extension recommendations
- Ensure all required extensions are enabled before deploying
The platform's automated detection system will guide you toward the correct extensions needed for your application to run successfully.