Rebuild php: An easier way

Mark Eggers mdeggers at earthlink.net
Tue Jun 22 19:09:50 UTC 2004


> Subject: Rebuild php: An easier way?

> I am using FC1. The distributed version of php does not
> include support for libmcrypt, so I want to rebuild php
> --with-mcrypt.
> 
> However, I also need gd, jpeg, mysql, and png. So, in order
> to rebuild php, I have to download, untar, configure, make and
> install packages for php, lib png, lib jpeg, mysql, gd, freetype2,
> at least.  I even have to reinstall apache, since apxs is needed
> for the php build.
> 
> Yes, I can do this, but is there an easier way?  These packages
> all come with FC1, but there is no source, and if I try to
> configure and make php without these, various errors of the
> sort 'can't find suchandsuch.h' will occur.

I normally build php from source.  Since this is a development box, I
tend to turn on as much as possible, and then state the environment
requirements as a part of the system I'm building.

That said, building php is not the most enjoyable thing to do.

1. You'll  need the development rpms (<name>-devel) of all the 
   modules you're trying to add.

2. You'll need a fairly ugly configuration script, since the
   script for php doesn't do well with finding things outside of
   /usr/local

Here's mine:
  ./configure \
  --with-apxs2=/home/apache/bin/apxs \
  --enable-bcmath --enable-calendar \
  --enable-dbase --enable-dbx \
  --enable-dio --enable-exif \
  --enable-filepro --enable-ftp \
  --enable-mbstring --enable-shmop \
  --enable-sockets --enable-sysvmsg \
  --enable-sysvsem --enable-sysvshm \
  --enable-wddx --with-openssl=/usr \
  --with-zlib=/usr --with-bz2=/usr \
  --with-curl=/usr --with-db4=/usr \
  --with-gdbm=/usr --with-flatfile \
  --with-inifile --with-dom=/usr \
  --with-dom-xslt=/usr --with-gd=/usr \
  --with-gettext=/usr --with-gmp=/usr \
  --with-java=/usr/java --with-mysql=/usr \
  --with-unixodbx=/usr --with-pgsql=/usr \
  --with-expat-dir=/usr --enable-pear

Please note that I have a fairly tweaked system.

I have installed j2sdk1.4.2_04 by hand in /usr and made a link to
/usr/java.  This allows me to experiment with new versions of Java
fairly easily.

I build apache (currently 2.0.49) from scratch.  I create a special user
for apache, and a group for all of my web application servers (Apache,
Tomcat, Jonas).  Tomcat and Jonas also get special user ids.

I build only the loadable module, which is still ranked "experimental"
for Apache 2 and php 4.

Adding the database modules to php requires that that the shared client
libraries be in the load path when used.  You can do this by adding
lines to /etc/ld.so.conf, or creating a file for each directory in
/etc/ld.so.conf.d with the name <name>.conf.  <name> should be something
meaningful.

Other than that - I hope this helps.

/mde/
just my two cents





More information about the fedora-list mailing list