1

I am building a Probe for Faveo helpdesk which is an open source ticket system to manage customer support in real time and is developed using laravel framework for PHP.

The aim of the probe is to check minimum server requirements which are required to install and run Faveo on the server. To run Faveo the redirection module(eg. 'mod_rewrite' in Apache server) for URL's must be enabled on server. I have to check is this module is enabled or not on different servers like Nigix, Apache and IIS.

Currently I am able to check 'mod_rewrite' on Apache server which uses Apache handler using php function "apache_get_modules". But this is not working on the servers which uses handles other than Apache handler to run php (for example CGI/FCGI/suPHP).

Can anyone tell me how can I check the 'mod_rewrite' module of the server irrespective of the handler they use to run PHP? Also how can I check the same on different servers like NIGIX and IIS?

Manish Verma
  • 469
  • 7
  • 17
  • Possible duplicate: http://stackoverflow.com/questions/9021425/how-to-check-if-mod-rewrite-is-enabled-in-php – MrWhite Mar 03 '16 at 12:06

1 Answers1

1

Nginx nor IIS provide any way of checking this, this is because in both cases, PHP runs as Fast-CGI and have no knowledge of what is terminating the http connection.

Nginx fundamentally has to have it's "rewrite module" to perform basic things (try_files is a part of the ngx_http_core module). On Laravel the configuration in nginx is very simple to make "pretty urls":

server {
    listen 80;

    root /var/www/public;

    try_files $uri /index.php$is_args$args;

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass   unix:/var/run/php/php7.0-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_index index.php;
        fastcgi_keep_conn on;
    }
}

On Windows w/IIS there's no way to determine if the Rewrite module is installed (at least not to my knowledge), here you'll probably just have to document the fact that IIS requires a special module for it to work: https://www.iis.net/downloads/microsoft/url-rewrite

Thor Erik
  • 145
  • 7