apache_request_headers() - Call to undefined function apache_request_headers()

Issue

After moving PHP application to 1&1 CentOS 7 VPS server PHP function apache_request_headers() stopped working.

With PHP display_errors set to On, following error is displayed: Call to undefined function apache_request_headers()

With display_errors set to Off, it simply throws: 500 Internal Server Error

Resolution

apache_request_headers() function is available when PHP is installed as an Apache module. Since PHP 5.4.0 it is also available under FastCGI.

The issue was resolved by switching PHP from FPM to FastCGI. In Plesk interface this can be done following way:

  • Websites and Domains > your_domain > PHP Settings
  • run PHP as: FastCGI application served by Apache

 

February 2017
PHP 5.4.16
1&1 VPS
CentOS 7

Newsletter

Subscribe to receive occasional updates on new posts.
Your email will not be used for any other purpose and you can unsubscribe at any time.
Please wait