Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 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
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
1  
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/config_vars.mk: 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

 
discard

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