Debugging help

- Mention the PHP error log on the setup & debug pages.
- Restructure the debug page to include the server info before the db structure table
This commit is contained in:
Marcus Hill 2024-05-04 21:02:33 +01:00
parent c0fc957617
commit cd668241a6
2 changed files with 49 additions and 50 deletions

View File

@ -185,11 +185,12 @@ while ($row = $tablesResult->fetch_row()) {
//Get loaded PHP modules //Get loaded PHP modules
$loadedModules = get_loaded_extensions(); $loadedModules = get_loaded_extensions();
//Get Versions //Get Server Info / Service versions
$phpVersion = phpversion(); $phpVersion = phpversion();
$mysqlVersion = $mysqli->server_version; $mysqlVersion = $mysqli->server_version;
$operatingSystem = shell_exec('uname -a'); $operatingSystem = php_uname();
$webServer = $_SERVER['SERVER_SOFTWARE']; $webServer = $_SERVER['SERVER_SOFTWARE'];
$errorLog = ini_get('error_log');
?> ?>
@ -199,10 +200,33 @@ $webServer = $_SERVER['SERVER_SOFTWARE'];
</div> </div>
<div class="card-body"> <div class="card-body">
<h3>Database Structure Check</h3> <h3>Server Info</h3>
<?php
echo "PHP version: " . $phpVersion . "<br>";
echo "MySQL Version: " . $mysqlVersion . "<br>";
echo "Operating System: " . $operatingSystem . "<br>";
echo "Web Server: " . $webServer . "<br>";
echo "PHP Error Log: " . $errorLog
?>
<hr> <hr>
<h3>File System</h3>
<?php
$result = countFilesInDirectory($folderPath);
$totalFiles = $result['count'];
$totalSizeMB = round($result['size'] / (1024 * 1024), 2);
echo "Total number of files in $folderPath and its subdirectories: " . $totalFiles . "<br>";
echo "Total size of files in $folderPath and its subdirectories: " . $totalSizeMB . " MB";
?>
<hr>
<h3>Database Structure Check</h3>
<h4>Database stats</h4> <h4>Database stats</h4>
<?php <?php
@ -255,32 +279,6 @@ $webServer = $_SERVER['SERVER_SOFTWARE'];
<hr> <hr>
<h3>Versions</h3>
<?php
echo "PHP version: " . $phpVersion . "<br>";
echo "MySQL Version: " . $mysqlVersion . "<br>";
echo "Operating System: " . $operatingSystem . "<br>";
echo "Web Server: " . $webServer;
?>
<hr>
<h3>File System</h3>
<?php
$result = countFilesInDirectory($folderPath);
$totalFiles = $result['count'];
$totalSizeMB = round($result['size'] / (1024 * 1024), 2);
echo "Total number of files in $folderPath and its subdirectories: " . $totalFiles . "<br>";
echo "Total size of files in $folderPath and its subdirectories: " . $totalSizeMB . " MB";
?>
<hr>
<h3>PHP Modules Installed</h3> <h3>PHP Modules Installed</h3>
<?php <?php

View File

@ -843,8 +843,9 @@ if (isset($_POST['add_telemetry'])) {
<ul> <ul>
<li>Please take a look over the install <a href="https://docs.itflow.org/installation">docs</a>, if you haven't already</li> <li>Please take a look over the install <a href="https://docs.itflow.org/installation">docs</a>, if you haven't already</li>
<li>Don't hesitate to reach out on the <a href="https://forum.itflow.org/t/support" target="_blank">forums</a> if you need any assistance</li> <li>Don't hesitate to reach out on the <a href="https://forum.itflow.org/t/support" target="_blank">forums</a> if you need any assistance</li>
<li><i>Your PHP Error log is at: <?php echo ini_get('error_log') ?></i></li>
</ul> </ul>
<br><p>A database must be created before proceeding - click on the button below to get started</p> <br><p>A database must be created before proceeding - click on the button below to get started.</p>
<br><hr> <br><hr>
<p class="text-muted">ITFlow is <b>free software</b>: you can redistribute and/or modify it under the terms of the <a href="https://www.gnu.org/licenses/gpl-3.0.en.html" target="_blank">GNU General Public License</a>. <br> It is distributed in the hope that it will be useful, but <b>without any warranty</b>; without even the implied warranty of merchantability or fitness for a particular purpose.</p> <p class="text-muted">ITFlow is <b>free software</b>: you can redistribute and/or modify it under the terms of the <a href="https://www.gnu.org/licenses/gpl-3.0.en.html" target="_blank">GNU General Public License</a>. <br> It is distributed in the hope that it will be useful, but <b>without any warranty</b>; without even the implied warranty of merchantability or fitness for a particular purpose.</p>
<?php <?php