views:

115

answers:

2

I'm trying to get PHP compiled with EXIF support. Every time I try to build PHP 5.2.9 on my virtual dedicated server running CentOS 5.3, it fails when it gets to building zend_execute.lo. I tried compiling just that file by itself, and it fails. Says out of memory allocating [####] bytes after... something.

How can I get PHP compiled?

A: 

Hmm... I tried compiling ffmpeg just now, and also got an out of memory error. Something tells me I might actually me out of memory... I haven't heard back from support yet, but I'm pretty sure my VPS must just have a shamefully small amount of RAM.

mltsy
A: 

The zend_vm_execute.c file includes the whole executor and compiling it can easily consume more than 100 MB of memory. The suggested oslution is to compile on a box with more memory. If that - for whatever reason - is not possible you might try to disable compiler optimizations (take the command which is printed on your screen and replace -=2 with -O0 and run it manually) which will hurt your performance or you can try using another VM implementation using one of these options:

--with-zend-vm=CALL
--with-zend-vm=SWITCH
--with-zend-vm=GOTO

But that agian might hurt oyur performance and give other trouble. As said: Get a box with more meory and compile there to be safe - you don'T have to compile on the system you're running PHP on as long as the libraries used are using the same version.

johannes
It turns out I did just need more memory. I didn't try these methods in particular, but they are good tips for those who aren't able to just increase their memory :) Thanks!
mltsy