1 - PHP 5.2.1, 64 bit. Installed the ODBC driver, works fine using isql! I'm on Ubuntu Feisty. I try the odbc functions in PHP. Strangely enough, on some queries PHP crashes and Apache wants me to download a blank .php file. No errors, no nothing. So I try running the script using CLI, I get the following output:
Code: Select all
snip: complete generated page output, using odbc_result_all();
freeing result, using odbc_free_result()
[...]
zend_mm_heap corrupted2 - PHP 5.2.3, still 64 bit and Ubuntu. Still the same problem, now I get:
Code: Select all
[Thu Jul 19 21:02:51 2007] [notice] child pid 12548 exit signal Segmentation fault (11)3 - XAMPP with PHP 5.2.3, this is a 32 bit installation. I fetch all the 32 bit libs and the use the 32 bit ODBC driver. It works, no errors. But I would rather avoid using a 32 bit mess on a 64 bit OS... So either php-odbc 64 bit is buggy, or the 64 bit driver. But both work fine using isql...
4 - CentOS ("maybe it's a bug in the Ubuntu packages"), 64 bit. PHP 5.1.6. Again, a different error:
Code: Select all
freeing result*** glibc detected *** /usr/bin/php: free(): invalid pointer: 0x00000000153fc920 ***Apache is still failing though, how to set that environment variable. I try using the PHP putenv(); function, which fails. "Maybe I have to do this before loading PHP, makes sense." So I add this to my Apache configuration:
Code: Select all
SetEnv MALLOC_CHECK_ 15 - Back at Ubuntu with PHP 5.2.1 64 bit. I try the MALLOC_CHECK_ trick. Again the blank page. I try running it in CLI, again zend_mm_heap corrupted. Apparently this version is doing its own memory management. I find that in PHP 5.2.x you can use ZEND_MM_SEG_SIZE, ZEND_MM_TYPE and USE_ZEND_ALLOC, so I try exporting:
Code: Select all
export ZEND_MM_SEG_SIZE=1M
export ZEND_MM_TYPE=mmap_anon
export USE_ZEND_ALLOC=0Code: Select all
Zend Memory Management => disabledCode: Select all
SetEnv USE_ZEND_ALLOC 0Code: Select all
Zend Memory Management: enabled(6 - Last resort, trying the USE_ZEND_ALLOC and MALLOC_CHECK_ tricks on PHP 5.2.3. Doesn't work either.)
So the question is, in short: can I disable Zend Memory Management in php-mod (Apache)?
Thanks for reading all this and for your help.