PHP

update (in response to a recent comment): this patch is already in the 5.1 tree; please test that instead; thanks!

[patch updated again: if you have a BSD-ish system that complained about "making too many open files", please try it again]

[patch updated: please try it again. Note that if you only have "mawk" you should install GNU awk instead, as mawk is broken]

I've created this patch to force extensions with dependencies on other extensions to be initialized in the correct order when they are compiled statically into the core of PHP.

It's known to work on Linux (and Tru64--thanks Magnus), but we'd really like to know if it works on other systems too--we don't have access to them, and we really want to get this into PHP 5.0 (due in July!).

So, please test it if you have SunOS, Solaris, BSD, HP UX, AIX, IRIX or any other "weird" unix systems.

Instructions:

Checkout PHP 5 (or download a snapshot from snaps.php.net)

Apply the patch:

   cd php5
   curl http://www.php.net/~wez/configure-deps.diff | patch -p0
   ./configure

Now look in main/internal_functions.c and/or main/internal_functions_cli.c

You should see something like this in the file. Each line corresponds to the extensions you enabled through configure; your list may be longer or shorter depending on how much stuff you compile into PHP.

   zend_module_entry *php_builtin_extensions[] = {
	phpext_libxml_ptr,
	phpext_xml_ptr,
	phpext_tokenizer_ptr,
	phpext_sysvshm_ptr,
	phpext_sysvsem_ptr,
	phpext_sysvmsg_ptr,
	phpext_standard_ptr,
	phpext_sqlite_ptr,
	phpext_simplexml_ptr,
	phpext_spl_ptr,
	phpext_session_ptr,
	phpext_posix_ptr,
	phpext_pcre_ptr,
	phpext_pcntl_ptr,
	phpext_gd_ptr,
	phpext_ftp_ptr,
	phpext_exif_ptr,
	phpext_ctype_ptr,
	phpext_calendar_ptr,
	phpext_bz2_ptr,
	phpext_bcmath_ptr,
	phpext_zlib_ptr,
};

If you see libxml before xml, it's worked. If you see repeated entries, it broke.

Please try building it now too.

If it all works, please either comment here, or send an email to internals@lists.php.net indicating which platform you used.

If it breaks while compiling main/internal_functions.c and/or main/internal_functions_cli.c, please let me know by email to wez@php.net.

Prefix the subject with [DEPS-PATCH], and include the name of your platform and the internal_functions.c file.

Thanks for helping to make PHP 5 better :-)


View Comments