PHP-FPM shows source code from subfolder

Discussion in 'General' started by gkovacs, Aug 7, 2018.

  1. gkovacs

    gkovacs Member

    I have installed am Ubuntu 18.04 based webserver according to the Perfect Server tutorial, with the current ISPConfig, Apache 2.4 and PHP 7.2 FPM.

    PHP applications work perfectly if the index.php (or any other PHP file that is requested from the browser) is based in the site's root folder, but if I install anything into a subfolder, then instead of executing the application, the browser shows the source code of the PHP file.

    If I change the PHP to CGI in ISPConfig, then it executes from the subfolder, but changing it back to PHP-FPM shows the source code again.

    Any idea what could be happening?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you add any config in the apache directives field of that website?
     
  3. gkovacs

    gkovacs Member

    Yes, we are trying to make a Laravel based site to work, so we put
    Code:
    DocumentRoot "{DOCROOT}/public"
    into Apache directives, which correctly redirects the siteroot to the /var/www/sitename/web/public folder. However, only CGI works, PHP-FPM shows the source code from here.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Use {DOCROOT_CLIENT} instead of {DOCROOT}.
     
    gkovacs likes this.

Share This Page