0

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?

DaveRandom
  • 87,921
  • 11
  • 154
  • 174
mltsy
  • 6,598
  • 3
  • 38
  • 51
  • Can you update your question with more details and if possible the exact error message? – Shoan Jun 09 '09 at 16:52

1 Answers1

0

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
  • 15,807
  • 3
  • 44
  • 57
  • 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 | 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 Nov 11 '09 at 14:57