-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
77 lines (71 loc) · 3.06 KB
/
Copy pathtest.php
File metadata and controls
77 lines (71 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
// DevStackBox - Test Page
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test Page - DevStackBox</title>
<style>
body { font-family: Arial, sans-serif; margin: 40px; background: #f4f4f4; }
.container { background: white; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.test-section { margin: 20px 0; padding: 15px; border: 1px solid #ddd; border-radius: 4px; }
.success { background: #e8f5e8; border-color: #4caf50; }
.error { background: #ffe8e8; border-color: #f44336; }
.back-link { display: inline-block; margin-bottom: 20px; padding: 8px 16px; background: #007cba; color: white; text-decoration: none; border-radius: 4px; }
.back-link:hover { background: #005a87; }
</style>
</head>
<body>
<div class="container">
<a href="index.php" class="back-link">← Back to Home</a>
<h1>🧪 DevStackBox Test Page</h1>
<div class="test-section success">
<h3>✅ PHP is working!</h3>
<p>Current time: <?php echo date('Y-m-d H:i:s'); ?></p>
<p>PHP Version: <?php echo PHP_VERSION; ?></p>
</div>
<div class="test-section">
<h3>📊 PHP Extensions</h3>
<p>Loaded extensions: <?php echo count(get_loaded_extensions()); ?></p>
<p>Available extensions: <?php echo implode(', ', array_slice(get_loaded_extensions(), 0, 10)); ?>...</p>
</div>
<div class="test-section">
<h3>🗄️ MySQL Connection Test</h3>
<?php
if (extension_loaded('mysqli')) {
echo '<p class="success">✅ MySQLi extension is loaded</p>';
// Try to connect to MySQL
$connection = @mysqli_connect('localhost', 'root', '', '', 3306);
if ($connection) {
echo '<p class="success">✅ MySQL connection successful!</p>';
mysqli_close($connection);
} else {
echo '<p class="error">❌ MySQL connection failed: ' . mysqli_connect_error() . '</p>';
}
} else {
echo '<p class="error">❌ MySQLi extension not loaded</p>';
}
?>
</div>
<div class="test-section">
<h3>📁 File System Test</h3>
<?php
$test_file = 'test_write.txt';
if (is_writable('.')) {
file_put_contents($test_file, 'DevStackBox test file - ' . date('Y-m-d H:i:s'));
if (file_exists($test_file)) {
echo '<p class="success">✅ File write test successful</p>';
unlink($test_file);
} else {
echo '<p class="error">❌ File write test failed</p>';
}
} else {
echo '<p class="error">❌ Directory not writable</p>';
}
?>
</div>
</div>
</body>
</html>