Maybe I am wrong but as far as I know FOG (1.2.0) does not add other repositories (like PPA)!
With saying this is not a FOG issue I don’t mean that we don’t want to help. It’s just that we know a lot about FOG but heaps less about the inner workings of ubuntu. Maybe you can get more help asking this (PHP package question) in a forum focusing on Ubuntu.
Looking through the output you posted I just found this: Impossibile allocare memoria
Maybe your disk is full?? What do you see running this command: