WebsiteBaker Community Forum

WebsiteBaker Support (2.13.x) => Modules => Topic started by: jacobi22 on December 20, 2025, 11:34:33 AM

Title: PHP 8.5.x - Warning in Droplet Text2Image
Post by: jacobi22 on December 20, 2025, 11:34:33 AM
Nur zur Info für diejenigen, die dieses Droplet Text2Image benutzen. (gilt analog für eigene Script, die curl... benutzen)
PHP 8.5 hat einige Funktionen abgeschafft bzw umgewandelt, die zur Speicherbereinigung nach Aktionen verwendet wurden, darunter imagedestroy() oder curl_close().
Die Speicherbereinigung wird ab PHP 8.5 von PHP selbst und automatisch durchgeführt, es bedarf dieser extra Funktion nicht mehr.

Mit eingeschalteter PHP-Fehleranzeige wird es Warnungen ähnlich dieser hier geben
Quote
eval "Function imagedestroy() is deprecated since 8.5, as it has no effect since PHP 8.0"

Coreseitig werden wir diese Stellen natürlich bereinigen, bei Droplets oder user-eigenen Scripten ist das natürlich nicht möglich.
Abhilfe schafft (i.d.R.) die Entfernung solcher Zeilen, die nun nicht mehr benötigt werden, oft so etwas

Code: [Select]
imagedestroy($image_handle);
alternativ: das Voranstellen eines @, z.b. so (Ergebnis abhängig von den Einstellung der PHP-Fehlerausgabe in den WB-Optionen)
Code: [Select]
@\imagedestroy($this->oldImage);

engl.

Just for the information of those who use this Text2Image droplet. (This also applies to your own scripts that use curl...)
PHP 8.5 has removed or changed some functions that were used for memory cleanup after actions, including imagedestroy() and curl_close().
From PHP 8.5 onwards, memory clean-up is performed automatically by PHP itself, so this extra function is no longer necessary.

With PHP error display enabled, you will see warnings similar to this one
Quote
eval "Function imagedestroy() is deprecated since 8.5, as it has no effect since PHP 8.0"

We will of course clean up these places on the core side, but this is not possible for Droplets or user-owned scripts.
The remedy (usually) is to remove lines that are no longer needed, often something like this

Code: [Select]
imagedestroy($image_handle);
Alternatively, you can prefix them with an @, e.g. like this (the result depends on the PHP error output settings in the WB options)
Code: [Select]
@\imagedestroy($this->oldImage);*** Translated with www.DeepL.com/Translator (free version) ***