Monday, December 29, 2008

Building PHP5 on Linux

 ./configure options for PHP 5.2.6 Build on Linux running 2.6.18-92 Kernel

# ./configure --disable-static --disable-debug  --prefix=/usr/local/apache2/php --with-config-file-scan-dir=/usr/local/apache2/php --enable-libxml  --with-libxml-dir=/usr/local/lib  --enable-reflection --enable-spl --enable-zend-multibyte --with-regex=system  --with-tidy  --enable-zip --enable-bcmath --with-bz2=shared --enable-calendar --with-curl=shared --enable-dba --enable-exif --enable-ftp --with-gd --enable-gd-native-ttf --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib-dir=/usr --with-gettext=shared  --with-gmp=shared --with-imap-ssl --with-imap --enable-mbstring --with-mcrypt=shared --with-mhash=shared --with-mysql --with-mysqli --with-openssl-dir --with-pdo-mysql --enable-sockets --with-xsl --with-zlib --with-apxs2=/usr/local/apache2/bin/apxs --disable-cgi --enable-pcntl --enable-soap --enable-dbase --enable-sysvmsg --enable-sysvsem --enable-sysvshm   --with-zlib  --with-gdbm  --with-curl --enable-soap --with-kerberos

 # make && make install

# chown -R apache.web /usr/local/apache2/

Monday, March 10, 2008

Libpq vs Libpqxx

Libpq is the C application programmer's interface to PostgreSQL, and Libpqxx is the C++ application programmer's interface to PostgreSQL. Libpqxx actually wraps the functions in Libpq. However, Libpqxx is slower than Libpq, and Libpqxx 2.6.9 is not compatible with PostgreSQL 8.3 and GCC 4.1.x on Red Hat / Fedora 5.

After using Libpqxx for the past 5 years on a PostgreSQL 7.4 database, I migrated the database to 8.3 and Libpqxx to the current stable version - 2.6.9. I am running dual quad-core Xeon processors on a 64-bit Red Hat Enterprise 5 Server with GCC 4.1.x. Libpqxx is just a wrapper library around Libpq. There are performance issues because Libpq can be called directly without incurring object / template overhead. After deciding to migrate our codebase to use Libpq, I was very pleased with the results. Error checking is simple, code execution is faster, and library / executable sizes were reduced.