Saturday, April 9, 2022

[SOLVED] Apache 2.4, PHP-FPM, FastCGI configuration when PHP files in /opt/moddoc/ - Apache not processing php files

Issue

I have LAPP configuration - Linux Red Hat 8, Apache 2.4, PHP7.2, Postgresql 13. FastCGI, php-fpm installed.

Server admin defined /var/www/html/ as web root.
But folders for my php files for my application were created here : /opt/moddoc/

What do I have to set up in Apache httpd.conf (or php.ini ?) to start from html page in /var/www/html/myownstartingfile.html, which is then calling php files from /opt/moddoc/myphpapp/main.php ?

Now the info.php is running only when /var/www/html/info.php - not any other folder : /cgi-bin/ or /opt/moddoc/ or other one. Or do I have to move folder structure from /opt/moddoc/ to under /var/www/html/myphpapp/main.php ?


Solution

This is caused by SeLinux. See details in Customizing the SELinux policy for the Apache HTTP server in a non-standard configuration



Answered By - Brian Wexter
Answer Checked By - Senaida (WPSolving Volunteer)