PHP Server Health Wiki - birender/PHP-SERVER-HEALTH GitHub Wiki
PHP Server Health is a lightweight Linux server health monitoring and performance-tuning CLI tool written in pure PHP.
It helps PHP developers and Linux administrators quickly inspect the health of a production server and identify potential PHP-FPM, Apache, PHP, and system-level performance issues.
PHP Server Health brings several common server checks into a single command:
PHP Server Health
│
┌────────────────┼────────────────┐
│ │ │
▼ ▼ ▼
System PHP Services
│ │ │
┌────┼────┐ ┌────┴────┐ ┌────┴────┐
│ │ │ │ │ │ │
CPU RAM Disk PHP OPcache PHP-FPM Apache
│ │ │
└────┴────┘
│
▼
Health Analysis
│
▼
Performance TuningCPU information
CPU load
Memory usage
Swap usage
Disk usage
System uptime
Operating system information
Kernel information
PHP version
PHP configuration
PHP extensions
OPcache status
OPcache configuration
PHP-FPM service status
Worker configuration
Worker utilization
Average worker memory
Maximum worker memory
pm.max_childrenpm.start_serverspm.min_spare_serverspm.max_spare_servers
Apache service status
Apache version
Apache MPM
MaxRequestWorkersThreadsPerChildServerLimit
The tuning engine analyzes the server's:
CPU capacity
Available memory
PHP-FPM worker memory
PHP-FPM configuration
Apache configuration
and generates recommendations.
[!IMPORTANT]
PHP Server Health provides recommendations. It does not automatically modify your production configuration.
git clone https://github.com/birender/PHP-SERVER-HEALTH.git
cd PHP-SERVER-HEALTHMake the CLI executable:
chmod +x bin/php-server-healthRun:
./bin/php-server-healthIf the installation script is available:
sudo ./install.shThen:
php-server-healthRun the normal health check:
php-server-healthRun performance analysis:
sudo php-server-health --tuneDisplay help:
php-server-health --helpThe --tune command is one of the main features of PHP Server Health.
sudo php-server-health --tuneIt analyzes the relationship between:
CPU
│
├── CPU cores
│
└── Load
Memory
│
├── Available RAM
│
└── PHP-FPM Worker RSS
PHP-FPM
│
├── max_children
├── start_servers
├── min_spare_servers
└── max_spare_servers
Apache
│
├── MaxRequestWorkers
├── ThreadsPerChild
└── ServerLimit
The result is a set of recommended values that can be reviewed before applying changes.
PHP Server Health is designed to be a diagnostic tool.
The tuning engine should not directly overwrite production configuration files.
Before applying any recommendation:
Backup the configuration.
Review the recommended values.
Apply changes gradually.
Validate the configuration.
Reload the affected service.
Monitor the server.
Example:
sudo cp /etc/php/8.3/fpm/pool.d/www.conf
/etc/php/8.3/fpm/pool.d/www.conf.backupPHP Server Health is particularly useful for servers running:
Ubuntu / Debian
│
▼
Apache
│
▼
PHP-FPM
│
▼
PHP
│
▼
MySQLIt can help investigate problems such as:
High CPU
High RAM consumption
PHP-FPM worker saturation
Too few PHP-FPM workers
Too many PHP-FPM workers
Apache worker limitations
OPcache configuration issues
Low disk space
Swap pressure
Failed services
| Topic | Description |
|---|---|
| Installation | Installing PHP Server Health |
| Quick Start | Run your first health check |
| Commands | CLI commands and options |
| Server Health Checks | Understanding health checks |
| PHP-FPM Tuning | PHP-FPM analysis and tuning |
| Apache Tuning | Apache performance analysis |
| Configuration | Configuration options |
| Troubleshooting | Common problems |
| Development | Development environment |
| Contributing | How to contribute |
| Roadmap | Planned features |
PHP-SERVER-HEALTH/
│
├── bin/
│ └── php-server-health
│
├── config/
│
├── src/
│ ├── System/
│ ├── PHP/
│ ├── PHPFPM/
│ ├── Apache/
│ └── ...
│
├── systemd/
│
├── install.sh
├── composer.json
├── LICENSE
└── README.mdThe application is designed around independent health-check modules so that additional checks can be added without rewriting the entire application.
The long-term goal is to provide a practical command-line toolkit for PHP production environments.
Planned areas include:
MySQL health
Network health
TCP connections
Port monitoring
PHP-FPM statistics
Apache statistics
Historical metrics
Health scoring
JSON output
CI/CD integration
Alerting
Web dashboard
Contributions are welcome.
You can contribute by:
Reporting bugs
Improving documentation
Adding health checks
Improving Linux compatibility
Improving tuning algorithms
Adding tests
Improving performance
See the Contributing page for details.
GitHub Repository
https://github.com/birender/PHP-SERVER-HEALTH
Issues
https://github.com/birender/PHP-SERVER-HEALTH/issues
If PHP Server Health is useful to you:
⭐ Star the repository
🐛 Report bugs
💡 Suggest features
🤝 Contribute
# PHP Server HealthKnow your server before your server tells you there is a problem.
PHP Server Health is a lightweight Linux server health monitoring and performance-tuning CLI tool written in pure PHP.
It helps PHP developers and Linux administrators quickly inspect the health of a production server and identify potential PHP-FPM, Apache, PHP, and system-level performance issues.
PHP Server Health brings several common server checks into a single command:
PHP Server Health
│
┌────────────────┼────────────────┐
│ │ │
▼ ▼ ▼
System PHP Services
│ │ │
┌────┼────┐ ┌────┴────┐ ┌────┴────┐
│ │ │ │ │ │ │
CPU RAM Disk PHP OPcache PHP-FPM Apache
│ │ │
└────┴────┘
│
▼
Health Analysis
│
▼
Performance Tuning
- CPU information
- CPU load
- Memory usage
- Swap usage
- Disk usage
- System uptime
- Operating system information
- Kernel information
- PHP version
- PHP configuration
- PHP extensions
- OPcache status
- OPcache configuration
- PHP-FPM service status
- Worker configuration
- Worker utilization
- Average worker memory
- Maximum worker memory
pm.max_childrenpm.start_serverspm.min_spare_serverspm.max_spare_servers
- Apache service status
- Apache version
- Apache MPM
MaxRequestWorkersThreadsPerChildServerLimit
The tuning engine analyzes the server's:
- CPU capacity
- Available memory
- PHP-FPM worker memory
- PHP-FPM configuration
- Apache configuration
and generates recommendations.
Important
PHP Server Health provides recommendations. It does not automatically modify your production configuration.
git clone https://github.com/birender/PHP-SERVER-HEALTH.git
cd PHP-SERVER-HEALTHMake the CLI executable:
chmod +x bin/php-server-healthRun:
./bin/php-server-healthIf the installation script is available:
sudo ./install.shThen:
php-server-healthRun the normal health check:
php-server-healthRun performance analysis:
sudo php-server-health --tuneDisplay help:
php-server-health --helpThe --tune command is one of the main features of PHP Server Health.
sudo php-server-health --tuneIt analyzes the relationship between:
CPU
│
├── CPU cores
│
└── Load
Memory
│
├── Available RAM
│
└── PHP-FPM Worker RSS
PHP-FPM
│
├── max_children
├── start_servers
├── min_spare_servers
└── max_spare_servers
Apache
│
├── MaxRequestWorkers
├── ThreadsPerChild
└── ServerLimit
The result is a set of recommended values that can be reviewed before applying changes.
PHP Server Health is designed to be a diagnostic tool.
The tuning engine should not directly overwrite production configuration files.
Before applying any recommendation:
- Backup the configuration.
- Review the recommended values.
- Apply changes gradually.
- Validate the configuration.
- Reload the affected service.
- Monitor the server.
Example:
sudo cp /etc/php/8.3/fpm/pool.d/www.conf \
/etc/php/8.3/fpm/pool.d/www.conf.backupPHP Server Health is particularly useful for servers running:
Ubuntu / Debian
│
▼
Apache
│
▼
PHP-FPM
│
▼
PHP
│
▼
MySQL
It can help investigate problems such as:
- High CPU
- High RAM consumption
- PHP-FPM worker saturation
- Too few PHP-FPM workers
- Too many PHP-FPM workers
- Apache worker limitations
- OPcache configuration issues
- Low disk space
- Swap pressure
- Failed services
| Topic | Description |
|---|---|
| [Installation](Installation) | Installing PHP Server Health |
| [Quick Start](Quick-Start) | Run your first health check |
| [Commands](Commands) | CLI commands and options |
| [Server Health Checks](Server-Health-Checks) | Understanding health checks |
| [PHP-FPM Tuning](PHP-FPM-Tuning) | PHP-FPM analysis and tuning |
| [Apache Tuning](Apache-Tuning) | Apache performance analysis |
| [Configuration](Configuration) | Configuration options |
| [Troubleshooting](Troubleshooting) | Common problems |
| [Development](Development) | Development environment |
| [Contributing](Contributing) | How to contribute |
| [Roadmap](Roadmap) | Planned features |
PHP-SERVER-HEALTH/
│
├── bin/
│ └── php-server-health
│
├── config/
│
├── src/
│ ├── System/
│ ├── PHP/
│ ├── PHPFPM/
│ ├── Apache/
│ └── ...
│
├── systemd/
│
├── install.sh
├── composer.json
├── LICENSE
└── README.md
The application is designed around independent health-check modules so that additional checks can be added without rewriting the entire application.
The long-term goal is to provide a practical command-line toolkit for PHP production environments.
Planned areas include:
- MySQL health
- Network health
- TCP connections
- Port monitoring
- PHP-FPM statistics
- Apache statistics
- Historical metrics
- Health scoring
- JSON output
- CI/CD integration
- Alerting
- Web dashboard
Contributions are welcome.
You can contribute by:
- Reporting bugs
- Improving documentation
- Adding health checks
- Improving Linux compatibility
- Improving tuning algorithms
- Adding tests
- Improving performance
See the [Contributing](Contributing) page for details.
GitHub Repository
https://github.com/birender/PHP-SERVER-HEALTH
Issues
https://github.com/birender/PHP-SERVER-HEALTH/issues
If PHP Server Health is useful to you:
⭐ Star the repository
🐛 Report bugs
💡 Suggest features
🤝 Contribute
Know your server before your server tells you there is a problem.``