Subject: PHP - problems with pear install & gd dependancy (+ fix)
To: None <pkgsrc-users@netbsd.org>
From: Dave Tyson <Dave.Tyson@liverpool.ac.uk>
List: pkgsrc-users
Date: 02/24/2006 14:04:27
A co-worker reported he had problems installing various php modules needed by
snort under NetBSD-3. Searching with Google shows a few other people have
reported the same problem against FreeBSD and Linux when using the pkg
 system.

The system has the following php / graphics packages installed

php-4.4.1nb2
php-mysql-4.4.1
gd-2.0.33nb1
php-gd-4.4.1

phpinfo shows gd is installed correctly (both from the command line and web
interface)

Trying to use pear to install Image_Color gives the following error:

root(napoleon)htdocs$ pear install Image_Color
downloading Image_Color-1.0.2.tar ...
Starting to download Image_Color-1.0.2.tar (-1 bytes)
.........done: 33,792 bytes
'gd' PHP extension is not installed
Image_Color: Dependencies failed

After a lot of messing about I looked at the pear script in /usr/pkg/bin.
 This sets a few variables and then finally calls php so:

exec $PHP -C -q $INCARG -d output_buffering=1 -n $INCDIR/pearcmd.php "$@"

However a quick look at the php man pages shows the -n option tells php
'No php.ini file will be used'

If you remove the -n option in the line then the pear install works fine as
the php.ini file is read and shows that gd is registered.

I don't much about php, but this looks like a bug in the pear script - can
someone who knows a bit more about php confirm this and I will send-pr it
(unless they get there first)

Dave

--
=====================================================================
Computing Services Dept         Phone/Fax: 0151-794-3731/3759
The University of Liverpool     Email: dtyson@liv.ac.uk
Chadwick Tower, Peach Street    WWW:   http://www.liv.ac.uk/~dtyson
Liverpool L69 7ZF               Open Source O/S: www.netbsd.org
=====================================================================