5

So my error is

Call to undefined function imagewebp()

I tried this command brew reinstall php72 --with-webp, but it does not work anymore.

I don't know where and how I should change my conf file.

If you have an idea, thank you

Ling Vu
  • 4,740
  • 5
  • 24
  • 45
Amaury Leproux
  • 229
  • 1
  • 5
  • 21
  • Does this answer your question? [How can I Enable Webp support in php GD library in MAC](https://stackoverflow.com/questions/47467053/how-can-i-enable-webp-support-in-php-gd-library-in-mac) – SimonC Jan 10 '20 at 10:54
  • unfortunately no cause brew has removed every packages so I already tried this solution but does not fix this problem anymore – Amaury Leproux Jan 10 '20 at 11:37

2 Answers2

2

GD already is in mac, you don't need install it. update your homebrew and install webp manually. and after that php72

> brew update

> brew install webp
> brew reinstall php72 --with-webp

if not work try install without --with-webp how you install it manually maybe you don't need that parameter

> brew reinstall php72

and if all fail comment your osx version please.

Emiliano
  • 698
  • 9
  • 30
  • I tried the commands the only one who does not work is brew reinstall php72 --with-webp, the result is "Error: invalid option: --with-webp" | my oxs version is Catalina 10.15.12 and php version is still 7.1 – Amaury Leproux Jan 17 '20 at 12:23
  • I did and i enabled php so php -v gives "PHP 7.2.26 (cli)" but the function imagewebp still does not work for some reason :/ – Amaury Leproux Jan 18 '20 at 16:47
  • but when you install with the command brew install webp it didn't sho an error so you must include in php.ini the library – Emiliano Jan 18 '20 at 23:12
  • yes when I run "brew install webp" the installation works. What should I add to the php.ini ? --with-webp-dir ? --with-webp-dir=DIR ? – Amaury Leproux Jan 20 '20 at 09:54
  • it seems to work now that I updated everything and add "-with-webp-dir=DIR" to the php.ini thank you Emiliano – Amaury Leproux Jan 20 '20 at 10:22
  • @AmauryLeproux, can you post how you did it ? Because it's unclear to me. – pbonnefoi Oct 20 '20 at 09:25
-1

You should have the GD extension enabled: extension=gd2 in your php.ini.
To find out where your ini files are you can either use phpinfo in an script or use php --ini in cli to get its configs.

Code Spirit
  • 3,992
  • 4
  • 23
  • 34