NOTES on COMPILING PHP5The following is a step by step desciption of how I built php5. Included are URLs for wget'ing all required packages and all Linux commands used in the php5 build process. (Our build necessitated our building of PostgreSQL (7.4.3) and Apache (2.0.50).)** Before attempting to build PHP5 it is important to first build PostgreSQL (7.4.3) and then PHP5, followed by Apache (2.0.50). Although it is possible to have multiple versions of the same services running on a single computer such a practice will not be discussed in this document. Therefore, please remember to erase all RPMs that may be associated with prior versions of these already installed. I. General Packages or individual files we have retieved for the overall php5 build process:
apr-util-devel-0.9.4-14.i386.rpm
apt-0.5.15cnc6-1.1.fc2.fr.i386.rpm apt-devel-0.5.15cnc6-1.1.fc2.fr.i386.rpm c-client_archive3.gz DB-1.6.5.tgz freetype-2.1.9.tar.gz httpd httpd-2.0.50.tar.gz httpd-devel-2.0.49-4.i386.rpm imap-2004a.tar.Z libjpeg-devel-6b-31.1.i386.rpm libmcrypt-2.5.7.tar.gz libmysqlclient-lgpl_3.23.56.orig.tar.gz libpng-1.0.15-1.i386.rpm libpng-devel-1.2.5-8.i386.rpm libxslt-1.1.9-1.i386.rpm libxslt-devel-1.1.9-1.i386.rpm mhash-0.9.1.tar.gz mod_perl-1.99_12.tar.gz pcsc-lite-libs-1.1.1-2.i386.rpm perl.conf php-5.0.1.tar.gz php.conf postgresql-7.4.3.tar.gz README tidy_src.tgz unixODBC-2.2.9.tar.gz All of the above are contained at http://fs.skybuilders.com/dev/php5/php5-packages.tar 1.) Installed apt-get for Fedora RPM retreivals. This is advisable to save yourself the headache of wading through recursive rpm retievals and intalls. (For installation instructions see http://www.linuxcompatible.org/thread27839-1.html.)
% wget http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/2/apt/
apt-0.5.15cnc6-1.1.fc2.fr.i386.rpm
% wget http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/2/apt/
apt-devel-0.5.15cnc6-1.1.fc2.fr.i386.rpm
% rpm -Uvh apt-0.5.15cnc6-1.1.fc2.fr.i386.rpm
apt-devel-0.5.15cnc6-1.1.fc2.fr.i386.rpm
% apt-get update
% apt-get update 2.) After installing apt-get use it to get several packages: % apt-get install httpd-devel II. PostgreSQL 1.) PostgreSQL 7.4.3 Installation: NB: Uninstall any prior version of PostgreSQL before proceeding: % rpm -e postgresql-server % rpm -e postgresql
% wget ftp://ftp3.us.postgresql.org/pub/postgresql/source/v7.4.3/
postgresql-7.4.3.tar.gz
Here is an excerpt of the key lines: % ./configure % gmake % su % gmake install % adduser postgres % mkdir /usr/local/pgsql/data % chown postgres /usr/local/pgsql/data % su - postgres % /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data % /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 & % /usr/local/pgsql/bin/createdb test % /usr/local/pgsql/bin/psql test % exit # BEGIN skybuilders customization pathmunge /usr/local/pgsql/bin after LD_LIBRARY_PATH=/usr/local/pgsql/lib MANPATH=/usr/local/pgsql/man:$MANPATH # END skybuilders customization # BEGIN skybuilders mod #tcpip_socket = false tcpip_socket = true max_connections = 100 # note: increasing max_connections costs about 500 bytes of shared # memory per connection slot, in addition to costs from shared_buffers # and max_locks_per_transaction. #superuser_reserved_connections = 2 #port = 5432 port = 5432 # END skybuilders mod
% cp /usr/local/src/postgresql-7.4.3/contrib/start-scripts/linux
/etc/init.d/postgresql
% chmod +x /etc/init.d/postgresql
% chkconfig --add postgresql
% service postgresql restart
1.) Needed to get imap distrabution for build pieces: % wget ftp://ftp.cac.washington.edu/imap/imap-2004a.tar.Z % make lrh After untarring and compiling it needed to copy certain pieces: % cp /usr/local/src/imap-2004a/c-client/c-client.a /usr/lib/libc-client.a % cp /usr/local/src/imap-2004a/c-client/rfc822.h /usr/include/ % cp /usr/local/src/imap-2004a/c-client/mail.h /usr/include/ % cp /usr/local/src/imap-2004a/c-client/linkage.h /usr/include
% wget http://easynews.dl.sourceforge.net/sourceforge/mcrypt/
libmcrypt-2.5.7.tar.gz
% tar zxvf libmcrypt-2.5.7.tar.gz
% cd /usr/local/src/libmcrypt-2.5.7
% ./configure
% make
% make install
% cp /usr/local/src/libmcrypt-2.5.7/lib/mcrypt.h /usr/include
% wget http://umn.dl.sourceforge.net/sourceforge/mhash/mhash-0.9.1.tar.gz % cp /usr/local/src/mhash-0.9.1/lib/mhash.h /usr/include/
% wget http://http.us.debian.org/debian/pool/main/libm/libmysqlclient-lgpl/
libmysqlclient-lgpl_3.23.56.orig.tar.gz
5.) For pspell (spell checker) go to http://aspell.sourceforge.net We need to download only the aspell package and dictionaries of our choosing for PHP5 to configure with the pspell option. % wget ftp://ftp.gnu.org/gnu/aspell/aspell-0.50.5.tar.gz % tar zxvf aspell-0.50.5.tar.gz % wget ftp://ftp.gnu.org/gnu/aspell/dict/en/aspell5-en-6.0-0.tar.bz2 % tar jxvf aspell5-en-6.0-0.tar.bz2 % cd /usr/local/src/aspell-0.50.5 % ./configure && make % make install % cd /usr/local/src/aspell5-en-6.0-0 % ./configure && make % make install % wget http://tidy.sourceforge.net/src/tidy_src.tgz % cd /usr/local/src/tidy % chmod +x build/gnuauto/setup.sh % build/gnuauto/setup.sh % ./configure --prefix=/usr % make % make install % wget http://www.unixodbc.org/unixODBC-2.2.9.tar.gz % tar zxvf unixODBC-2.2.9.tar.gz % cd unixODBC-2.2.9 % ./configure --enable-gui=no % make % make install % cd /usr/local/src/freetype-2.1.9 % make % make % mkdir /usr/include/freetype2 % rpm -Uvf /usr/local/src/php5-packages/libxslt-1.1.9-1.i386.rpm % rpm -Uvf /usr/local/src/php5-packages/libxslt-devel-1.1.9-1.i386.rpm % cp /usr/local/pgsql/include/libpq-fe.h /usr/include/ % cp /usr/local/pgsql/include/postgres_ext.h /usr/include/ % cp /usr/local/pgsql/include/libpq/libpq-fs.h /usr/include/ % mkdir /usr/include/libpq % cp /usr/local/pgsql/include/libpq/libpq-fs.h /usr/include/libpq Get and untar the PHP5 sources. For PostgreSQL, assumes you have it already installed:
# unsure about this one: % cp /usr/local/src/php-5.0.1/netware/libpq-fe.h
/usr/include/
% cd /usr/lib
% ln -s libpq.so.3.1 libpq.so
% cd /usr/lib
% ln -s libjpeg.so.62.0.0 libjpeg.so
% rpm -Uvh libpng-devel-1.2.5-8.i386.rpm
% cd /usr/local/src/php-5.0.1
% ./configure --host=i386-redhat-linux --build=i386-redhat-linux --target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --enable-force-cgi-redirect --disable-debug --enable-pic --disable-rpath --enable-inline-optimization --with-bz2 --with-db4=/usr --with-curl --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --with-gd --enable-gd-native-ttf --without-gdbm --with-gettext --with-ncurses --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-png --with-regex=system --with-xml --with-expat-dir=/usr --with-dom=shared,/usr --with-dom-xslt=/usr --with-dom-exslt=/usr --with-xmlrpc=shared --with-zlib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-pear=/usr/share/pear --with-imap=/usr/local/imap-2004a --with-kerberos --with-ldap=shared --with-mysql=shared,/usr --with-pgsql=shared,/usr --with-unixODBC=shared,/usr --enable-memory-limit --enable-bcmath --enable-shmop --enable-calendar --enable-dbx --enable-dio --enable-mcal --enable-mbstring --enable-mbstr-enc-trans --enable-mbregex --with-apxs2=/usr/sbin/apxs --with-mhash --with-tidy --with-mcrypt --enable-simplexml --enable-soap --with-xsl --with-libxml-dir=/usr --with-pspell % make 2>&1 | tee makephp5.log % make install % libtool --finish /usr/local/src/php-5.0.1/libs % cp /usr/local/src/php-5.0.1/php.ini-recommended /etc/php.ini % cp /usr/local/src/php-5.0.1/modules/* /usr/local/lib/ ; Directory in which the loadable extensions (modules) reside. #extension_dir = "./" extension_dir = "/usr/local/lib/" ; UNIX: "/path1:/path2" ;include_path = ".:/php/includes" include_path = ".:/php/includes:/usr/share/pear" 12.) At this point it is wise to enable PEAR database abstraction functionality. (PEAR is bundled with php, so you do not have to actually fecth and install it.) % pear install DB NB: You may need to uninstall apache before proceeding: % rpm -e system-config-httpd % rpm -e httpd-devel % rpm -e httpd
% wget http://apache.towardex.com/httpd/httpd-2.0.50.tar.gz
% ./configure --prefix=/usr/local --enable-ssl --enable-dav
--enable-vhost-alias --enable-speling --enable-so
% make
% make install
Edit the /usr/local/conf/httpd.conf file, adding: Look for the user switch section: #User nobody #Group #-1 User apache Group apache
NameVirtualHost *:80
<Directory /var/www/>
CheckSpelling on
</Directory>
<VirtualHost *:80>
ServerName gemini.skybuilders.com
DocumentRoot /var/www/gemini.skybuilders.com
ServerAdmin jesse@skybuilders.com
ErrorLog logs/gemini.skybuilders.com-error_log
CustomLog logs/gemini.skybuilders.com-access_log common
DirectoryIndex index.html
AddType application/x-httpd-php .php .php4 .php3 .phtml .html
.xsd .xml .rss .rdf .rdfs
</VirtualHost>
Also look for:
<IfModule mod_ssl.c>
Include conf/ssl.conf
</IfModule>
And add:
#<IfModule mod_php5.c>
Include conf/php.conf
#</IfModule>
#<IfModule mod_perl.so>
Include conf/perl.conf
#</IfModule>
% perl Makefile.PL MP_APXS=/usr/local/bin/apxs % make && make test % make install % cp /usr/local/src/php5-packages/php.conf /usr/local/conf/ % cp /usr/local/src/php5-packages/perl.conf /usr/local/conf/ % /usr/local/bin/apachectl start % cp /usr/local/src/php5-packages/httpd /etc/rc.d/init.d/ % chkconfig --add httpd % chkconfig --level 345 httpd on % chkconfig --list httpd % service httpd start
# BEGIN skybuilders mod
#apachectl=/usr/sbin/apachectl
apachectl=/usr/local/bin/apachectl
#httpd=${HTTPD-/usr/sbin/httpd}
httpd=${HTTPD-/usr/local/bin/httpd}
# END skybuilders mod
|