Author |
|
kAlvaro
Joined: 29 Mar 2011 Posts: 4 Location: Spain
|
Posted: Tue 10 Dec '19 14:36 Post subject: See errors from mod_fcgid regarding 403 Forbidden |
|
|
I'm trying to configure mod_fcgid-2.3.10-win64-VS16.zip to run PHP on Windows 10. I'm possibly doing something wrong because I get "403 Forbidden" when invoking *.php files, but that's another story. The problem is that I'm unable to find error messages regarding this issue. Apache logs errors from every other source but not the ones from this specific problem. I'm looking in Apache logs directory and (just in case) Windows event viewer. I've even tried `LogLevel debug` but nothing shows up. It's worth noting that other problems with mod_fcgid (e.g. FcgidWrapper with invalid path) do get proper error logging.
Any idea? I hate doing blind diagnostics. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 11 Dec '19 12:27 Post subject: |
|
|
Please post your php config from apache. |
|
Back to top |
|
kAlvaro
Joined: 29 Mar 2011 Posts: 4 Location: Spain
|
Posted: Thu 12 Dec '19 11:34 Post subject: |
|
|
James Blond wrote: | Please post your php config from apache. |
So far I only have this (globally, not inside any container):
Code: | LoadModule fcgid_module "C:/Srv/Lib/mod_fcgid/mod_fcgid-2.3.10-win64-VS16/mod_fcgid-2.3.10/mod_fcgid.so"
AddHandler fcgid-script .php
FcgidInitialEnv PHPRC "C:/Srv/PHP/Versiones/5.3/php-5.3.0-nts-Win32-VC9-x86"
FcgidWrapper "C:/Srv/PHP/Versiones/5.3/php-5.3.0-nts-Win32-VC9-x86/php-cgi.exe" .php
Options +ExecCGI |
Apache global log error directives are:
Quote: | ErrorLog "logs/error.log"
LogLevel warn
# Also tried this:
#LogLevel debug
|
... and virtual host directives are:
Code: | <VirtualHost *:80>
ServerName tmp
DocumentRoot "C:/tmp"
ErrorLog logs/tmp-error.log
CustomLog logs/tmp-access.log combined
<Directory "C:/tmp">
Require all granted
AllowOverride All
Include "C:\Srv\Apache\extra\mod_autoindex.conf"
</Directory>
</VirtualHost> |
None of the aforementioned log files show anything when I get 403 Forbidden, save for tmp-access.log:
Code: | 127.0.0.1 - - [12/Dec/2019:10:58:15 +0100] "GET /phpinfo.php HTTP/1.1" 403 220 "http://tmp/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0"
|
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 12 Dec '19 13:10 Post subject: |
|
|
The options on the top do not work. You need to take that into your vhost
Code: |
<VirtualHost *:80>
ServerName tmp
DocumentRoot "C:/tmp"
ErrorLog logs/tmp-error.log
CustomLog logs/tmp-access.log combined
<IfModule fcgid_module>
FcgidInitialEnv PHPRC "C:\\Srv/PHP\\Versiones\\5.3\\php-5.3.0-nts-Win32-VC9-x86"
FcgidInitialEnv PATH "C:\\Srv/PHP\\Versiones\\5.3\\php-5.3.0-nts-Win32-VC9-x86;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;"
FcgidInitialEnv SystemRoot "C:\\Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:\\WINDOWS\\TEMP"
FcgidInitialEnv TMP "C:\\WINDOWS\\TEMP"
FcgidInitialEnv windir "C:\\WINDOWS"
FcgidPassHeader Authorization
<Files ~ "\.php$">
Options Indexes FollowSymLinks ExecCGI
AddHandler fcgid-script .php
FcgidWrapper "C:/Srv/PHP/Versiones/5.3/php-5.3.0-nts-Win32-VC9-x86/php-cgi.exe" .php
</Files>
</IfModule>
<Directory "C:/tmp">
Require all granted
AllowOverride All
Include "C:\Srv\Apache\extra\mod_autoindex.conf"
</Directory>
</VirtualHost>
|
|
|
Back to top |
|
kAlvaro
Joined: 29 Mar 2011 Posts: 4 Location: Spain
|
Posted: Thu 12 Dec '19 16:21 Post subject: |
|
|
James Blond wrote: | The options on the top do not work. You need to take that into your vhost |
Thank you very much for the tip. Upon further investigation, the only change needed in my current configuration to make it work is to apply ExecCGI inside a <Files> container.
It's a pity I never got a proper error message from Apache but, hey, I'm not complaining. |
|
Back to top |
|