Created
July 1, 2022 19:41
-
-
Save alphaolomi/a9434636850e5cf4a1ac9a177cc1c0f0 to your computer and use it in GitHub Desktop.
Check all required PHP extension for Laravel
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 | |
// OpenSSL PHP Extension | |
// PDO PHP Extension | |
// Mbstring PHP Extension | |
// Tokenizer PHP Extension | |
// XML PHP Extension | |
// SQLite PHP Extension (for SQLite3 support) | |
$extensionsList = [ | |
'openssl', | |
'pdo', | |
'mbstring', | |
'tokenizer', | |
'xml', | |
'sqlite', | |
]; | |
echo "\n\nChecking PHP Extensions...\n" . PHP_EOL; | |
foreach ($extensionsList as $extension) { | |
// Check if the extension is loaded | |
if (extension_loaded($extension)) { | |
echo "\033[32m" . $extension . " is loaded\033[0m\n"; | |
} else { | |
echo "\033[31m" . $extension . " is not loaded\033[0m\n"; | |
} | |
} | |
// For linux: To install Use `sudo apt install openssl php-common php-curl php-json php-mbstring php-mysql php-xml php-zip` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment