Compiling php 5.3

Source: 5.3.0 latest stable build of 5.3 branch

./configure –prefix=/usr/local/php5


checking libxml2 install dir… no
checking for xml2-config path…
configure: error: xml2-config not found.
Please check your libxml2 installation.

After a yum install libxml2-devel.x86_64:

configure: error: Cannot find OpenSSL’s

yum install openssl-devel [fixed it]

Found a good resource at


Apache Startup Script

The CentOS startup script for apache is located at /etc/init.d/httpd. I backed this file up to /home/lasota/saved/httpd_d/httpd and replaced it with:

# apache
# chkconfig:
# description: Start up the Apache web server.
# Source function library.
. /etc/init.d/functions
case “$1” in
if [ -f $APACHE_HOME/bin/apachectl ]; then
echo $”Starting Apache”
$APACHE_HOME/bin/apachectl start
if [ -f $APACHE_HOME/bin/apachectl ]; then
echo $”Stopping Apache”
$APACHE_HOME/bin/apachectl stop
echo $”Usage: $0 {start|stop}”
exit 1
exit $RETVAL

This script functions and starts the proper apache (the one I compiled from source). Question: does it survive a yum reinstall?

The startup script above does survive a

yum reinstall httpd

I wonder if some other yum update or reinstall would clobber the startup script though. I will ask Peter.

MySQL configure script error

Following the install directions for MySQL source distribution:

shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf –
shell> cd mysql-VERSION
shell> ./configure -prefix=/usr/local/mysql
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> bin/mysql_install_db –user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> bin/mysqld_safe –user=mysql &

I ran the configure script for MySQL. It cannot find the termcap/ncurses library. Several dozen searches later I am trying an install of ncurses-devel.

$yum install ncurses-devel.i386
$yum install ncurses-devel.x86_64

That seems to work. OK now for the make.

bash: make: command not found
$whereis make
make: /usr/share/man/man1p/make.1p.gz

Make is not around or can’t be found. Hmmmn.

$yum install make.x86_64


g++ -DDEFAULT_BASEDIR=”/usr/local” -DMYSQL_DATADIR=””/usr/local/var”” – DDEFAULT_CHARSET_HOME=””/usr/local”” -DSHAREDIR=””/usr/local/share/mysql”” –
DDEFAULT_SYSCONFDIR=””/usr/local/etc”” -DHAVE_CONFIG_H -I. -I../include -I../zlib -I../include –
I../include -I. -O -fno-implicit-templates -fno-exceptions -fno-rtti -c -o my_new.o
../depcomp: line 571: exec: g++: not found

Looking for g++

yum install gcc-c++


g++ -DDEFAULT_BASEDIR=”/usr/local” -DMYSQL_DATADIR=””/usr/local/var”” -DDEFAULT_CHARSET_HOME=””/usr/local”” -DSHAREDIR=””/usr/local/share/mysql”” -DDEFAULT_HOME_ENV=MYSQL_HOME -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX -DDEFAULT_SYSCONFDIR=””/usr/local/etc”” -DHAVE_CONFIG_H -I. -I../include -I../zlib -I../include -I../include -I. -O -fno-implicit-templates -fno-exceptions -fno-rtti -c -o my_new.o ../include/my_global.h:1105: error: redeclaration of C++ built-in type ‘bool’

MySQL forums lead to advice wiping with make clean and doing a configure again. Confusion between gcc and g++ compiler.

That worked. MySQL 5.1.39 installed.