2 title = "Updating PHP & Composer"
7 While we try to ensure a fairly steady & stable path for BookStack updates, requirements do change
8 as software develops & moves on. In particular, the minimum required version of PHP will increase
9 about once per year. Every so often we also may require a new minimum version of composer to be used
10 for BookStack. This page details the common steps required to update these both.
16 Currently the minimum version of PHP required by BookStack is PHP 8.1. You'll need to update PHP if using a version lower than 8.1.
17 You can usually check your installed PHP version by running `php -v` but in some cases your web-server could be running a different PHP version than what the command line reflects.
20 <summary>Updating to PHP 8.3 on most Debian & Ubuntu based systems using Apache</summary>
22 The commands below provide an example of how PHP can be updated to the PHP 8.3 on most Debian & Ubuntu based systems
23 that are running PHP via Apache using mod-php.
26 - In most cases, especially if installed using our scripts and updating from a recent BookStack version, you won't need to update PHP using the below as you'll already be using PHP 8.1 or greater.
27 - If you run other applications on this machine, PHP applications in particular, then those may also be affected by these changes.
31 sudo apt install software-properties-common
32 sudo add-apt-repository ppa:ondrej/php
34 sudo apt install -y php8.3 php8.3-curl php8.3-mbstring php8.3-ldap php8.3-xml php8.3-zip php8.3-gd php8.3-mysql libapache2-mod-php8.3
35 sudo a2dismod php7.4 php8.0 php8.1 php8.2
37 sudo systemctl restart apache2
40 You may also need to [update `composer`](#updating-composer) to be compatible with php8.3.
48 You can check your current composer version by running `composer -V`.
49 You can often update composer by running `sudo composer self-update` (Or you may be prompted to run `sudo composer self-update --2`).
50 Typically it's fine, and best practice, to be using the latest version of composer rather than a specific version near our minimum requirements.
52 If you're using a system-supplied composer package you may need to first uninstall that (eg. `sudo apt remove composer`) then follow the [composer download documentation](https://getcomposer.org/download/) to get the latest version. Take notice of the `sudo mv composer.phar /usr/local/bin/composer` command shown in the documentation to install composer globally for easier usage.