PHP code example of philiprehberger / php-install-doctor
1. Go to this page and download the library: Download philiprehberger/php-install-doctor library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
philiprehberger / php-install-doctor example snippets
use PhilipRehberger\InstallDoctor\Doctor;
$report = Doctor::diagnose();
if ($report->isHealthy()) {
echo "All checks passed!\n";
} else {
echo $report->toConsoleOutput();
}
use PhilipRehberger\InstallDoctor\Doctor;
use PhilipRehberger\InstallDoctor\Checks\PhpVersionCheck;
use PhilipRehberger\InstallDoctor\Checks\ExtensionCheck;
use PhilipRehberger\InstallDoctor\Checks\MemoryLimitCheck;
use PhilipRehberger\InstallDoctor\Checks\DirectoryWritableCheck;
$report = Doctor::check(
new PhpVersionCheck('8.2.0'),
new ExtensionCheck(['pdo', 'redis', 'imagick']),
new MemoryLimitCheck(256),
new DirectoryWritableCheck(['/tmp', '/var/log']),
);
echo $report->toConsoleOutput();