oc 3.0.3.2, хостинг - VestaCP, после установки нового шаблона не работает модификатор преобразования webp, если его отключить то ошибка уходит но на сайте все коряво, РЕБЯТА, помогите настроить nginx.conf на отдачу webp, У меня пишет такую ошибку на самом сайте : Fatal error: Uncaught Error: Call to undefined function imagewebp() in /home/admin/web/mebelomskabsolut.ru/public_html/system/storage/modification/catalog/model/tool/image.php:64 Stack trace: #0 /home/admin/web/mebelomskabsolut.ru/public_html/system/storage/modification/system/engine/loader.php(248): ModelToolImage->resize('no_image.png', 100, 100) #1 /home/admin/web/mebelomskabsolut.ru/public_html/system/engine/proxy.php(47): Loader->{closure}(Array, Array) #2 /home/admin/web/mebelomskabsolut.ru/public_html/catalog/controller/extension/module/so_home_slider.php(93): Proxy->__call('resize', Array) #3 /home/admin/web/mebelomskabsolut.ru/public_html/catalog/controller/extension/module/so_home_slider.php(36): ControllerExtensionModuleSohomeslider->readData(Array) #4 /home/admin/web/mebelomskabsolut.ru/public_html/system/storage/modification/system/engine/action.php(79): ControllerExtensionModuleSohomeslider->index(Array) #5 /home/admin/web/mebelomskabsolut.ru/public_html/system/storage/modification/system/engine/loader.php(4 in /home/admin/web/mebelomskabsolut.ru/public_html/system/storage/modification/catalog/model/tool/image.php on line 64 вот содержимое модификатора в админке: <?xml version="1.0" encoding="utf-8"?> <modification> <name>So convert image WebP</name> <code>so-convert-image-WebP</code> <version>1.0.0</version> <author>OpenCartWorks</author> <link>http://www.opencartworks.com/</link> <file path="catalog/model/tool/image.php"> <operation> <search trim="true"> <![CDATA[if ($this->request->server['HTTPS']) {]]> </search> <add position="before" trim="false"> <![CDATA[ $this->load->model('extension/soconfig/general'); if($this->soconfig->get_settings('enable_convert_image_webP') === '1') { if($extension == 'jpg' || $extension == 'png' || $extension == 'gif' || $extension == 'jpeg') { // Image $dir = DIR_IMAGE; $name = $image_new; $newName = utf8_substr($image_new, 0, utf8_strrpos($image_new, '.')) . '.webp'; // Create and save if (!is_file(DIR_IMAGE . $newName)) { if ($extension == 'jpeg' && $this->soconfig->get_settings('jpg_convert_image_webP') === '1' || $extension == 'jpg' && $this->soconfig->get_settings('jpg_convert_image_webP') === '1') $img = imagecreatefromjpeg($dir.$name); elseif ($extension == 'gif' && $this->soconfig->get_settings('gif_convert_image_webP') === '1') $img = imagecreatefromgif($dir.$name); elseif ($extension == 'png' && $this->soconfig->get_settings('png_convert_image_webP') === '1') $img = imagecreatefrompng($dir.$name); imagepalettetotruecolor($img); imagealphablending($img, true); imagesavealpha($img, true); imagewebp($img, $dir . $newName, 100); imagedestroy($img); } else { if ($extension == 'jpeg' && $this->soconfig->get_settings('jpg_convert_image_webP') === '1' || $extension == 'jpg' && $this->soconfig->get_settings('jpg_convert_image_webP') === '1') $image_new = $newName; elseif ($extension == 'gif' && $this->soconfig->get_settings('gif_convert_image_webP') === '1') $image_new = $newName; elseif ($extension == 'png' && $this->soconfig->get_settings('png_convert_image_webP') === '1') $image_new = $newName; } } } ]]> </add> </operation> </file> </modification>
вы наверно покупали модуль на варезнике ? у вас в ошибке Call to undefined function imagewebp() ясно написано нет функции imagewebp() тут nginx не при чем.
Здравствуйте Функция является внутренней для php - https://www.php.net/manual/ru/function.imagewebp.php Смотрите версию окружения сайта (к примеру, какая версия php) + какие у вас настройки. Добавлено: Если у вас варезный софт, то проще купите модуль у автора и попросите решить проблему (а может и сама решится)
обратитесь к хостеру, похоже нужно сконфигурировать php с правильными параметрами https://stackoverflow.com/questions/57651877/call-to-undefined-function-imagewebp