[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-developers] recompiling PHP4 on Qube 3 for enabling FTP/PDF-functions



Hello Stefan,
 
> Hello,
> 
> I wondered about the fact, that on my Qube 3 PHP4 is installed, but
many
> main modules of PHP4 are not implemented because they were not
compiled
> into
> the packages.
> 
> So I wanted to ask, how to manage, that I can use nearly all PHP4
> functions,
> esp. FTP-support and PDF-support.
> 
> I know that someone has to recompile PHP with several additional
> parameters
> to do this.
> 
> But:
> - I found no source code of PHP4 at my Qube
> - I found no configuration file .configure to set compiling parameters
> - I found no instructions how to compile it, how to make a makefile
for
> the
> Qube
> - there seems not to be a cobalt package file to add these features
> - I haven't got success by installing Apache 1.3.20, I hoped that it
will
> bring a new PHP4 with it, but it wasn't
> 
> I haven't installed any standard redhat RPMs yet, because I don't want
to
> loose my Admin-Frontend, that is based on PHP.
> 

I have a raq 4 and also wished I had more extensions.  Here's what I
did.

The trick is to compile additional extensions as shared modules.  Then,
all you have to do is add the new .so (Linux for .dll) files into
/etc/httpd/modules/php and change the config in your php.ini file.

I first added all the relevant patches to my computer.  Then, I went to
the pkg.nl.cobalt.com site where they have a PHP 4.06 pkg file.  They
don't appear to have this for the Qube, but that's OK.

I then downloaded the source for my version of PHP from the php site.
If you're not on 4.0.6, it is a little harder to get your version of
PHP, but if you look closely at the download URL, you may be able to get
it.  Here's the URL for the current version:
http://www.php.net/do_download.php?download_file=php-4.0.6.tar.gz
You should be able to change the version to the correct version and
download it safely.  There are also links to 4.0.5 and 4.0.4pl1 on the
download page.

Create a file in your PHP enabled site that simply has this command in
it:
<?php phpinfo(); ?>

View that page with your web browser.  Near the top (3rd row down I
think) you will see the parameters that were used to compile your
version of PHP.  Copy these into a text file and then strip out the
apostrophes.  For example, here's mine:
'./configure' '--prefix=/usr' '--with-apxs=/usr/sbin/apxs' '--with-gd'
'--with-gettext=/usr' '--enable-safe-mode'
'--with-config-file-path=/etc/httpd' '--with-exec-dir=/usr/bin'
'--with-zlib' '--enable-magic-quotes' '--with-regex=system'
'--with-ttf=/usr/lib/libttf.so' '--enable-track-vars' '--enable-xml'
'--disable-debug' '--with-libdir=/usr/lib' '--with-gdbm'
'--with-interbase=shared' '--with-pgsql=shared' '--with-ldap'
'--with-imap' '--with-kerberos' '--with-dom' '--with-mysql=shared'


Now, try to compile the PHP source with this command (the one from your
php, not mine).  If you're fortunate, it will work fine.  If it does
work then all you have to do is work on installing new modules.

Once you do successfully compile a module (as shared) simply copy it to
the /etc/httpd/modules/php folder.  DO NOT RUN 'make install'.  If you
can't find your new .so file, do a 'find ./ | grep so'

I found that it can be very tricky to get modules to compile, because of
missing library files.  On my Raq 4, I go to www.rpmfind.net and
download the rpm files for RedHat 6.2 to fix the missing dependencies.

Also, if you get problems using the stock configure string, get rid of
all references to gd or other modules that cause problems.  Since the
goal is to simply compile new modules, you don't have to recompile all
the modules that are there.

Be very careful about upgrading existing extensions.  For example, if
you upgrade your GD, a lot of stuff will break.

Good luck on this.  I may be able to give more advise if you need it.

Matthew Nuzum
5`//337-31337
cobalt@xxxxxxxxxxxxx
bearfruit.org