Skip to content

Instantly share code, notes, and snippets.

@hirnsturm
Created November 29, 2017 15:02
Show Gist options
  • Save hirnsturm/3e5b94e5632dcc24aae6ae619ebbf098 to your computer and use it in GitHub Desktop.
Save hirnsturm/3e5b94e5632dcc24aae6ae619ebbf098 to your computer and use it in GitHub Desktop.
Which php extensions are installed?
<?php
/**
* This script checks whether given php extensions on the current system exists.
*
* @author Steve Lenz <[email protected]>
*/
/** @var array $extensions List of extensions to be tested */
$extensions = [
'fileinfo',
'filter',
'hash',
'openssl',
'pcre',
'session',
'SPL',
'standard',
'zip',
'zlib',
'json',
'mysqli',
'cgi',
'cli',
'curl',
'mbstring',
'soap',
'apcu',
'fpm',
'bcmath',
'gmp',
'xml',
'gd',
];
print(PHP_EOL . 'Check needed php extensions:' . PHP_EOL . PHP_EOL);
foreach ($extensions as $ext) {
if (!extension_loaded($ext)) {
print("\033[1;31m" . '[MISSING] ' . $ext . "\033[0m");
} else {
print("\033[0;32m" . '[OK] ' . $ext . "\033[0m");
}
print(PHP_EOL);
}
print(PHP_EOL);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment