@@ -118,7 +118,7 @@ Using mod_proxy_fcgi with Apache 2.4
118
118
If you are running Apache 2.4, you can easily use ``mod_proxy_fcgi `` to pass
119
119
incoming requests to PHP-FPM. Configure PHP-FPM to listen on a TCP socket
120
120
(``mod_proxy `` currently `does not support unix sockets `_), enable ``mod_proxy ``
121
- and ``mod_proxy_fcgi `` in your Apache configuration and use the ``ProxyPassMatch ``
121
+ and ``mod_proxy_fcgi `` in your Apache configuration and use the ``SetHandler ``
122
122
directive to pass requests for PHP files to PHP FPM:
123
123
124
124
.. code-block :: apache
@@ -133,14 +133,17 @@ directive to pass requests for PHP files to PHP FPM:
133
133
# SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
134
134
135
135
# For Apache 2.4.9 or higher
136
- # Using SetHandler avoids issues with using ProxyPassMatch in combination
136
+ # Using SetHandler avoids issues with using ProxyPassMatch in combination
137
137
# with mod_rewrite or mod_autoindex
138
138
<FilesMatch \.php$>
139
139
SetHandler proxy:fcgi://127.0.0.1:9000
140
140
</FilesMatch>
141
141
# If you use Apache version below 2.4.9 you must consider update or use this instead
142
142
# ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/project/web/$1
143
-
143
+ # If you run your Symfony application on a subpath of your document root, the
144
+ # regular expression must be changed accordingly:
145
+ # ProxyPassMatch ^/path-to-app/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/project/web/$1
146
+
144
147
DocumentRoot /var/www/project/web
145
148
<Directory /var/www/project/web>
146
149
# enable the .htaccess rewrites
@@ -152,16 +155,6 @@ directive to pass requests for PHP files to PHP FPM:
152
155
CustomLog /var/log/apache2/project_access.log combined
153
156
</VirtualHost>
154
157
155
- .. caution ::
156
-
157
- When you run your Symfony application on a subpath of your document root,
158
- the regular expression used in ``ProxyPassMatch `` directive must be changed
159
- accordingly:
160
-
161
- .. code-block :: apache
162
-
163
- ProxyPassMatch ^/path-to-app/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/project/web/$1
164
-
165
158
PHP-FPM with Apache 2.2
166
159
~~~~~~~~~~~~~~~~~~~~~~~
167
160
0 commit comments