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?
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.