"File not found." after switching to FPM and PHP 7.0

(Larsen) #1


I have a system with Debian Stretch that is running Nagios 3.5.1 and PNP 0.6.26. This used to work with PHP 5.6.33 (old packages from the former Jessie installation) and mod_php.

After switching to FPM instead of mod_php and using PHP 7.0, I can access the PNP graphs when I use an URL like this:

But when I enter something in the search field and open the result, this opens the following URL (notice the missing “index.php”) and I only get “File not found.”

Apache-Configuration should be the standard one that PNP delivers:

Alias /pnp4nagios "/usr/local/pnp4nagios/share"

<Directory "/usr/local/pnp4nagios/share">
    AllowOverride None
    Order allow,deny
    Allow from all
    # Use the same value as defined in nagios.conf
    AuthName "Nagios Access"
    AuthType Basic
    AuthUserFile /etc/nagios3/htpasswd.users
    Require valid-user
    <IfModule mod_rewrite.c>
        # Turn on URL rewriting
        RewriteEngine On
        Options symLinksIfOwnerMatch
        # Installation directory
        RewriteBase /pnp4nagios/
        # Protect application and system files from being viewed
        RewriteRule "^(?:application|modules|system)/" - [F]
        # Allow any files or directories that exist to be displayed directly
        RewriteCond "%{REQUEST_FILENAME}" !-f
        RewriteCond "%{REQUEST_FILENAME}" !-d
        # Rewrite all other URLs to index.php/URL
        RewriteRule "^.*$" "index.php/$0" [PT]

Have enabled “display_errors” in my PHP config, but it’s not showing any additional errors.
What should I check?



Same issue on CentOS, please check nonetheless.

(Larsen) #3

Not sure if I understand you. I’m not using a chroot so I don’t think you link applies to my situation.
Could you please explain this a little bit more?


It seemed that chroot wasn’t the only cause of the problem. Enabling debugging might output more information on the module relevant for the error.

(Larsen) #5

I fixed this by editing “action_url” in the Nagios configuration, and adding “index.php” in that link.