Php – Segmentation fault when running any PHP

PHPsegmentation-fault

Update: I fixed this by running apt-get upgrade which updated many php packages, it must of been a buggy php extension which is now fixed

I have vagrant running homestead (Ubuntu 14.10), when I ssh onto the VM and simply type

php -v

or even

php

it says

Segmentation fault

I'm not even trying to run a script at the moment. I've tried rebooting the VM. How can I go about finding the problem?

Update: I can load php through the browser fine! I seems to just be the cli

Update 2: Strace: http://pastebin.com/txWwLf5k

Best Answer

That's related to memory allocation. The cause could be a faulty PHP configuration, for example see if the 'memory_limit' value in php.ini is below the one the machine offers. If in doubt, read about "shared memory" setting for your OS.