HTTP 413: Request too large - php

Using Apache 2.4 & PHP 7.4 on Ubuntu 18.04. Default Apache conf file. I'm trying to upload ~700 jpegs (totaling ~100MB, largest one being ~1MB) to a Laravel app, for a single one it works but for the larger request size I get:
The server returned a "413 Payload Too Large".
Site config looks like:
<VirtualHost *:443>
ServerName server.domain.com
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"
ProxyPreserveHost On
ProxyPass "/" "http://127.0.0.1:8000/"
ProxyPassReverse "/" "http://127.0.0.1:8000/"
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/privkey.pem
LogLevel debug
</VirtualHost>
/etc/php/7.4/apache2/php.ini has:
max_execution_time = 3600
max_input_time = 3600
memory_limit = 512M
post_max_size = 0 #Unlimited
file_uploads = On
upload_max_filesize = 100M
max_file_uploads = 2000
I've restarted Apache after applying. I see the POST request in my access.logs:
"POST /i/import/job/11c1893c-d775-46d7-9df8-1a6fafcc96f2/1 HTTP/1.1" 413 1562
and (normal looking) debug logs in error logs:
[ssl:debug] [pid 5395] ssl_engine_kernel.c(415): [client ip:1027] AH02034: Initial (No.1) HTTPS request received for child 7 (server server.domain.com:443), referer: https://server.domain.com/i/import/job/11c1893c-d775-46d7-9df8-1a6fafcc96f2/1
[authz_core:debug] [pid 5395] mod_authz_core.c(845): [client ip:1027] AH01628: authorization result: granted (no directives), referer: https://server.domain.com/i/import/job/11c1893c-d775-46d7-9df8-1a6fafcc96f2/1
[proxy:debug] [pid 5395] mod_proxy.c(1253): [client ip:1027] AH01143: Running scheme http handler (attempt 0), referer: https://server.domain.com/i/import/job/11c1893c-d775-46d7-9df8-1a6fafcc96f2/1
[proxy_fcgi:debug] [pid 5395] mod_proxy_fcgi.c(1019): [client ip:1027] AH01076: url: http://127.0.0.1:8000/i/import/job/11c1893c-d775-46d7-9df8-1a6fafcc96f2/1 proxyname: (null) proxyport: 0, referer: https://server.domain.com/i/import/job/11c1893c-d775-46d7-9df8-1a6fafcc96f2/1
[proxy_fcgi:debug] [pid 5395] mod_proxy_fcgi.c(1024): [client ip:1027] AH01077: declining URL http://127.0.0.1:8000/i/import/job/11c1893c-d775-46d7-9df8-1a6fafcc96f2/1, referer: https://server.domain.com/i/import/job/11c1893c-d775-46d7-9df8-1a6fafcc96f2/1
[proxy:debug] [pid 5395] proxy_util.c(2325): AH00942: HTTP: has acquired connection for (127.0.0.1)
[proxy:debug] [pid 5395] proxy_util.c(2379): [client ip:1027] AH00944: connecting http://127.0.0.1:8000/i/import/job/11c1893c-d775-46d7-9df8-1a6fafcc96f2/1 to 127.0.0.1:8000, referer: https://server.domain.com/i/import/job/11c1893c-d775-46d7-9df8-1a6fafcc96f2/1
[proxy:debug] [pid 5395] proxy_util.c(2588): [client ip:1027] AH00947: connected /i/import/job/11c1893c-d775-46d7-9df8-1a6fafcc96f2/1 to 127.0.0.1:8000, referer: https://server.domain.com/i/import/job/11c1893c-d775-46d7-9df8-1a6fafcc96f2/1
[proxy:debug] [pid 5395] proxy_util.c(3054): AH02824: HTTP: connection established with 127.0.0.1:8000 (127.0.0.1)
[proxy:debug] [pid 5395] proxy_util.c(3240): AH00962: HTTP: connection complete to 127.0.0.1:8000 (127.0.0.1)
[proxy:debug] [pid 5395] proxy_util.c(2340): AH00943: http: has released connection for (127.0.0.1)
[ssl:debug] [pid 5395] ssl_engine_io.c(1102): [client ip:1027] AH02001: Connection closed to child 7 with standard shutdown (server server.domain.com:443)
I don't see anything related in my application logs. Also tried setting LimitRequestBody in the apache2.conf but didn't help either.

