How to recompile php on ubuntu?

I get this error

Call to undefined function imagecreatefromjpeg() 

and after reading I need to recompile php with

- ./configure --with-jpeg-dir=/usr/lib OR any other directory which contains the BINARY library of libjpeg

but which directory is the module that I need to include ...

+3
source share
3 answers
sudo apt-get install php5-gd
/etc/init.d/apache2 restart
+3
source

Try

sudo apt get install php5-gd

This will not recompile PHP, but will add support for GD, that is, the extension you need.

sudo apache2ctl graceful

You may need to activate it.

+3
source

The default /usr/libis the correct value to be libjpeg.so.62on Debian / Ubuntu.

Your problem is more likely that you did not install the header files, so PHP and the GD autoconfig script extension cannot find it. Try:

sudo apt-get install libjpeg62-dev libjpeg62
+3
source

Source: https://habr.com/ru/post/1788090/


All Articles