title: Sporadicallty crashing PHP Application in Apache2
body: <p>I am currently struggling setting up the itop cmdb web application on my local server for use in my local network. Yes, I can see the irony ;)
  However, as the problem affects another PHP application (dolibarr) on the server, I think it is not related to the itop, but to my Apache2/PHP configuration.
  Initially I intended to run php7.4 and php8.1 simultaneously using fpm, but as this did not work I disabled php8.1 and the fpm module completely to trace the issue (see below), but the issues persist.</p>
  <p>Observations/Issues:</p>
  <ul>
  <li>After a few clicks the application crashes, without php nor the application logging anything in any of the logs</li>
  <li>After a crash the application is unresponsive, even after restarting apache (sudo systemctl reload apache2.service)</li>
  </ul>
  <p>Any help is much appreciated!</p>
  <p>What I tried:</p>
  <ul>
  <li>Separate the log files to trace any error or configuration issue and turned logging on where applicable</li>
  <li>Changed the ownership of the log files (www-data, root) and the permissions in different combinations</li>
  <li>reinstalled PHP7.4 (sudo apt-get purge php7.4 and reinstalled it sudo apt-get install php7.4)</li>
  <li>installed webmin to identify any issue (without luck)</li>
  <li>set <code>max_execution_time</code> to 300 seconds where applicable in all config files below</li>
  </ul>
  <p>Questions in order of preference to solve or further investigate the issue:</p>
  <ol>
  <li>Obviously, what could be the root cause of the problem and what would be the solution to successfully run the application?</li>
  <li>Why are there neither logs from PHP nor the application? Did I miss a configuration setting or is PHP using different users?</li>
  </ol>
  <p>Setup:</p>
  <ul>
  <li>Ubuntu 20.04</li>
  <li>Apache2 (enabled mods see below)</li>
  <li>PHP 7.4</li>
  <li>Separate database server running Mariadb on a Raspberry PI, which is accessible as tables and initial data was created during application installation (which also had the issues described above, but finally worked)</li>
  <li>pihole custom DNS entry: cmdb.mydomain.eu 10.0.0.1 (although I do not think they are relevant in this case, but may be due to changing  URLs)</li>
  </ul>
  <pre><code>/etc/apache2/site-available/itop.conf (enabled using a2ensite itop.conf):
  &lt;VirtualHost *:80&gt;
      ServerAdmin admin@mydomain.eu
      DocumentRoot /var/www/itop/web
      ServerName cmdb.mydomain.eu
  
      &lt;Directory /var/www/itop/web/&gt;
          Options +FollowSymlinks
          AllowOverride All
          Require all granted
      &lt;/Directory&gt;
  
      ErrorLog /var/log/apache2/cmdb_error.log
      LogLevel debug    
      CustomLog /var/log/apache2/access.log &quot;combined&quot;
  &lt;/VirtualHost&gt;
  </code></pre>
  <p>Configurations of logs files starting from /etc/php/7.4/</p>
  <ul>
  <li>apache2/php.ini: /var/log/apache2/php74_apache2_error.log</li>
  <li>cli/php.ini: /var/log/apache2/php74_cli_error.log</li>
  <li>fpm/php-fpm.conf: /var/log/php7.4-fpm.log</li>
  <li>fpm/php.ini: /var/log/php74_fpm_ini_errors.log</li>
  <li>fpm/pool.d/www.conf: /var/log/fpm74-php.www.log</li>
  </ul>
  <p>Apache enabled mods:</p>
  <pre><code>Loaded Modules:
   core_module (static)
   so_module (static)
   watchdog_module (static)
   http_module (static)
   log_config_module (static)
   logio_module (static)
   version_module (static)
   unixd_module (static)
   access_compat_module (shared)
   alias_module (shared)
   auth_basic_module (shared)
   authn_core_module (shared)
   authn_file_module (shared)
   authz_core_module (shared)
   authz_host_module (shared)
   dav_module (shared)
   dav_svn_module (shared)
   authz_svn_module (shared)
   authz_user_module (shared)
   autoindex_module (shared)
   deflate_module (shared)
   dir_module (shared)
   env_module (shared)
   filter_module (shared)
   log_debug_module (shared)
   log_forensic_module (shared)
   mime_module (shared)
   mpm_prefork_module (shared)
   negotiation_module (shared)
   php7_module (shared)
   proxy_module (shared)
   proxy_http_module (shared)
   reqtimeout_module (shared)
   setenvif_module (shared)
   status_module (shared)
   wsgi_module (shared)
  </code></pre>
  <p>Apache2 mods, confs, etc.:</p>
  <pre><code>Included configuration files:
    (*) /etc/apache2/apache2.conf
      (147) /etc/apache2/mods-enabled/access_compat.load
      (147) /etc/apache2/mods-enabled/alias.load
      (147) /etc/apache2/mods-enabled/auth_basic.load
      (147) /etc/apache2/mods-enabled/authn_core.load
      (147) /etc/apache2/mods-enabled/authn_file.load
      (147) /etc/apache2/mods-enabled/authz_core.load
      (147) /etc/apache2/mods-enabled/authz_host.load
      (147) /etc/apache2/mods-enabled/authz_svn.load
        (3) /etc/apache2/mods-enabled/dav_svn.load
          (4) /etc/apache2/mods-enabled/dav.load
      (4) /etc/apache2/mods-enabled/authz_user.load
      (4) /etc/apache2/mods-enabled/autoindex.load
      (4) /etc/apache2/mods-enabled/dav.load
      (4) /etc/apache2/mods-enabled/dav_svn.load
      (4) /etc/apache2/mods-enabled/deflate.load
      (4) /etc/apache2/mods-enabled/dir.load
      (4) /etc/apache2/mods-enabled/env.load
      (4) /etc/apache2/mods-enabled/filter.load
      (4) /etc/apache2/mods-enabled/log_debug.load
      (4) /etc/apache2/mods-enabled/log_forensic.load
      (4) /etc/apache2/mods-enabled/mime.load
      (4) /etc/apache2/mods-enabled/mpm_prefork.load
      (4) /etc/apache2/mods-enabled/negotiation.load
      (4) /etc/apache2/mods-enabled/php7.4.load
      (4) /etc/apache2/mods-enabled/proxy.load
      (4) /etc/apache2/mods-enabled/proxy_http.load
      (4) /etc/apache2/mods-enabled/reqtimeout.load
      (4) /etc/apache2/mods-enabled/setenvif.load
      (4) /etc/apache2/mods-enabled/status.load
      (4) /etc/apache2/mods-enabled/wsgi.load
      (148) /etc/apache2/mods-enabled/alias.conf
      (148) /etc/apache2/mods-enabled/autoindex.conf
      (148) /etc/apache2/mods-enabled/dav_svn.conf
      (148) /etc/apache2/mods-enabled/deflate.conf
      (148) /etc/apache2/mods-enabled/dir.conf
      (148) /etc/apache2/mods-enabled/mime.conf
      (148) /etc/apache2/mods-enabled/mpm_prefork.conf
      (148) /etc/apache2/mods-enabled/negotiation.conf
      (148) /etc/apache2/mods-enabled/php7.4.conf
      (148) /etc/apache2/mods-enabled/proxy.conf
      (148) /etc/apache2/mods-enabled/reqtimeout.conf
      (148) /etc/apache2/mods-enabled/setenvif.conf
      (148) /etc/apache2/mods-enabled/status.conf
      (148) /etc/apache2/mods-enabled/wsgi.conf
      (151) /etc/apache2/ports.conf
      (223) /etc/apache2/conf-enabled/charset.conf
      (223) /etc/apache2/conf-enabled/localized-error-pages.conf
      (223) /etc/apache2/conf-enabled/other-vhosts-access-log.conf
      (223) /etc/apache2/conf-enabled/security.conf
      (223) /etc/apache2/conf-enabled/serve-cgi-bin.conf
      (226) /etc/apache2/sites-enabled/000-default.conf
      (226) /etc/apache2/sites-enabled/dolibarr.conf
      (226) /etc/apache2/sites-enabled/itop.conf
  </code></pre>