Mild Ramblings of a Techhead
Recent
Photo
Sets

Posted
14 April 2011 @ 10am

Tagged
PHP-MySQL, Programming, Web

Latest PHP/Mysql/Apache From Source

I setup a new 64-bit virtual server running CentOS 5.6.    It was a pretty much vanilla install of CentOS minus Apache, PHP and MySQL

I  decided to compile MySQL, PHP and Apache from Source.  Everything was installed in /usr/local/ I created sym links to the version directories to keep a copy of the programs just in case anything went wrong.

ln -s /usr/local/php-5.3.6 /usr/local/php
ln -s /usr/local/mysql-5.5.11 /usr/local/mysql
ln -s /usr/local/httpd-2.2.17 /usr/local/httpd

edited /etc/profile to have /usr/local/mysql/bin and /usr/local/php/bin in PATH variable. Below was added to the bottom of /etc/profile

PATH=$PATH:/usr/local/mysql/bin:/usr/local/php/bin
export PATH

Steps to Install MySQL Apache and PHP from source

1. Had to install and compile Cmake first for MySQL from source (cmake.org).  I installed it to /usr to keep things simple.

  • cmake .
  • make -j3
  • make install
  • created mysql user and group
  • changed ownership of data dir to mysql
  • run mysql_install_db from MYSQL_INSTALL_DIR/scripts/mysql_install_db –user=mysql

2. Apache was configured with:

./configure --prefix=/usr/local/httpd --enable-ssl --enable-so --enable-rewrite
3. yum install libicu-devel
4. yum install libmcrypt-devel
5. yum install aspell-devel

6. For PHP, I used the following configure options.  Notice this is for a 64 bit install.

./configure --prefix=/usr/local/php --with-libdir=lib64 --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-sqlite-utf8 --with-apxs2=/usr/local/httpd/bin/apxs --with-mcrypt=/usr/local/mcrypt --with-openssl --with-bz2 --with-curl --with-freetype-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-gettext --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-pspell --with-zlib --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --enable-zip --with-pear --enable-calendar --enable-mbstring --with-ldap=/usr --enable-soap --with-xmlrpc --with-gd --enable-intl


No Comments Yet


There are no comments yet. You could be the first!

Leave a Comment