@@ -15,13 +15,13 @@ When using Apache, you can configure PHP as an
15
15
:ref: `PHP FPM <web-server-apache-fpm >`. FastCGI also is the preferred way
16
16
to use PHP :ref: `with Nginx <web-server-nginx >`.
17
17
18
- .. sidebar :: The Web Directory
18
+ .. sidebar :: The public directory
19
19
20
- The web directory is the home of all of your application's public and
20
+ The public directory is the home of all of your application's public and
21
21
static files, including images, stylesheets and JavaScript files. It is
22
- also where the front controllers (``index.php `` and `` index.php ``) live .
22
+ also where the front controller (``index.php ``) lives .
23
23
24
- The web directory serves as the document root when configuring your
24
+ The public directory serves as the document root when configuring your
25
25
web server. In the examples below, the ``public/ `` directory will be the
26
26
document root. This directory is ``/var/www/project/public/ ``.
27
27
@@ -270,25 +270,8 @@ The **minimum configuration** to get your application running under Nginx is:
270
270
# try to serve file directly, fallback to index.php
271
271
try_files $uri /index.php$is_args$args;
272
272
}
273
- # DEV
274
- # This rule should only be placed on your development environment
275
- # In production, don't include this and don't deploy index.php or config.php
276
- location ~ ^/(app_dev|config)\.php(/|$) {
277
- fastcgi_pass unix:/var/run/php7.1-fpm.sock;
278
- fastcgi_split_path_info ^(.+\.php)(/.*)$;
279
- include fastcgi_params;
280
- # When you are using symlinks to link the document root to the
281
- # current version of your application, you should pass the real
282
- # application path instead of the path to the symlink to PHP
283
- # FPM.
284
- # Otherwise, PHP's OPcache may not properly detect changes to
285
- # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
286
- # for more information).
287
- fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
288
- fastcgi_param DOCUMENT_ROOT $realpath_root;
289
- }
290
- # PROD
291
- location ~ ^/app\.php(/|$) {
273
+
274
+ location ~ ^/index\.php(/|$) {
292
275
fastcgi_pass unix:/var/run/php7.1-fpm.sock;
293
276
fastcgi_split_path_info ^(.+\.php)(/.*)$;
294
277
include fastcgi_params;
@@ -324,17 +307,16 @@ The **minimum configuration** to get your application running under Nginx is:
324
307
325
308
.. tip ::
326
309
327
- This executes **only ** ``index.php ``, `` index.php `` and `` config.php `` in
328
- the web directory. All other files ending in ".php" will be denied.
310
+ This executes **only ** ``index.php `` in the public directory. All other files
311
+ ending in ".php" will be denied.
329
312
330
- If you have other PHP files in your web directory that need to be executed,
313
+ If you have other PHP files in your public directory that need to be executed,
331
314
be sure to include them in the ``location `` block above.
332
315
333
316
.. caution ::
334
317
335
318
After you deploy to production, make sure that you **cannot ** access the ``index.php ``
336
- or ``config.php `` scripts (i.e. ``http://example.com/index.php `` and ``http://example.com/config.php ``).
337
- If you *can * access these, be sure to remove the ``DEV `` section from the above configuration.
319
+ script (i.e. ``http://example.com/index.php ``).
338
320
339
321
.. note ::
340
322
0 commit comments