The New PHP Version Makes the Site More Secure and Faster.

The New PHP Version Makes the Site More Secure and Faster.

PHP is the programming language used to create and maintain qr-studybuddy. Newer versions of PHP have been created with a focus on higher performance, so regular updates are always advisable but can also come with some difficulties. The currently installed version 8.1.6 makes the site load a bit faster, which can be especially seen in the editor for inserting content (which has also undergone a small redesign).

A look behind the scenes: new features, such as the update to PHP 8, are always tested first on a second instance of qr-studybuddy so that if there are errors, the entire operation of the site is not endangered. Creating and retrieving helps should always be ensured, which is why a kind of clone of the entire site runs in the background, which can be used for testing purposes. The update to PHP 8 was particularly tricky in this case, as the way variables are stored when the same script is called multiple times has changed. The result was that a while loop that was used to generate unique IDs no longer received the command to exit the loop and thus repeatedly executed the same code block in an infinite loop. This naturally overwhelmed the server, which was then unavailable with a 504 error for several hours. Fortunately, the error was quickly found and the update was finally implemented.

Johannes Mann
posted on May 22, 2022