Upgrading PHP
This documentation includes instructions for upgrading your system to the latest version of PHP. Please reference the table below to check what PHP version you need for your version of Pelican.
Panel Version | PHP Version |
---|---|
1.0.0+ | 8.2, 8.3 |
Install PHP
In order to install PHP 8.3, you will need to run the following commands. Please keep in mind different operating systems may have slightly different requirements for how this commands are formatted.
# Add additional repository for PHP
sudo add-apt-repository -y ppa:ondrej/php
sudo apt -y update
# Optional: Remove old PHP versions
sudo apt -y purge php*
# Install PHP 8.3
sudo apt -y install php8.3 php8.3-{gd,mysql,mbstring,bcmath,xml,curl,zip,intl,sqlite3,fpm}
Webserver Configuration
- NGINX
- Apache
- Caddy
After upgrading to PHP 8.3, you will most likely need to update your NGINX configuration. Your configuration file
is most likely called pelican.conf
and located in the /etc/nginx/sites-available/
directory, or if on CentOS,
/etc/nginx/conf.d/
.
Make sure to update the path in the command below to reflect the actual location of your configuration file.
sed -i -e 's/php[7|8].[0-9]-fpm.sock/php8.3-fpm.sock/' /etc/nginx/sites-available/pelican.conf
Once you have edited the file run the command below to reload NGINX and apply your changes.
systemctl reload nginx
Run the commands below to disable all previous PHP versions and enable PHP 8.3 when serving requests.
a2dismod php*
a2enmod php8.3
After upgrading to PHP 8.3, you will most likely need to update your Caddy configuration. Your configuration file
is most likely called Caddyfile
and located in the /etc/caddy/
directory.
Make sure to update the path in the command below to reflect the actual location of your configuration file.
sed -i -e 's/php[7|8].[0-9]-fpm.sock/php8.3-fpm.sock/' /etc/caddy/Caddyfile
Once you have edited the file run the command below to restart Caddy and apply your changes.
systemctl restart caddy