After updating to PHP 7.2 --> NGINX reload failed


#1

Hi

I installed EE with --wpredis --letsencript – php7. Then I updated to PHP 7.2 according to Virtubox (https://kb.virtubox.net/knowledgebase/install-php71-php72-fpm-easyengine-ubuntu/). After the last step of editing vhost like this:

include common/redis-php72.conf; include common/wpcommon-php72.conf; include common/locations-php72.conf;

I get this error message:

Reload : nginx [Failed] service nginx reload failed. check issues with nginx -t command

Can anyone help me?

Many thanks!!!


#2

What’s the output of that command?


#3

Hi emanweb

Thanks for helping me!

That’s the output of nginx -t:

nginx: [emerg] unknown “webp_suffix” variable

nginx: configuration file /etc/nginx/nginx.conf test failed


#4

push

After commenting out the rule regarding webp in these files, nginx restarts fine. But there should be a better solution to teach nginx what that webp_suffix variable actually is. There seems something missing in the tutorial we both followed.

/etc/nginx/common/wpcommon-php7.conf:        try_files $uri$webp_suffix $uri =404;
/etc/nginx/common/wpcommon-php72.conf:        try_files $uri$webp_suffix $uri =404;
/etc/nginx/common/wpcommon-php71.conf:        try_files $uri$webp_suffix $uri =404;

#5

Hello,

the issue is due to the webp rewrite directives added few weeks ago to our configurations files. It require to add the webp mapping configuration in /etc/nginx/conf.d/webp.conf with the following content :

map $http_accept $webp_suffix {
   default "";
   "~*webp" ".webp";
}

You can create it with the command :

echo -e '\nmap $http_accept $webp_suffix {\n   default "";\n   "~*webp" ".webp";\n}' > /etc/nginx/conf.d/webp.conf

I will update our article to add this required step.


#6

Thank you very much! Now everything works fine!