How do I enable PHP apache_request_headers() or change PHP into an apache module
The Apache functions are only available if running the httpd SAPI, also known as mod_php.
The stock CentOS PHP packages make mod_php available, so they are enough to allow them. If you need a newer version than the stock packages then you will need to find newer packages somewhere, or you will need to build PHP or the PHP packages yourself with the proper SAPI.
Related videos on Youtube
inac
Updated on September 17, 2022Comments
-
inac over 1 year
PHP, WHM, and several other services are already installed on a CentOS x64 server I am trying to migrate data to. Many of my existing PHP scripts are dependent on PHP's apache_request_headers() function, which the current server's PHP configuration does not support. Apparently, compiling PHP as an Apache module is one solution, but are there other ways to enable this (without uninstalling PHP, reinstalling, etc., and all dependent services), perhaps as easy as modifying php.ini, somehow?
-
skarap about 11 yearsWon't
yum install php
help? -
pqnet over 9 yearsplease add version information for php apache and centos if possible
-
-
inac almost 14 yearsHow do you enable mod_php on a stock CentOS install?
-
Ignacio Vazquez-Abrams almost 14 yearsInstalling the
php
package will install mod_php and pull in thehttpd
package as well. The default configurations for the two, when installed together, enables mod_php. -
inac almost 14 yearsPHP has already been installed - any advice on the best process to uninstall PHP and reinstall, especially if there are other services preinstalled that may depend on PHP. (The server is not yet live, still configuring it.)
-
inac almost 14 yearsPHP has already been installed - any advice on the best process to uninstall PHP and reinstall, especially if there are other services preinstalled that may depend on PHP. (The server is not yet live, still configuring it.)
-
Beel almost 14 yearsThese steps (6, 7, 8 ...) address the part of the question where you asked "change PHP into an apache module". Are you focusing on only uninstall/reinstall now?
-
inac almost 14 yearsI'm trying to work this with the existing install, but after going through 6,7,8 (in 8, skipping "mod_rewrite may be used To allow any arbitrary .php file to be displayed as syntax-highlighted source code, without having to rename or copy it to a .phps file"), my .php / .phps files become interpreted as file downloads, rather than being displayed in the browser.
-
skarap about 11 yearsI'm guessing you have compiled php from sources, right? You can try to
make uninstall
, but I'm not sure it will work. If starting from scratch is an option, I'd go with it.