Skip to content

Commit 1e0d571

Browse files
committed
Add migration guide for upgrading from serversideup/php images to version 4
This new documentation outlines the migration process, highlights new features, and provides a checklist for users transitioning from version 3 to version 4, ensuring a smooth upgrade experience without breaking changes.
1 parent bb6629c commit 1e0d571

1 file changed

Lines changed: 77 additions & 18 deletions

File tree

docs/content/docs/5.guide/99.migrating-from-v2-to-v3.md renamed to docs/content/docs/5.guide/99.migration-guide.md

Lines changed: 77 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,73 @@
11
---
2-
head.title: 'Migrating from v2 - Server Side Up'
3-
description: 'Learn how to migrate from serversideup/php v2 images to v3.'
2+
head.title: 'Migration Guide - Server Side Up'
3+
description: 'Learn how to migrate from serversideup/php images to the latest version.'
44
layout: docs
5-
title: Migrating from v2
5+
title: Migration Guide
66
---
77
::lead-p
8-
If you're moving from v2 of serversideup/php to the latest version, there are a number of changes you should be aware of. We've tried to keep these to a minimum, but some of these changes were necessary to make the project more maintainable and easier to use.
8+
This guide is created to help you migrate from your current serversideup/php images to the latest version.
99
::
1010

11-
## Preparing for the migration
11+
## Version 3 → Version 4
12+
Version 3 to Version 4 is a much easier migration compared to previous versions. There are **no breaking changes**, so you can simply update your image tag to the latest version and take advantage of the new features.
13+
14+
### New Features in Version 4
15+
This release focused on expanding image variations, improving Laravel automations, and enhancing the developer experience. Here are the key features:
16+
17+
- **FrankenPHP variation** - A new production-ready FrankenPHP variation with intelligent defaults, flexible environment configuration, native health checks, and support for Debian and Alpine operating systems.
18+
- **Revamped documentation site** - Completely rewritten documentation with improved navigation, better examples, and a modern user experience.
19+
- **Enhanced Laravel automations** - Refactored to use `php artisan optimize` by default (following Laravel best practices), with support for migration modes (`fresh`, `refresh`), database connection selection, seeding options, and easier debugging with `AUTORUN_DEBUG`.
20+
- **Expanded environment variables** - 25+ new environment variables for fine-tuning PHP, NGINX, Apache, and FrankenPHP configurations. [See the full list of environment variables →](/docs/reference/environment-variable-specification)
21+
- **Improved health checks** - Better container startup detection using `start-period` and `start-interval` for more accurate health readings.
22+
- **IPv6 support for NGINX** - Control IP listening protocols with `NGINX_LISTEN_IP_PROTOCOL` (supports `ipv4`, `ipv6`, or `all`).
23+
- **Enhanced file permissions script** - `docker-php-serversideup-set-file-permissions` now includes automated service detection and support for multiple directories with the `--dir` flag.
24+
- **Quieter logs** - Health check requests no longer appear in access logs for `fpm-nginx` and `fpm-apache` variations.
25+
26+
### Quality of Life Improvements
27+
- **Startup scripts** - Improved handling of `entrypoint.d` scripts with better error handling and a redesigned container startup info display.
28+
- **FPM process control** - Default changed to `ondemand` for even lower resource usage in `fpm-nginx` and `fpm-apache` variations.
29+
- **Better Apache logs** - Access logs now include "Referer" and "User Agent" for better debugging.
30+
- **NGINX improvements** - Added `absolute_redirect off;` for better proxy compatibility, fixed `svgz` handling with Symfony's asset mapper, and allowed `robots.txt` to be dynamically generated by PHP.
31+
32+
### V4 Migration Checklist
33+
Since there are no breaking changes, the migration is straightforward:
34+
35+
#### Update Your Images
36+
Simply update your image tags to the latest version. For example:
37+
38+
```yml [compose.yml]
39+
services:
40+
php:
41+
image: serversideup/php:8.4-fpm-nginx
42+
```
43+
44+
No other changes are required unless you want to take advantage of new features.
45+
46+
#### Optional: Leverage New Features
47+
48+
**Consider enabling Laravel optimizations (if using Laravel):**
49+
```yml [compose.yml]
50+
services:
51+
php:
52+
image: serversideup/php:8.4-fpm-nginx
53+
environment:
54+
AUTORUN_ENABLED: "true"
55+
AUTORUN_LARAVEL_OPTIMIZE: "true"
56+
```
57+
58+
**Try the new FrankenPHP variation:**
59+
```yml [compose.yml]
60+
services:
61+
php:
62+
image: serversideup/php:8.4-frankenphp
63+
ports:
64+
- 80:8080
65+
- 443:8443
66+
```
67+
68+
That's it! Version 4 is designed to be a smooth, non-breaking upgrade that gives you more flexibility and features when you need them.
69+
70+
## Version 2 → Version 3
1271
If you're an existing user of our v2 images, be sure that your current configurations are NOT set to use the latest images. To do this, you can lock your images into the `v2.2.1` tag. This will ensure that you're not automatically upgraded to the v3 images.
1372

