Compiling PHP with GD and libjpeg support

坚强是说给别人听的谎言 提交于 2019-12-02 22:30:35

as requested:

Sometimes the configure script is dumb, and you have to do --with-somelib=/usr instead of ...=/usr/lib, because the config test is written as providedpath + '/lib/' rather than just providedpath internally. You may have to dig around inside the configure test suite to find out what's really required

Don't forget to do a

make clean

after you configure.

I've got make some other configuration and make before and the old installation prevent me to got the jpeg support enabled on GD.

It saves me on ubuntu 12.04 64bits

I've also use these packages :

aptitude install libjpeg62-dev libpng-dev libfreetype6-dev

with this configure options:

./configure \
  --with-config-file-path=/usr/local/apache2/conf \
  --with-jpeg-dir \
  --with-png-dir \
  --with-vpx-dir \
  --with-freetype-dir \
  --enable-apc \
  --enable-bcmath \
  --enable-calendar \
  --enable-dba \
  --enable-exif \
  --enable-ftp \
  --enable-mbstring \
  --enable-shmop \
  --enable-sigchild \
  --enable-soap \
  --enable-sockets \
  --enable-sysvmsg \
  --enable-zip \
  --enable-gd-native-ttf  \
  --with-gd \
  --with-apxs2=/usr/local/httpd/bin/apxs \
  --with-bz2 \
  --with-curl \
  --with-gettext \
  --with-mcrypt \
  --with-mysql-sock=/var/run/mysqld/mysqld.sock \
  --with-openssl \
  --with-pdo-mysql \
  --with-xmlrpc \
  --with-zlib

and then :

make clean
make
make install

Run good with Apache 2.4.3 and PHP 5.4.11

You most probably need to install the development version, not the run-time version, of libjpeg (of course, the run-time version will be needed once you've compiled).

I don't use CentOS myself, but something like this should help:

rpm install libjpeg-devel

I might have the package name wrong, but look for something with a -dev or -devel postfix.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!