-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
104 lines (103 loc) · 2.73 KB
/
index.php
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>I am an example.</title>
<style type="text/css">
body{
font-family: "Lucida Console", Monaco, monospace;
font-size: 20px;
}
.error{
color: #e50000;
}
.success{
color: #33cc00;
}
.style-ok{
display: none;
}
</style>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<div><img src="img/logo.png" alt="VagrantEasy Logo" /></div>
<h1>VagrantEasy Example LAMP App</h1>
<h3>Testing LAMP</h3>
<ul>
<li>
<strong>Linux</strong>
<ul>
<li>Version.......... <?php
try {
echo '<span class="success">' . php_uname() . '</span>';
} catch(Exception $e) {
echo '<span class="error">FAIL: ' . $e->getMessage() . '</span>';
}
?></li>
</ul>
</li>
<li>
<strong>Apache</strong>
<ul>
<li>Version.......... <?php
try {
echo '<span class="success">' . apache_get_version() . '</span>';
} catch(Exception $e) {
echo '<span class="error">FAIL: ' . $e->getMessage() . '</span>';
}
?></li>
</ul>
</li>
<li>
<strong>MySQL</strong>
<ul>
<li>Version.......... <?php
$servername = "localhost";
$username = "example_user";
$password = "example_pass";
$link = mysql_connect($servername, $username, $password);
if (!$link){
echo '<span class="error">ERROR</span>';
}else{
echo '<span class="success">' . mysql_get_server_info() . '</span>';
mysql_close($link);
}
?></li>
<li>Connecting.......... <?php
try {
$conn = new PDO("mysql:host=$servername;dbname=example_db", $username, $password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo '<span class="success">OK</span>';
} catch(PDOException $e) {
echo '<span class="error">FAIL: ' . $e->getMessage() . '</span>';
}
?></li>
</ul>
</li>
<li>
<strong>PHP</strong>
<ul>
<li>Version.......... <?php echo '<span class="success">' . phpversion() . '</span>'; ?></li>
</ul>
</li>
</ul>
<h3>Testing Client Access</h3>
<ul>
<li>
<strong>CSS</strong>
<ul>
<li>Loading.......... <span class="success style-ok">OK</span><span class="error style-fail">FAIL</span></li>
</ul>
</li>
<li>
<strong>JavaScript</strong>
<ul>
<li>Loading.......... <span id="scriptSpan" class="error">FAIL</span></li>
</ul>
</li>
</ul>
<script type="text/javascript" src="js/script.js"></script>
</body>
</html>