How to upgrade PHP in e-smith 4.1.2

Author: Dan Brown <dan@familybrown.org>

Problem:
You need to upgrade PHP on e-smith to a newer version to support a new PHP program's minimum install requirements.  At the time of writing this HowTo the current PHP version available from http://rpms.arvin.dk/php was 4.0.5-2.

Solution:

Download the following files into a fresh directory on your e-smith server:

The following rpm is required for php to function in the e-smith 4.1.2 primary ibay.  If you have not installed this update already, download from here:

ftp://ftp.e-smith.org/pub/e-smith/updates/4.1.2/RPMS/noarch/e-smith-base-4.4.0-21.noarch.rpm

The following rpm is required for all machines, to provide XML support:

ftp://rpmfind.net/linux/redhat/7.1/en/os/i386/RedHat/RPMS/expat-1.95.1-1.i386.rpm

For i586 machines (Pentium, AMD K6, etc.):
http://rpms.arvin.dk/php/install-ready/i586/php-4.0.5-2.arvin.i586.rpm
http://rpms.arvin.dk/php/install-ready/i586/mod_php-4.0.5-2.arvin.i586.rpm
http://rpms.arvin.dk/php/install-ready/i586/php-imap-4.0.5-2.arvin.i586.rpm
http://rpms.arvin.dk/php/install-ready/i586/php-ldap-4.0.5-2.arvin.i586.rpm
http://rpms.arvin.dk/php/install-ready/i586/php-mysql-4.0.5-2.arvin.i586.rpm 

For i686 machines (Pentium Pro/II/III/4, Celeron, Athlon, etc.)
http://rpms.arvin.dk/php/install-ready/i686/php-4.0.5-2.arvin.i686.rpm
http://rpms.arvin.dk/php/install-ready/i686/mod_php-4.0.5-2.arvin.i686.rpm
http://rpms.arvin.dk/php/install-ready/i686/php-imap-4.0.5-2.arvin.i686.rpm
http://rpms.arvin.dk/php/install-ready/i686/php-ldap-4.0.5-2.arvin.i686.rpm
http://rpms.arvin.dk/php/install-ready/i686/php-mysql-4.0.5-2.arvin.i686.rpm 

Then, log in as root and run these commands:

[root@e-smith /root]# mv /etc/php.ini /etc/php.ini.old
[root@e-smith /root]# cd /path/to/downloaded/files
[root@e-smith /root]# rpm -Uvh *
[root@e-smith /root]# pico /etc/php.ini

In php.ini, you'll see a line that says:

magic_quotes_gpc = On

Change that value to "Off" (without the quotes)

Also, by default PHP limits the file size a user can post or upload via a php form.  Whilst your editing the file, to increase the file size limit simply edit the value of the following two lines to whatever suits your needs, say 10M, exit pico saving your changes and restart httpd.

post_max_size = 8M
upload_max_filesize = 2M

[root@e-smith /root]# /etc/rc.d/init.d/httpd restart

At this point, you're done. If you want to make sure it's working properly, then create a file in /home/e-smith/files/primary/html called test.php, and include the following line:

<? phpinfo(); ?>

Then point your web browser to http://yourserver/test.php. You should get a colorful screen indicating PHP version 4.0.5, and (among other things) support for IMAP, LDAP, and MySQL. If you're paranoid about security, it'd be a good idea to remove this file once you're satisfied that everything is working, as it exposes many details about your system configuration.