From 9f2448ea8b2528dd79108242ac46f011eba80c82 Mon Sep 17 00:00:00 2001 From: Kamil Kaminski Date: Mon, 16 Jan 2023 15:24:31 -0600 Subject: tiny php fastcgi and fpm php5 configs --- tiny/etc/apache2/conf-available/php5_fcgid.conf | 42 +++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 tiny/etc/apache2/conf-available/php5_fcgid.conf (limited to 'tiny/etc/apache2/conf-available/php5_fcgid.conf') diff --git a/tiny/etc/apache2/conf-available/php5_fcgid.conf b/tiny/etc/apache2/conf-available/php5_fcgid.conf new file mode 100644 index 0000000..a3bac7b --- /dev/null +++ b/tiny/etc/apache2/conf-available/php5_fcgid.conf @@ -0,0 +1,42 @@ +# +# (1) the /cgi-bin needs its uid and gid to be owned by http! otherwise infinite strange loop occurs +# (2) the following error: mod_fcgid: error reading data from FastCGI server, End of script output before headers: hello.cgi +# -> it can be fixed by changing back to "AddHandler cgi-script .cgi", but I don't want that, I want fastcgi +# -> the "End of script output before headers: fastcgi-php-wrapper" actually happened when fastcgi-php-wrapper was using 'php-cgi' +# that did not exist on my system, therefore that wrapper script ENDED/PRINTED (nothing) before HEADERS (because headers never were sent back!) +# -> this might mean that mod_fcgid/mod_fastcgi need wrappers for all file extensions, e.g. spawn /bin/bash for .sh, spawn php-cgi for .php, etc. +# +# - look like there are 2 ways to spawn wrappers, (1) via FcgidWrapper or FastCgiWrapper and (2) via new 'AddHandler' and 'Action' +# - to verify fastcgi is used use phpinfo() and look for "Server API = CGI/FastCGI" +# - php_admin_value directive is not available in cgi mode! +# + + + AddHandler php-fcgid .php + AddType application/x-httpd-php .php + DirectoryIndex index.php index.html + Action php-fcgid /cgi-bin/fastcgi-php-wrapper + + # below SetHandler is not needed but nice for shebanged .sh or .pl scripts + SetHandler cgi-script + Options +FollowSymLinks +ExecCGI + + +# +# # with this i enable php via fastcgi server wide, might want to narrow it down to specific vhosts +# # SetHandler is am override, redundant here since AddHandler already registered .php extension +# SetHandler php-fcgid +# # below probably redundant since it looks like only the wrapper needs this bit ON +# Options +ExecCGI +# + + + + +# almost worked, blew up on: +# +# mod_fcgid: error reading data from FastCGI server +# [Sun Nov 30 01:00:59.663064 2014] [core:error] [pid 11886] [client ::1:46027] End of script output before headers: php-fcgid-wrapper +# +# what a fucking joke + -- cgit v1.2.3