I'm trying to install XHP on my OSX Lion and I'm getting random segmentation faults. The same program sometimes fails and sometimes runs. Even a program that imports init.php only.

<?php
include 'xhp/php-lib/init.php';
$href = 'http://www.facebook.com';
echo <a href={$href}>Facebook</a>;

Sometimes runs, sometimes fails with

Segmentation fault: 11
有帮助吗?

解决方案

There's two gotchas here, XHP doesn't work with the pre-installed PHP and cannot be compiled with the latest XCode 5 because it's missing gcc.

Homebrew to the rescue!

brew tap brew tap josegonzalez/php
brew install php55
brew tap homebrew/dupes
brew install apple-gcc42 
brew install -cc=gcc-4.2 php55-xhp
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top