Skip to content

Instantly share code, notes, and snippets.

@anushshukla
Created June 6, 2019 06:25
Show Gist options
  • Select an option

  • Save anushshukla/58cce71cf0e71866c2b271fddb5e44a7 to your computer and use it in GitHub Desktop.

Select an option

Save anushshukla/58cce71cf0e71866c2b271fddb5e44a7 to your computer and use it in GitHub Desktop.
PHP Requirements (Extension & Modules - Installed and Enable Status)
<?php
$apache_modules = apache_get_modules();
$required_modules = ["mod_rewrite","mod_macro","mod_ssl"];
$modules = $apache_modules + $required_modules;
$loaded_extensions = get_loaded_extensions();
$required_extensions = ["ctype","curl","date","dom","gd","fileinfo","json","mycrypt","PDO","Reflection","SimpleXML","xdebug","xml"];
$extensions = $loaded_extensions+$required_extensions;
?>
<!DOCTYPE html>
<html>
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<title></title>
</head>
<body>
<main>
<h2>Apache v<?=apache_get_version()?> Web Server</h2>
<table class="table">
<thead>
<tr>
<th>Module</th>
<th>Installed & Enabled</th>
<th>Required</th>
</tr>
</thead>
<tbody>
<?php foreach($modules as $module) : ?>
<tr>
<td><?=$module?></td>
<td><?=in_array('mod_rewrite',$apache_modules) ? "Yes" : "No"?></td>
<td><?=in_array($module,$required_modules) ? "Yes" : "No"?></td>
</tr>
<?php endforeach; ?>
</tbody>
<tfoot>
<tr>
<th>Module</th>
<th>Installed & Enabled</th>
<th>Required</th>
</tr>
</tfoot>
</table>
<hr>
<h2>PHP v<?=phpversion()?> Scripting Language</h2>
<table class="table">
<thead>
<tr>
<th>Extensions</th>
<th>Installed & Enabled</th>
<th>Required</th>
</tr>
</thead>
<tbody>
<?php foreach($extensions as $extension) : ?>
<tr>
<td><?=$extension?></td>
<td><?=extension_loaded($extension) ? "Yes" : "No"?></td>
<td><?=in_array($extension,$required_extensions) ? "Yes" : "No"?></td>
</tr>
<?php endforeach; ?>
</tbody>
<tfoot>
<tr>
<th>Extension / Module</th>
<th>Installed & Enabled</th>
<th>Required</th>
</tr>
</tfoot>
</table>
</main>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment