From 2e7dc21f0ffaee1e56be5b807bd0ca8c8337a8a2 Mon Sep 17 00:00:00 2001 From: Daniel Opitz Date: Sun, 27 Aug 2023 18:37:02 +0200 Subject: [PATCH 1/2] Update section "Run From a Sub-Directory" Removed unused namespace. Fixed markdown text formatting. --- docs/v4/start/web-servers.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/v4/start/web-servers.md b/docs/v4/start/web-servers.md index fd10de53..a5ecc83a 100644 --- a/docs/v4/start/web-servers.md +++ b/docs/v4/start/web-servers.md @@ -205,16 +205,22 @@ url.rewrite-if-not-file = ("(.*)" => "/index.php/$0") This assumes that Slim's `index.php` is in the root folder of your project (www root). ## Run From a Sub-Directory -If you want to run your Slim Application from a sub-directory in your Server's Root instead of creating a Virtual Host, you can configure ``$app->setBasePath('path-to-your-app')`` right after the ``AppFactory::create()``. -Assuming that your Server's Root is ``/var/www/html/`` and path to your Slim Application is ``/var/www/html/my-slim-app`` you can set the base path to ``$app->setBasePath('/my-slim-app')``. + +If you want to run your Slim Application from a sub-directory in your Server's Root instead of creating a Virtual Host, +you can configure `$app->setBasePath('/path-to-your-app')` right after the `AppFactory::create()`. +Assuming that your Server's Root is `/var/www/html/` and path to your Slim Application is `/var/www/html/my-slim-app` +you can set the base path to `$app->setBasePath('/my-slim-app')`. ```php setBasePath('/my-slim-app'); + // ... + $app->run(); ``` From 4a4e19aa5f57979ad5a3cdb6dc779b1e239f228d Mon Sep 17 00:00:00 2001 From: Daniel Opitz Date: Sun, 27 Aug 2023 18:38:24 +0200 Subject: [PATCH 2/2] Fix PHP syntax in section "Run From a Sub-Directory" --- docs/v4/start/web-servers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/v4/start/web-servers.md b/docs/v4/start/web-servers.md index a5ecc83a..f230e9b7 100644 --- a/docs/v4/start/web-servers.md +++ b/docs/v4/start/web-servers.md @@ -207,9 +207,9 @@ This assumes that Slim's `index.php` is in the root folder of your project (www ## Run From a Sub-Directory If you want to run your Slim Application from a sub-directory in your Server's Root instead of creating a Virtual Host, -you can configure `$app->setBasePath('/path-to-your-app')` right after the `AppFactory::create()`. +you can configure `$app->setBasePath('/path-to-your-app');` right after the `AppFactory::create();`. Assuming that your Server's Root is `/var/www/html/` and path to your Slim Application is `/var/www/html/my-slim-app` -you can set the base path to `$app->setBasePath('/my-slim-app')`. +you can set the base path to `$app->setBasePath('/my-slim-app');`. ```php