You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by John Iliffe <jo...@iliffe.ca> on 2017/04/18 15:53:31 UTC
[users@httpd] Error in serving PHP pages from mod_fcgid
Having spent considerable time chasing this problem around over the last
few weeks (and a sincere thank you to Daniel for his assistance) here is
some information that might save some time for somebody!
Environment:
Apache 2.4.25 compiled from source
PHP 7.1.3 compiled from source
mod_fcgid downloaded from Apache and compiled from source
Fedora 25, Apache started from systemctl
Problem:
Couldn't find any configuration in the httpd.conf file that would allow either
php-fpm OR mod_fcgid to serve dynamic pages. Standard html worked fine, PHP
scripts usually ended with either "File Not Found" or "No Input File
Specified".
Solution (?)
In the php.ini file there is a parameter "display_errors" that controls
whether a script error is displayed on the served output page. Some of
these errors are really script errors but some can be run-time situations
too, so displaying the offending line of code to the browser is rather
dangerous. Looks rather silly too.
Anyhow, if this parameter is set to On, the pages display fine; if it is set
to Off, then the result is a served page that says: "File not found". The
default is On but I turned it off before trying to get php-fpm working, and
spent all this time chasing the problem.
This isn't at all intuitive but I have reset this parameter both ways
several times now with the same result. You have to stop Apache and
restart it between changes. Note that the problem occurs even when the
page has no errors. (eg, phpinfo.php wouldn't run either)
So, good luck!
John
[here is the relevant part of php.ini
--------------------------------
; This directive controls whether or not and where PHP will output errors,
; notices and warnings too. Error output is very useful during development,
but
; it could be very dangerous in production environments. Depending on the
code
; which is triggering the error, sensitive information could potentially
leak
; out of your application such as database usernames and passwords or
worse.
; For production environments, we recommend logging errors rather than
; sending them to STDOUT.
; Possible Values:
; Off = Do not display any errors
; stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
; On or stdout = Display errors to STDOUT
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/display-errors
display_errors = On <----------
; display_errors = Off
-----------------------------------
]
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org