I've set up NGINX in front of Apache to pass requests to. For one of my subdomains, I've made it so the traffic goes through NGINX and then through Apache, as the PHP system on this subdomain requires Apache to run (needing functions such as apache_get_modules). For the main domain/other subdomains, data just goes straight through NGINX. I'm using PHP-FPM for this.

However, on this sub-domain that passes requests to Apache, I have an installer to install the system I'm wanting. However I'm getting this error:

Fatal error: Uncaught Error: Call to undefined function apache_get_version() in /var/www/subdomain.example.com/html/installer/index.php:80 Stack trace: #0 /var/www/subdomain.example.com/html/installer/index.php(240): checkDependencies() #1 {main} thrown in /var/www/subdomain.example.com/html/installer/index.php on line 80

So the application on the sub-domain is unable to access the apache functions that would normally work. I'm running PHP 7.3-FPM and I've already configured it to work with apache using libapache2-mod-fastcgi etc.

The phpinfo page for this subdomain says:

Server API: FPM/FastCGI

$_SERVER['SERVER_SOFTWARE']: Apache/2.4.25 (Debian)

This tells us the page is being served through Apache after NGINX as intended, however can't load apache functions as above?

Is there something missing? Could you help point me in the right direction? Thankyou so much, any support helps.

  • 1
    Contact your developer. PHP "apache" functions do not work on php-fpm, and the developer should have been aware of this. – Michael Hampton Mar 26 at 0:37
  • Is there a way to get around this? Can I make the apache functions work on php-fpm? Or could I switch to normal PHP and use that on nginx and apache? – Noah Sinist3rSaint Mar 26 at 2:11
  • Nobody should be using mod_php for any significant web site. It's slow, occasionally crashy, and difficult to work with and maintain. You should get the developer to fix the PHP application. Of course, it doesn't make any sense to have Apache here at all... What is really going on? – Michael Hampton Mar 26 at 2:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.