Download the PHP package tourze/php-startup-parameter-optimization without Composer
On this page you can find all versions of the php package tourze/php-startup-parameter-optimization. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tourze/php-startup-parameter-optimization
More information about tourze/php-startup-parameter-optimization
Files in tourze/php-startup-parameter-optimization
Package php-startup-parameter-optimization
Short Description PHP startup parameter optimization for OPcache and JIT configuration
License MIT
Informations about the package php-startup-parameter-optimization
PHP Startup Parameter Optimization
δΈζ
A PHP library that provides optimized startup parameters for OPcache and JIT configuration to improve performance.
Features
- π Automatic Detection: Detects OPcache and JIT support automatically
- β‘ Performance Optimization: Provides optimized parameters for better performance
- π§ Flexible Configuration: Customizable OPcache and JIT settings
- π Status Reporting: Get detailed information about optimization support
- =οΏ½ Safe Fallbacks: Gracefully handles unsupported environments
Requirements
- PHP 8.0 or higher
- OPcache extension (recommended for JIT)
Installation
Usage
Basic Usage
Command Line Usage
Custom Configuration
Status Information
Default Parameters
OPcache Parameters
When OPcache is supported, the following parameters are applied:
opcache.enable_cli=1- Enable OPcache in CLI modeopcache.max_accelerated_files=50000- Maximum number of accelerated filesopcache.memory_consumption=256- OPcache memory consumption in MBopcache.interned_strings_buffer=16- Interned strings buffer in MBopcache.fast_shutdown=1- Enable fast shutdownopcache.validate_timestamps=0- Disable timestamp validation for production
JIT Parameters
When JIT is supported (PHP 8.0+), the following parameters are applied:
opcache.jit=tracing- Use tracing JIT modeopcache.jit_buffer_size=100M- JIT buffer size (default)opcache.jit_hot_loop=64- Hot loop thresholdopcache.jit_hot_func=127- Hot function thresholdopcache.jit_hot_return=127- Hot return thresholdopcache.jit_hot_side_exit=127- Hot side exit threshold
Configuration Constants
You can customize default values by extending the PhpOptimizer class:
Performance Tips
- Production Environment: Always disable
opcache.validate_timestampsin production - Memory Allocation: Adjust
opcache.memory_consumptionbased on your application size - JIT Buffer: Increase
opcache.jit_buffer_sizefor larger applications - File Count: Set
opcache.max_accelerated_fileshigher than your total file count
Troubleshooting
Common Issues
-
JIT not available
- Ensure PHP 8.0 or higher
- Check if OPcache extension is loaded
- Verify PHP was compiled with JIT support
-
OPcache not working
- Install and enable OPcache extension
- Check PHP configuration:
php -m | grep OPcache
- Performance degradation
- Monitor OPcache statistics with
opcache_get_status() - Adjust memory settings if cache is full
- Monitor OPcache statistics with
Debug Information
Testing
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This library is released under the MIT License. See the LICENSE file for details.
Changelog
Please see CHANGELOG.md for more information on what has changed recently.
All versions of php-startup-parameter-optimization with dependencies
composer-runtime-api Version ^2.0