GithubHelp home page GithubHelp logo

TileServer-php checker about tileserver-php HOT 2 OPEN

maptiler avatar maptiler commented on September 10, 2024
TileServer-php checker

from tileserver-php.

Comments (2)

daliborjanak avatar daliborjanak commented on September 10, 2024

First draft:

<?php
$msg = array();
//php version
$version = phpversion();
if (strpos($version, '-') != FALSE) {
  $version = substr($version, 0, strpos($version, '-'));
}
$versionParts = explode('.', $version);
if ($versionParts[0] >= 5 && $versionParts[1] >= 2) {
  $msg[] = array('status' => 'success', 'message' => 'Your PHP version ' . $version . ' is supported!');
} else {
  $msg[] = array('status' => 'warning', 'message' => 'Your PHP version ' . $version . ' is NOT supported!');
}
//mod rewrite
$isModRewrite = false;
if (function_exists('apache_get_modules')) {
  $modules = apache_get_modules();
  if (in_array('mod_rewrite', $modules)) {
    $isModRewrite = true;
  }
} else {
  //check with getenv
  if (getenv('HTTP_MOD_REWRITE') == 'On') {
    $isModRewrite = true;
  }
}
//TODO: Htaccess??
if ($isModRewrite) {
  $msg[] = array('status' => 'success', 'message' => 'Mod_rewrite module is enabled!');
} else {
  $msg[] = array('status' => 'warning', 'message' => 'Mod_rewrite module is disabled!');
}
?>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>TileServer-PHP Checker</title>
    <style>
      ul{list-style-type: none;}
      li.success{color: green;}
      li.warning{color:red}
    </style>
  </head>
  <body>
    <h1>TileServer-PHP Checker</h1>
    <ul>
      <?php
      //print
      foreach ($msg as $message) {
        echo '<li class="' . $message['status'] . '">' . $message['message'] . '<li>';
      }
      ?>
    </ul>
  </body>
</html>

from tileserver-php.

daliborjanak avatar daliborjanak commented on September 10, 2024

Reported problem with PHP 7 check in #121

from tileserver-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.