Compatibility between Prestashop & PHP versions

Prestashop PHP version

Prestashop is a content management system (CMS) designed to create and manage e-commerce sites.
It is written in PHP.
This programming language is widely used on the web.
It powers some 80% of the world’s websites.
However, PHP is a living language, which evolves regularly.
Not all versions of PHP are compatible with the version of Prestashop you’re using.
This can lead to a number of problems, up to and including total unavailability of your online store.
Let’s take a look at the various constraints associated with PHP versions, and see how to optimize a Prestashop site according to the version you’re using. Prestashop PHP version

Which PHP versions are compatible with Prestashop?

The first version of the PHP language dates back to 1995.
When Prestashop was created in 2007, PHP was already in version 5, bringing a number of major evolutions compared to previous versions.

PHP, a living language in constant evolution

PHP and Prestashop evolve independently of each other.
PHP is used to create web applications, including Prestashop.
Each version of PHP brings its own set of corrections and improvements.
New functionalities are added, while others are deprecated for the sake of upward compatibility.
In other words, you are strongly advised not to use them, as they will be removed in a later version.
Prestashop is also evolving.
Here too, new functionalities are being added, as well as corrections and optimizations, sometimes made possible by a new version of PHP.
However, some features implemented in a new version of Prestashop may require the use of a minimal version of PHP.
If this is not the case, these features may not be operational, or the whole site may be unavailable.

Compatibility between PHP and Prestashop versions

Whether you’re updating a site with a new version of Prestashop or changing the version of PHP, it’s important to ensure that the two versions used are compatible.

Prestashop version PHP version
Prestashop 1.6 (2014) PHP 5.2 to 7.1
Prestashop 1.7 (2016) PHP 5.4 to 7.4
Prestashop 8 (2022) PHP 7.2.1 to 8.1

Checking the compatibility of PHP and Prestashop versions is the only way to avoid execution errors and site malfunctions.
We recommend always using the latest version of PHP.
It provides the latest fixes (particularly security fixes) and enhancements to the language.
As improvements have been made, PHP has gained in speed and performance more generally, while consuming fewer resources (cpu and memory).
Depending on the version of Prestashop you’re using, you’ll need to use the latest compatible version of PHP.
And if it’s possible to use the latest version of PHP, you’ll need to use the latest version of Prestashop. prestashop php version compatibility

Which PHP extensions are essential for Prestashop?

Certain PHP extensions need to be enabled on the server for Prestashop to work.
The versions of these different extensions must also be checked to make sure they are compatible.
Prestashop requires activation of the following PHP extensions:

  • PDO_MySQL: connects to a MySQL database using the PDO (PHP Data Objects) interface.
  • cURL: sends and receives HTTP and FTP requests, as well as other network protocols.
  • SimpleXML: allows you to manipulate XML documents using simple objects.
  • GD: lets you create and modify images using a range of graphic functions.
  • OpenSSL: allows you to encrypt and decrypt data, as well as generate and verify digital signatures.
  • Zip: compress and decompress files in ZIP format.
  • Intl: internationalize PHP applications using functions from the ICU (International Components for Unicode) project.
  • Mbstring: handles multibyte strings, i.e. those using more than one byte per character.

How can I optimize Prestashop’s performance?

The PHP version used has a direct impact on Prestashop site performance.
The more recent the version, the faster the programs will run and the less resources the site will consume.
It is also possible to influence site performance:

  • By activating Prestashop’s production mode, only the information needed to run the site is loaded.
    This reduces page weight and memory consumption.
  • By activating the cache: thanks to the cache, the most frequently used data is stored temporarily for reuse.
    For example, instead of the home page having to be rebuilt each time a user visits the site, it will be directly extracted “ready to use” from the cache for display.
    It will therefore be displayed much more quickly.
    There are several types of caches available to improve performance:

    • Smarty cache (for page templates).
    • Symfony cache (the PHP framework used for the heart of Prestashop).
    • Doctrine cache (for SQL queries to retrieve information from the database).
  • Using “CCC” (Combine, Compress and Cache) optimization: the CSS and JavaScript files used in the Prestashop site are optimized and compressed to reduce their size and decrease their loading time.
  • Using OPcache: every time a page on the site is requested, the PHP code is first compiled before being executed.
    OPcache will cache the compiled PHP code.
    This means that already compiled code can be obtained directly from the cache and executed, considerably reducing processing time, especially with the latest versions of PHP.
    OPcache is a PHP language extension that must be activated on the server hosting the Prestashop site.

To conclude on the Prestashop and PHP versions

Using the latest versions of both PHP and Prestashop offers many advantages for your online store.
In addition to benefiting from the latest security updates, your store will enjoy optimized performance.
However, it is essential to respect certain technical prerequisites in order to guarantee Prestashop compatibility and performance.
You must also ensure that you have a recent backup of the site before updating it, in case you need to restore it.
Then you need to make sure that the site’s full functionality is operational after updating the PHP and/or Prestashop versions.
Don’t hesitate to contact me if you’d like to optimize your Prestashop site.
I’ll be with you from start to finish.
This will ensure that your online store is optimized and fully operational.