3 * COPS (Calibre OPDS PHP Server) Configuration check
5 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author Sébastien Lucas <sebastien@slucas.fr>
10 require_once ("config.php");
11 require_once ("base.php");
13 header ("Content-Type:text/html; charset=UTF-8");
15 $err = getURLParam ("err", -1);
19 $error = "Database error";
25 <html xmlns="http://www.w3.org/1999/xhtml">
27 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
28 <title>COPS Configuration Check</title>
29 <link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion(getCurrentCss ()) ?>" media="screen" />
32 <div class="container">
34 <div class="headcenter">
35 <h1>COPS Configuration Check</h1>
38 <div id="content" style="display: none;"></div>
41 if (!is_null ($error)) {
43 <article class="frontpage">
44 <h2>You've been redirected because COPS is not configured properly</h2>
45 <h4><?php echo $error ?></h4>
50 <article class="frontpage">
51 <h2>Check if GD is properly installed and loaded</h2>
54 if (extension_loaded('gd') && function_exists('gd_info')) {
57 echo "Please install the php5-gd extension and make sure it's enabled";
62 <article class="frontpage">
63 <h2>Check if MySQL is properly installed and loaded</h2>
66 if (extension_loaded('pdo_mysql')) {
69 echo "Please install the php5-mysql extension and make sure it's enabled";
74 <article class="frontpage">
75 <h2>Check if libxml is properly installed and loaded</h2>
78 if (extension_loaded('libxml')) {
81 echo "Please make sure libxml is enabled";
86 <article class="frontpage">
87 <h2>Check if database can be opened with PHP</h2>
91 $db = new PDO('mysql:'. Base::getDbHost (), Base::getDbUser(), Base::getDbPasswd());
93 } catch (Exception $e) {
94 echo "If the database is readable, check your php configuration. Exception detail : " . $e;