It is useful to use a recent version of PHP, especially to secure your store and improve its performance. Version 9 of PrestaShop supports up to version 8.4 of PHP.
⚠️ PrestaShop 9 no longer supports PHP7.x, and requires at least PHP8.1. |
Before updating your PHP version
- Please check the compatibility of your theme and modules with the new version of PHP.
- Carry out tests in a pre-production environment if possible.
- Save a backup of your site and database before making any changes.
How to update the PHP version of your store
The procedure depends on your hosting environment:
1. Shared hosting (e.g. cPanel, Plesk)
-
Log in to your hosting control panel (e.g. cPanel).
-
Go to "Select PHP Version" or "PHP Manager".
-
Choose a more recent PHP version (e.g. from 7.4 to 8.1 or 8.2).
-
Save or apply the changes.
-
Clear the PrestaShop cache: Access the folder
var/cache/
and delete the foldersprod/
ordev/
depending on your environment.
2. VPS or dedicated server
If you have control of your server:
-
On Ubuntu/Debian:
bash CopierModifier sudo add-apt-repository ppa:ondrej/php sudo apt update sudo apt install php8.2 sudo update-alternatives --set php /usr/bin/php8.2
-
Update the necessary PHP extensions (
php8.2-mysql
,php8.2-curl
, etc.). -
Restart your web server (
sudo systemctl restart apache2
orphp-fpm
).
3. Docker
If you are using Docker for PrestaShop, modify yourDockerfile
ordocker-compose.yml
to use a base image with the desired PHP version.
Comments
0 comments
Please sign in to leave a comment.