Created
November 29, 2017 15:02
-
-
Save hirnsturm/3e5b94e5632dcc24aae6ae619ebbf098 to your computer and use it in GitHub Desktop.
Which php extensions are installed?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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