LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   compile php with gd ? (https://www.linuxquestions.org/questions/slackware-14/compile-php-with-gd-260174/)

sonaatti 11-28-2004 11:46 AM

compile php with gd ?
 
I didnīt get the php package that came with the installation to work, so I compiled php4 from source and it worked great until now when I want to use some php functions that needs gd http://www.boutell.com/gd/ , Iīve tried adding extension=gd.so into php.ini and restarted apache, but still didnīt work, do I have to compile php with gd, if so how do I do that ?
Also is the php package from slackware.com compiled with gd ?

Slackware 10
kernel 2.6...

cccc828 11-28-2004 11:55 AM

The Slackware package comes with gd, and PHP comes with gd boundled, just pass --with-gd to the configure script.

cccc828

sonaatti 11-28-2004 12:09 PM

Yes indeed I found this in confiure
--with-gd[=DIR] Include GD support where DIR is GD install prefix.
If DIR is not set, the bundled GD library will be used."

so I guess itīs ok ?
but it doesnīt work.

Fatal error: Call to undefined function: imagecreate()

thatīs what Iīm trying to run, which needs gd... :/

Another thing is that when I restart apache it says itīs skipping the php4 module since itīs already loaded, how do I restart php ?

DaHammer 11-29-2004 10:46 AM

Quote:

Originally posted by sonaatti

Another thing is that when I restart apache it says itīs skipping the php4 module since itīs already loaded, how do I restart php ?


The makefile for PHP has likely added the module to your httpd.conf file again. It does that everytime you run "make install".

Also watch the configure process for any errors related to the inclusion of GD and check the config.log. You'll also probably want to have a look at phpinfo() in your browser. The GD info and formats it supports will be listed there if present:
Code:

<?php
phpinfo();
?>

If you're using one of the photo albums, you'll probably also need jpeg support, which is not included in the bundled GD. You can add it by compiling jpeg-6b, which you can get at ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz. Once you have that, then just add the "--with-jpeg-dir=pathtojpeg-6bsource" & "--with-jpeg-6b" switches to the PHP configure. You may also want exif, ie --enable-exif. Here is my config.nice script for reference:
Code:

#! /bin/sh
#
# Created by configure

'./configure' \
'--with-mysql=/usr/local/mysql' \
'--with-apache=../apache_1.3.33' \
'--with-jpeg-dir=../jpeg-6b' \
'--enable-safe-mode' \
'--with-zlib' \
'--with-gd' \
'--enable-exif' \
'--with-jpeg-6b' \
"$@"

Note though that I'm compiling the PHP module into Apache vs using it as a DSO module though.


All times are GMT -5. The time now is 05:46 AM.