1473
For example, if you are using `8.2-fpm-nginx`, you would change your `compose.yml` file to use the [`v2.2.1`](https://hub.docker.com/r/serversideup/php/tags?page=1&name=2.2.1){target="_blank"} tag:
@@ -35,7 +94,7 @@ services:
3594

3695
All you need to do is add `-v2.2.1` to the end of the image tag. This will ensure that you're not automatically upgraded to the v3 images.
3796

38-
## New Features
97+
### New Features in Version 3
3998
We've been busy overhauling our PHP Docker Images to make them more production-ready and easier to use. Here are some of the new features we've added:
4099
- **Based on official PHP Images** - We're now building an improved developer experience on top of the official PHP Docker images.
41100
- **Unprivileged by default** - We're now running our images as an unprivileged user by default. This is a huge step forward in security and compatibility.
@@ -46,48 +105,48 @@ We've been busy overhauling our PHP Docker Images to make them more production-r
46105
- **NGINX Unit Support** - We're offering NGINX Unit as a variation as an alternative to PHP-FPM. This allows you to run PHP applications without the need for a webserver like NGINX or Apache to run with PHP-FPM.
47106
- **Available on GitHub Packages** - We're now publishing our images to GitHub Packages. This means you can use our images without needing to authenticate with Docker Hub.
48107

49-
## Breaking changes
108+
### Breaking changes in Version 3
50109
::caution
51110
The following changes are considered to be "breaking changes" and will require you to make changes to your application.
52111
::
53112

54-
### Ubuntu is no longer used as a base image
113+
#### Ubuntu is no longer used as a base image
55114
We now use Debian or Alpine as our base OS (because we're using the official PHP images as a base). This is a huge change, but we're confident this will be the best direction moving forward.
56115

57-
### `ppa:ondrej/php` is no longer used
116+
#### `ppa:ondrej/php` is no longer used
58117
Since we're using PHP.net as the "official source of truth" for getting our PHP versions, this means we're also dropping support for the `ppa:ondrej/php` repository. If you're using things like `apt-get install php-redis` you will need to change your method of installing PHP extensions.
59118

60119
[Learn how to install your own PHP extension →](/docs/customizing-the-image/installing-additional-php-extensions)
61120

62-
### `webuser` is no longer being used
121+
#### `webuser` is no longer being used
63122
We used to add a user called `webuser` with the UID of `9999` with shell permissions. To increase security, we're now using the `www-data` user and group that is built into the official PHP images. If you have mounted volumes, you will need to `chown` the files to match the ID of the `www-data` user and groups. For Debian, this is `33:33` and for Alpine, this is `82:82`.
64123

65-
### NGINX and Apache listen on 8080 (HTTP) and 8443 (HTTPS) by default
124+
#### NGINX and Apache listen on 8080 (HTTP) and 8443 (HTTPS) by default
66125
Our images are now unprivileged by default. This is a major step forward in security and compatibility. Since we are unprivileged by default, we lose the ability to mount on ports less than 1024. If you're using NGINX or Apache, you will need to update your port mappings to use `8080` and `8443` instead of `80` and `443`.
67126

68127
[Learn more about this change →](/docs/getting-started/default-configurations#unprivileged-by-default)
69128

70-
### S6 Overlay is only used in `*-fpm-apache` and `*-fpm-nginx` images
129+
#### S6 Overlay is only used in `*-fpm-apache` and `*-fpm-nginx` images
71130
Due to compatibility issues, we only use S6 Overlay in our `*-fpm-apache` and `*-fpm-nginx` images. If you were using S6 Overlay for our other variations (cli, fpm, etc), you will need to migrate your scripts to use the new `/etc/entrypoint.d` folder.
72131

73-
### `SSL_MODE` is now set to `off` by default (HTTP only)
132+
#### `SSL_MODE` is now set to `off` by default (HTTP only)
74133
Running end-to-end SSL by default created more problems than good. By default, we're now shipping HTTP-only by default with the option for people to turn this on.
75134

76-
### `AUTORUN_ENABLED` is now set to `false` by default.
135+
#### `AUTORUN_ENABLED` is now set to `false` by default.
77136
Having this set to "true" by default also created more problems than good. If you want to use any of the Laravel Automation Scripts, be sure to set this to `true`.
78137

79-
### MSMTP is no longer included in the images
138+
#### MSMTP is no longer included in the images
80139
For security and image size reasons, we removed MSMTP from the images. If you need to send emails, use an external SMTP service like Postmark/Sendgrid/Mailgun. You can also extend the image yourself to include MSMTP specifically for your use case.
81140

82-
### Variable deprecations
141+
#### Variable deprecations
83142
- `WEB_APP_DIRECTORY` has now been renamed to `APP_BASE_DIR`
84143
- `DEBUG_OUTPUT` has been removed for in favor of `LOG_OUTPUT_LEVEL=debug`
85144
- `PUID` & `PGID` are no longer used because it requires root privileges. See the [new way to set the UID and GID →](/docs/guide/understanding-file-permissions)
86145
- `MSMTP_RELAY_SERVER_HOSTNAME` & `MSMTP_RELAY_SERVER_PORT` are no longer used because MSMTP is no longer included in the images.
87146
- `PHP_POOL_NAME` has been renamed to `PHP_FPM_POOL_NAME`
88147

89-
## Migration Checklist
90-
Here is a good list to perform the migration
148+
### V3 Migration Checklist
149+
Here is a good list to perform the V3 migration.
91150

92151
#### Repository
93152
- Ensure you're committing to a test environment

0 commit comments

Comments
 (0)