Artisan Serve - which the Laravel app is using to start the server, using the php.ini at php-cli not the one at php-apache or php-fpm modifying the config in that, resolved this.

Related

URLs not correctly rewritten - mod proxy error

I am running the official docker php image: php:7.4-apache
Some URLs are not correctly being rewritten. We are seeing IPs in some links in the docker container but not when we test locally in MAMP.
These are the types of rewrites we are doing in the htaccess file :
RewriteRule ^gift-cards/(.*)$ http://34.245.51.253/gift-cards/$1 [P]
### Redirect for merchants pages
RewriteRule ^merchants/(.*)$ http://34.245.51.253/merchants/$1 [P]
The logs are showing:
[Mon Nov 14 12:00:14.313116 2022] [proxy:debug] [pid 26] mod_proxy.c(1503): [client 172.17.0.1:56704] AH01143: Running scheme http handler (attempt 0)
[Mon Nov 14 12:00:14.316758 2022] [proxy_ajp:debug] [pid 26] mod_proxy_ajp.c(769): [client 172.17.0.1:56704] AH00894: declining URL http://34.245.51.253/
I can see a similar question here AH00894: declining URL fcgi
But the container isn't running PHP FPM so I am not sure how to proceed?

AH00894: declining URL fcgi

I'm trying to set up a server that parses .HTML file for PHP.
Operating System: Amazon Linux 2
PHP version: 8.0.8
Apache version: 2.4.51
/etc/httpd/conf.d/php.conf
#
# Allow php to handle Multiviews
#
AddType text/html .php
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php index.html
#
# Redirect to local php-fpm (no mod_php in default configuration)
#
# Enable http authorization headers
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
<FilesMatch \.(php|phar)$>
SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost"
</FilesMatch>
The change I'm making is adding HTML to the FilesMatch clause here:
<FilesMatch \.(php|phar|html)$>
SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost"
</FilesMatch>
When I do that I see these errors:
[proxy_fcgi:debug] [pid 20974] mod_proxy_fcgi.c(1063): [client 1.1.1.1:49893] AH01078: serving URL fcgi://localhost/home/web-system-sites/dev.example.com/index.html
[proxy:debug] [pid 20974] proxy_util.c(2528): AH00942: FCGI: has acquired connection for (*)
[proxy:debug] [pid 20974] proxy_util.c(2583): [client 1.1.1.1:49893] AH00944: connecting fcgi://localhost/home/web-system-sites/dev.example.com/index.html to localhost:8000
[proxy:debug] [pid 20974] proxy_util.c(2620): [client 1.1.1.1:49893] AH02545: fcgi: has determined UDS as /run/php-fpm/www.sock
[proxy:debug] [pid 20974] proxy_util.c(2806): [client 1.1.1.1:49893] AH00947: connected /home/web-system-sites/dev.example.com/index.html to httpd-UDS:0
[proxy:debug] [pid 20974] proxy_util.c(3177): AH02823: FCGI: connection established with Unix domain socket /run/php-fpm/www.sock (*)
[proxy_fcgi:error] [pid 20974] [client 1.1.1.1:49893] AH01071: Got error 'Access to the script '/home/web-system-sites/dev.example.com/index.html' has been denied (see security.limit_extensions)'
After reading my error messages a second time I saw this, "see security.limit_extensions" and then I added .HTML here:
; Limits the extensions of the main script FPM will allow to parse. This can
; prevent configuration mistakes on the web server side. You should only limit
; FPM to .php extensions to prevent malicious users to use other extensions to
; exectute php code.
; Note: set an empty value to allow all extensions.
; Default Value: .php
security.limit_extensions = .php .html
and it works like a charm

Remove server.php using htaccess got error 500

