3

My Configure Command doesn't say anything about jpg, nor gif/png, but I can see gif/png support in the output of phpinfo().

I built PHP with --with-gd, but only GIF Support and PNG Support are in the output of phpinfo(), how do I enable JPEG Support?

UPDATE

I got this problem when compiling :

Sorry, I cannot run apxs.  Possible reasons follow:

1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)

The output of /usr/local/apache2/bin/apxs follows:
cannot open /usr/local/apache2/build/config_vars.mk: No such file or directory at /usr/local/apache2/bin/apxs line 218.

What should I do now?

1 Answers1

1

First cd to the directory of the PHP source. Then

make clean

Then compile with JPEG support (add this to all the other compile options you already had used):

--with-jpeg-dir=<put path to jpeg library here>

For example, if your jpeg library is located at:

/usr/lib/libjpeg.so

Use:

--with-jpeg-dir=/usr/lib
smoak
  • 646
  • 2
  • 7
  • 13
  • Is `make clean` necessary? I've compiled it many times before but never used it, but didn't met any problem yet. –  May 04 '10 at 19:18
  • 1
    It's not entirely necessary but good practice ;) – smoak May 04 '10 at 19:29
  • Oops,met this problem when I try to compile: ` cannot open /usr/local/apache2/build/config_vars.mk: No such file or directory at /usr/local/apache2/bin/apxs line 218. ` It used to work before... –  May 04 '10 at 19:46
  • What version of PHP are you trying to compile and install? What OS are you doing this on? – smoak May 04 '10 at 19:57
  • `PHP 5.2.8` and `Fedora release 10`. I pointed apxs2 by `--with-apxs2=/usr/local/apache2/bin/apxs` and this worked before.. –  May 04 '10 at 20:01
  • It doesn't look like the apxs utility was installed in /usr/local/apache2/bin/apxs. Where did you install apache? /usr/local/apache2? – smoak May 04 '10 at 20:31
  • Yes, and I've verified apxs2 is in `/usr/local/apache2/bin/apxs` –  May 04 '10 at 20:33
  • Hmmm. Did you install apache from source or using yum? – smoak May 04 '10 at 20:59
  • It's also installed from source. –  May 04 '10 at 21:02
  • Hmm, I suggest trying to recompile and reinstall apache making sure to pass the --enable-so option. Then once that's completed successfully retry compiling/installing php. It sounds like everything is in place, but something is amiss :( – smoak May 04 '10 at 21:06
  • Thanks for your help. I'll wait several days to see if there is a solution without reinstalling everything, as it worked fine last time. –  May 04 '10 at 21:13