Until OpenBSD 3.4 shipped (Well, ok, 3.3-devel a couple of months back), the x86 platform was not ELF – meaning that shared libraries for various functions just would not work easily – and with the majority of the world not enjoying PIC libraries, it was ‘just easier’ to compile things statically – if at all possible to make things work dynamically.
Zend has not offered an updated optimize module for PHP for ages, and then, they only offered one unsupported build. Thus, seeking any form of improved performance possible, I’ve opted to try to make APC work, which has been my old standard for a couple of years now.
With PHP 4.3.3, the module support structure’s been slightly changed, ‘config.in’ is no longer supported for third party modules. This meant that I had to create a config.m4 that is functional with PHP 4.3.3. It was a fairly trivial exercise.
Here’s a little one I threw together:
# Shawn’s modified config.m4 for APC 2.0b- This works with PHP 4.3.3, compiling as a shared library. Remember to setup your
- zend_extension=”/path/to/apc.so” in php.ini after installing!
PHP_ARG_WITH(apc,for APC support,
[ —without-apc do not include APC support [default=yes]],yes)
if test ”$PHP_APC” != “no”; then
PHP_NEW_EXTENSION(apc, apc.c apc_compile.c apc_sem.c apc_sma.c apc_zend.c apc_cache.c apc_main.c apc_shm.c apc_stack.c php_apc.c, $ext_shared)
PHP_SUBST(ZLIB_SHARED_LIBADD)
AC_DEFINE(HAVE_APC, 1, [ ])
AC_CACHE_CHECK(for union semun,php_cv_semun,
AC_TRY_COMPILE([
#include
fi
With the newly standardized ELF format on this system, I’ve opted to attempt to create the module shared rather than static; which has always been a pain. I phpize’d the directory after installing my modified config.m4, made, installed, loaded as a zend_extension in php.ini, and it works! Yay! My life got a whole lot easier!