I have a website that can be accessed in two ways:
http://localhost/public/blog
http://localhost/server.php/blog
I use the code below to remove the "public" from the url, and its work.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
So I tried to change public/ to server.php/ from above code. But it's does not work.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ server.php/$1 [L]
</IfModule>
Server return error code 500.
The server log log reports:
[Wed Sep 04 01:06:53.801523 2019] [core:error] [pid 546] [client
182.253.16.222:36164] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use
'LimitInternalRecursion' to increase the limit if necessary. Use
'LogLevel debug' to get a backtrace.
So my expectation from the second code is address "http://localhost/server.php/blog" can be access without server.php in there (http://localhost/blog).
Both examples you showed have valid syntax and should work, but you seem to still have problems, which suggests that the two different redirect patterns are interfering with each other somehow, or that you have a circular redirection.
Validating if your configuration works correctly
I've just set up a minimalistic apache project for experimenting with rewrite rules: https://github.com/rpagliuca/apache-rewrite-minimalist-environment
In that project, I tested out a configuration very similar to what you described:
# Apache virtual host config file: vhost.conf
<VirtualHost *:80>
DocumentRoot /var/www/html
RewriteEngine On
LogLevel alert rewrite:trace6
RewriteRule ^(.*)$ /server.php$1 [L]
</VirtualHost>
Also, I've added 2 different PHP files to the project:
# File 1: server.php
Handled by server.php<br/>
URI: <?= $_SERVER['REQUEST_URI'] ?>
The second file is similar:
# File 1: server.php
Handled by index.php<br/>
URI: <?= $_SERVER['REQUEST_URI'] ?>
So I started the project with docker-compose up --build, found out the IP of the container using docker ps and docker inspect, and tested out the following URL: http://192.168.16.2/blog. I got the following output on the browser:
Handled by server.php
URI: /blog
This test shows that this RewriteRule is valid in simple cases (where there is no circular redirection -- for scenarios with circular redirection, please read #Anonymous answer).
If I comment out the line RewriteEngine On line, I get a 404 error on the URL http://192.168.16.2/blog, which supports the conclusion that the redirect rule is indeed working. Also, index.php is only accessible when the RewriteEngine On is commented out. Otherwise, when the redirect engine is enabled, I get the following output:
Handled by server.php
URI: /index.php
The ultimate solution
You might have noticed the line LogLevel alert rewrite:trace6 in the vhost.conf file above.
That line enables debugging for your rewrite rules for Apache 2.4 or later. With that, you can fix your future redirect rules errors with way more ease and speed.
Whenever I run my server with docker-compose up --build, and hit the /blog URI, I get the following output:
app_1_d7cddb74e8bd | [Wed Sep 04 12:27:02.121396 2019] [rewrite:trace2] [pid 17] mod_rewrite.c(483): [client 192.168.16.1:49620] 192.168.16.1 - - [192.168.16.2/sid#7fa770113d98][rid#7fa7737780a0/initial] init rewrite engine with requested uri /blog
app_1_d7cddb74e8bd | [Wed Sep 04 12:27:02.121497 2019] [rewrite:trace3] [pid 17] mod_rewrite.c(483): [client 192.168.16.1:49620] 192.168.16.1 - - [192.168.16.2/sid#7fa770113d98][rid#7fa7737780a0/initial] applying pattern '^(.*)$' to uri '/blog'
app_1_d7cddb74e8bd | [Wed Sep 04 12:27:02.121534 2019] [rewrite:trace2] [pid 17] mod_rewrite.c(483): [client 192.168.16.1:49620] 192.168.16.1 - - [192.168.16.2/sid#7fa770113d98][rid#7fa7737780a0/initial] rewrite '/blog' -> '/server.php/blog'
app_1_d7cddb74e8bd | 192.168.16.2:80 192.168.16.1 - - [04/Sep/2019:12:27:02 +0000] "GET /blog HTTP/1.1" 200 267 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36"
app_1_d7cddb74e8bd | [Wed Sep 04 12:27:02.121550 2019] [rewrite:trace2] [pid 17] mod_rewrite.c(483): [client 192.168.16.1:49620] 192.168.16.1 - - [192.168.16.2/sid#7fa770113d98][rid#7fa7737780a0/initial] local path result: /server.php/blog
app_1_d7cddb74e8bd | [Wed Sep 04 12:27:02.121618 2019] [rewrite:trace2] [pid 17] mod_rewrite.c(483): [client 192.168.16.1:49620] 192.168.16.1 - - [192.168.16.2/sid#7fa770113d98][rid#7fa7737780a0/initial] prefixed with document_root to /var/www/html/server.php/blog
app_1_d7cddb74e8bd | [Wed Sep 04 12:27:02.121630 2019] [rewrite:trace1] [pid 17] mod_rewrite.c(483): [client 192.168.16.1:49620] 192.168.16.1 - - [192.168.16.2/sid#7fa770113d98][rid#7fa7737780a0/initial] go-ahead with /var/www/html/server.php/blog [OK]
app_1_d7cddb74e8bd | [Wed Sep 04 12:27:02.122014 2019] [rewrite:trace2] [pid 17] mod_rewrite.c(483): [client 192.168.16.1:49620] 192.168.16.1 - - [192.168.16.2/sid#7fa770113d98][rid#7fa7736c30a0/subreq] init rewrite engine with requested uri /blog
app_1_d7cddb74e8bd | [Wed Sep 04 12:27:02.122032 2019] [rewrite:trace3] [pid 17] mod_rewrite.c(483): [client 192.168.16.1:49620] 192.168.16.1 - - [192.168.16.2/sid#7fa770113d98][rid#7fa7736c30a0/subreq] applying pattern '^(.*)$' to uri '/blog'
app_1_d7cddb74e8bd | [Wed Sep 04 12:27:02.122048 2019] [rewrite:trace2] [pid 17] mod_rewrite.c(483): [client 192.168.16.1:49620] 192.168.16.1 - - [192.168.16.2/sid#7fa770113d98][rid#7fa7736c30a0/subreq] rewrite '/blog' -> '/server.php/blog'
app_1_d7cddb74e8bd | [Wed Sep 04 12:27:02.122060 2019] [rewrite:trace2] [pid 17] mod_rewrite.c(483): [client 192.168.16.1:49620] 192.168.16.1 - - [192.168.16.2/sid#7fa770113d98][rid#7fa7736c30a0/subreq] local path result: /server.php/blog
app_1_d7cddb74e8bd | [Wed Sep 04 12:27:02.122079 2019] [rewrite:trace2] [pid 17] mod_rewrite.c(483): [client 192.168.16.1:49620] 192.168.16.1 - - [192.168.16.2/sid#7fa770113d98][rid#7fa7736c30a0/subreq] prefixed with document_root to /var/www/html/server.php/blog
app_1_d7cddb74e8bd | [Wed Sep 04 12:27:02.122091 2019] [rewrite:trace1] [pid 17] mod_rewrite.c(483): [client 192.168.16.1:49620] 192.168.16.1 - - [192.168.16.2/sid#7fa770113d98][rid#7fa7736c30a0/subreq] go-ahead with /var/www/html/server.php/blog [OK]
You can follow theses logs, and easily find out where is happening your circular redirection or any other misintended behaviours.
After fixing it, remember to turn off mod_rewrite debugging, especially on production environments.
You’re redirecting every URL, but you should only redirect when server.php is missing.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^server\.php($|/)
RewriteRule ^(.*)$ server.php/$1 [L]
</IfModule>

php-fpm show script instead of execute them

I'm installing sympa 6.2.42 on a ubuntu server 18.04 with php 7.2 and fpm and apache 2.4.29 (installed with official packages)
Sympa is installed from the source.
My virtual host under apache should normally run a fcgi script with fpm.
The problem is that my script is displayed in clear on my web page. The fcgi is therefore not executed, just displayed.
No errors in the logs (fpm/apache/syslog). The fpm/apache/sympa services runs normally.
I have change my script to a simple 'hello world', result is the same.
This is my virtual host:
<VirtualHost *:80>
Servername mycomputer.mydomain.com
Serveradmin step#mydomain.com
Documentroot /var/www/sympa.mydomain.com
<Location /sympa>
SetHandler "proxy:unix:/var/run/php/php7.2-fpm.sock|fcgi://"
Options +ExecCGI
Require all granted
</Location>
<Location /static-sympa>
Require all granted
</Location>
alias /static-sympa /appli/sympa/static-content
ScriptAlias /sympa /appli/sympa/lib/sympa/cgi/wwsympa-wrapper.fcgi
RewriteEngine on
RewriteRule ^/$ /sympa [R,L]
</VirtualHost>
The output is the content of the wwsympa-wrapper.fcgi.
wwsympa-wrapper is not execute.
Update 1
My apache log:
[Thu May 23 08:41:53.760226 2019] [authz_core:debug] [pid 17536:tid 139860299998976] mod_authz_core.c(809): [client XX.XX.XX.X:53422] AH01626: authorization result of Require all granted: granted
[Thu May 23 08:41:53.760287 2019] [authz_core:debug] [pid 17536:tid 139860299998976] mod_authz_core.c(809): [client XX.XX.XX.X:53422] AH01626: authorization result of <RequireAny>: granted
[Thu May 23 08:41:53.760309 2019] [proxy:debug] [pid 17536:tid 139860299998976] mod_proxy.c(1228): [client XX.XX.XX.X:53422] AH01143: Running scheme unix handler (attempt 0)
[Thu May 23 08:41:53.760323 2019] [proxy_fcgi:debug] [pid 17536:tid 139860299998976] mod_proxy_fcgi.c(995): [client XX.XX.XX.X:53422] AH01076: url: fcgi:///appli/sympa/lib/sympa/cgi/wwsympa-wrapper.fcgi proxyname: (null) proxyport: 0
[Thu May 23 08:41:53.760331 2019] [proxy_fcgi:debug] [pid 17536:tid 139860299998976] mod_proxy_fcgi.c(1002): [client XX.XX.XX.X:53422] AH01078: serving URL fcgi:///appli/sympa/lib/sympa/cgi/wwsympa-wrapper.fcgi
[Thu May 23 08:41:53.760336 2019] [proxy:debug] [pid 17536:tid 139860299998976] proxy_util.c(2162): AH00942: FCGI: has acquired connection for (*)
[Thu May 23 08:41:53.760345 2019] [proxy:debug] [pid 17536:tid 139860299998976] proxy_util.c(2215): [client XX.XX.XX.X:53422] AH00944: connecting fcgi:///appli/sympa/lib/sympa/cgi/wwsympa-wrapper.fcgi to :8000
[Thu May 23 08:41:53.760349 2019] [proxy:debug] [pid 17536:tid 139860299998976] proxy_util.c(2252): [client XX.XX.XX.X:53422] AH02545: fcgi: has determined UDS as /var/run/php/php7.2-fpm.sock
[Thu May 23 08:41:53.760398 2019] [proxy:debug] [pid 17536:tid 139860299998976] proxy_util.c(2424): [client XX.XX.XX.X:53422] AH00947: connected /appli/sympa/lib/sympa/cgi/wwsympa-wrapper.fcgi to httpd-UDS:0
[Thu May 23 08:41:53.760432 2019] [proxy:debug] [pid 17536:tid 139860299998976] proxy_util.c(2795): AH02823: FCGI: connection established with Unix domain socket /var/run/php/php7.2-fpm.sock (*)
[Thu May 23 08:41:53.761132 2019] [proxy:debug] [pid 17536:tid 139860299998976] proxy_util.c(2177): AH00943: FCGI: has released connection for (*)
[Thu May 23 08:41:53.761265 2019] [deflate:debug] [pid 17536:tid 139860299998976] mod_deflate.c(853): [client XX.XX.XX.X:53422] AH01384: Zlib: Compressed 10632 to 3341 : URL /sympa
This is not php-fpm who is returning the script.
This behavior is generated because your configuration is wrong.
php-fpm work as a CGI gateway and you need to tell Apache to send .php file to it in order to be executed.
In your case, Apache does not know where to send this .php file and return simply the page as text.
I suggest to go here for install php-fpm properly with Apache
EDIT :
The configuration in Sympa documentation look like this :
<Location /sympa>
SetHandler "proxy:unix:$PIDDIR/wwsympa.socket|fcgi://"
Require all granted
</Location>
<Location /static-sympa>
Require all granted
</Location>

Zend Framework - 500 Internal Server Error

Today I create my first project with Zend Framework but when I try to connect to my project I see only "500 Internal Server Error". I add some new rows in httpd.conf file:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot C:\AppServ\www\data1\public
ServerName my_ip
</VirtualHost>
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot C:\AppServ\www\data1\public
ServerName http://my_ip
</VirtualHost>
And that is my htaccess file:
RewriteEngine On
#RewriteBase data1/public/
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
RewriteRule !\.(js|ico|gif|jpg|png|css|swf|html|pps)$ index.php [NC,L]
order allow,deny
allow from all
I read more topics for this problem but for now problem is not solved.
That is my error.log file(from server):
[Wed Aug 08 01:46:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5 \\ext\\php_exif.dll' - \xd3\xea\xe0\xe7\xe0\xed\xe0\xf2\xe0 \xef\xf0\xee\xf6\xe5\xe4 \xf3\xf0\xe0 \xed\xe5 \xe5 \xed\xe0\xec\xe5\xf0\xe5\xed\xe0.\r\n in Unknown on line 0
[Wed Aug 08 01:46:02 2012] [notice] Apache/2.2.8 (Win32) PHP/5.2.6 configured -- resuming normal operations
[Wed Aug 08 01:46:02 2012] [notice] Server built: Jan 18 2008 00:37:19
[Wed Aug 08 01:46:02 2012] [notice] Parent: Created child process 2392
[Wed Aug 08 01:46:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
[Wed Aug 08 01:46:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_exif.dll' - \xd3\xea\xe0\xe7\xe0\xed\xe0\xf2\xe0 \xef\xf0\xee\xf6\xe5\xe4\xf3\xf0\xe0 \xed\xe5 \xe5 \xed\xe0\xec\xe5\xf0\xe5\xed\xe0.\r\n in Unknown on line 0
[Wed Aug 08 01:46:02 2012] [notice] Child 2392: Child process is running
[Wed Aug 08 01:46:02 2012] [notice] Child 2392: Acquired the start mutex.
[Wed Aug 08 01:46:02 2012] [notice] Child 2392: Starting 64 worker threads.
[Wed Aug 08 01:46:02 2012] [notice] Child 2392: Starting thread to listen on port 80.
[Wed Aug 08 01:46:15 2012] [alert] [client 46.40.124.225] C:/AppServ/www/data1/public/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
Thanks for posting the error log.
From the looks of it, you don't have mod_rewrite loaded.
Find your httpd.conf file and locate the line:
#LoadModule rewrite_module modules/mod_rewrite.so
Remove the # sign from the beginning of the line.
Next, add a new section to httpd.conf that looks like this:
<Directory "C:/AppServ/www/data1/public">
Options FollowSymLinks
AllowOverride All
</Directory>
The AllowOverride directive is important. By default, .htaccess files are not processed unless allowed. This line allows .htaccess files in that named directory.
After making those changes, restart Apache and then try loading your ZF page again.
First of all, a better debugging. Add
ErrorLog "PATH_TO/zfapp-error_log"
CustomLog "PATH_TP/zfapp-access_log" combined
to your virtualhost. Restart apache and reload your page. The files will be created in the specified path. There will be an exact error message wich will help you debug further.
I just had the exact same problem and the solution by drew010 did fix it indeed!
However, it seems Apache config structure changed, so the method to enable the missing module is slightly different:
$ cd /etc/apache2/mods-enabled
$ sudo ln -s ../mods-available/rewrite.load ./rewrite.load
This confirms you have the right stuff going:
$ cd /etc/apache2/mods-enabled
$ cat ./rewrite.load
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
Cheers!

Categories