Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


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/ No such file or directory at /usr/local/apache2/bin/apxs line 218.

What should I do now?

share|improve this question

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:



share|improve this answer
Is make clean necessary? I've compiled it many times before but never used it, but didn't met any problem yet. – ngache May 4 '10 at 19:18
It's not entirely necessary but good practice ;) – smoak May 4 '10 at 19:29
Oops,met this problem when I try to compile: ` cannot open /usr/local/apache2/build/ No such file or directory at /usr/local/apache2/bin/apxs line 218. ` It used to work before... – ngache May 4 '10 at 19:46
What version of PHP are you trying to compile and install? What OS are you doing this on? – smoak May 4 '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.. – ngache May 4 '10 at 20:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.