A Really Good PHP Installation
Posted in 2004
################################################################################
# A Really Good PHP Installation
################################################################################
#
# PHP installations don't have to be painful, you just need to know what
# some basic minimums are for most common installations. You can always
# add more options on where things go, just add them to the final config.
# This is a great guide for the impatient and short attention span people.
#
# This instruction set combines FreeTDS, Apache2, OpenSSL and PHP. Add
# your own stuff before step 5, which is the PHP build. An explanation
# of PHP config commands are at the end of this doc. You might want to
# include OpenLDAP but this is not covered here.
#
# Locations of source for this build:
#
# Apache2 http://www.apache.org
# OpenSSL http://www.openssl.org
# FreeTDS http://www.freetds.org
# unixODBC http://www.unixodbc.org
# PHP http://www.php.net
#
# Optional but not covered here:
#
# OpenLDAP http://www.openldap.org
#
#
# 1. Create a directory called 'build'. For example, /root/build
# This is where you will build everything. When you are done you have a
# directory of components to build PHP and Apache
#
# 2. Download latest FreeTDS to /root/build
# cd /root/build
# ./configure
# make# make install
#
# 3. Download latest unixODBC to /root/build
# cd /root/build
# tar zxvf unixODBC-2.2.8.tar.gz
# ./configure# make
# make install
#
# 4. Download latest Apache2 to /root/build
# cd /root/build
# tar zxvf httpd-2.0.48.tar.gz
# ./configure
# make# make install
#
# 5. Download latest OpenSSL to /root/build
# cd /root/build
# tar zxvf openssl-0.9.6l.tar.gz
# ./configure
# make# make install
#
# 6. Download latest PHP to /root/build
# cd /root/build
# tar zxvf php-4.3.4.tar.gz
# ./configure \\
# --with-apache2=../httpd-2.0.48 \\
# --with-apxs2=/usr/local/apache2/bin/apxs \\
# --with-module=so \\
# --with-zlib \\
# --with-mysql \\
# --with-openssl=/usr/local/ssl/ \\
# --with-sybase=/usr/local \\
# --with-bz2 \\
# --with-flatfile \\
# --with-zlib=/usr \\
# --with-gd \\
# --with-mcrypt
## 7. Test PHP on the command-line
# php -v
# php -i
#
# 8. Edit Apache2 httpd.conf
# Add the following if it isn't there already and make sure to give
# your server a name. Add these lines to their appropriate sections.
#
# LoadModule php4_module modules/libphp4.so
# DirectoryIndex index.html index.html.var index.php
# AddType application/x-httpd-php .php
#
# 9. If you use MySQL and phpMyAdmin you might also want to add these
# lines. Make sure to put the correct path to where phpMyAdmin is.
#
# Alias /phpMyAdmin "/srv/www/phpMyAdmin/"
# Alias /phpMyAdmin/ "/srv/www/phpMyAdmin/"
#
# <Directory "/srv/www/phpMyAdmin">
# Options Indexes +Includes FollowSymLinks ExecCGI MultiViews
# AllowOverride None
# Order allow,deny
# Allow from all
# </Directory>
#
# 10. If you want a cgi-bin to worki uncomment:
#
# AddHandler cgi-script .cgi
#
# 11. If you want Server-Side-Includes to work uncomment these lines:
#
# AddType text/html .shtml
# AddType text/html .html
# AddOutputFilter INCLUDES .shtml
# AddOutputFilter INCLUDES .html
#
# 12. Edit a php.ini file. Where does it go? PHP assumes a
# /usr/local/lib/php.ini but you can change this. Here you can
# change server-specific settings for your installation. To get
# up and running quickly, copy a php.ini to /usr/local/lib and
# later you can change this location. Any changes you make require
# stopping and restarting Apache.
#
# 13. Start/Stop/Help Apache2
#
# /usr/local/apache2/bin/apachectl start
# /usr/local/apache2/bin/apachectl stop
# /usr/local/apache2/bin/apachectl help
#
#
################################################################################
#
# 14. Explanation of PHP configure
#
# ./configure \\
# --with-apache2=../httpd-2.0.48
# --with-apxs2=/usr/local/apache2/bin/apxs
# --with-module=so
#
# Assumes Apache2 build next to php build directory. You need to have
# Apache compiled before you compile anything else. It does not need to
# be running to build PHP with it. PHP "make install" will append to the
# httpd.conf a Load directive. The INSTALL guide from PHP will tell you
# what to add to httpd.conf to make PHP work.
#
# --with-mysql
# PHP without MySQL, what are you nuts!
#
# --with-openssl=/usr/local/ssl/
# OpenSSL Encryption based on default install. This is practically
# required for your system, and a great way to get SSH installed along
# PHP.
#
# --with-sybase=/usr/local
# FreeTDS - connect to MS-SQL-Server or Sybase. Why install it?
# It makes connecting to SQL-Server quick and painless, comes with
# tsql, and freebcp. Is also essential for many ODBC drivers.
#
# --with-bz2
# bzip2 /bunzip2 support
# The highest compression utility available. Optional and won't cause
# problems.
#
# --with-flatfile
# Flatfile support.
#
# --with-zlib=/usr
# Zlib compression, useful and may be needed for other PHP stuff, and
# won't cause problems.
#
# --with-gd
# GD Graphics Library support, essential for a lot of PHP tools.
#
# --with-mcrypt
# Encryption support essential for Md5 and a great way to encrypt
# data. Make sure your system can compile with this, if not, remove
# from configure command.
#
################################################################################
#
# 15. Informix support
#
# Add --with-informix to ./configure
#
# make
# make install
#
# Make changes to /usr/local/lib/php.ini for Informix
#
# Restart Apache
#
# Test Settings
#
################################################################################