HipHop compiles PHP in a C executable. What happens with PHP errors ?
Is that harder to debug ?
edit : I looked through the documentation but didn’t find anything
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I did a couple of quick tests (haven’t have the time to play with hiphop as much as I’d like, unfortunately ;-( ) ; here are the results I got :
First of all, here’s the content of
test-2.php, which contains a parse error :Note : the string is not finished
Trying to run that with PHP, I get :
Trying to compile that with hiphop, I get :
i.e. the file with the parse error doesn’t compile — which stands to reason.
The error message has some informations that were present in the PHP’s error message — but not exactly as precise…
Which means you might want to try with PHP before trying to compile your application with hiphop : the error message given by PHP was more descriptive.
Now, let’s try with some runtime errors/warnings ; here’s the content of
test-1.php:Trying to run that file from Apache+PHP, you’d get three possible errors :
(I copied the file to my document root — which means the paths will not be the same for the errors with Apache)
First of all, calling
http://localhost/temp/test-1.php?test=1I get :And, trying
http://localhost/temp/test-1.php?test=2I get :And, finally, with
http://localhost/temp/test-1.php?test=3, I get :Now, compiling that
test-1.phpfile with hiphop and running it in web-server mode, I get this during the compilation phase, which means it is OK :And, then, launching the server :
Now, let’s try accessing those three URLs ; first, calling
http://localhost:8080/test-1.php?test=1I get :Unhandled error: Invalid operand type was used: not ArrayAccess objects.in the console from which I started the serverFor
http://localhost:8080/test-1.php?test=2, I get :plopDivision by zeroAnd, finally, for
http://localhost:8080/test-1.php?test=3, I get :plopHere, too, indications of errors are not quite as good as with PHP… at least with default options…
Judging from hiphop’s Runtime options wiki page, you can specify a config file that contains some options.
Here’s the content of the
config.txtI used :Re-starting the server, using the
--configswitch to point to that file :I should get more informations… let’s try our three requests again.
First, calling
http://localhost:8080/test-1.php?test=1I get :For
http://localhost:8080/test-1.php?test=2, I get :And, finally, for
http://localhost:8080/test-1.php?test=3, I get :plopf_file_put_contents/316: Permission deniedI didn’t try much more, but playing with that config file and the
--configswitch looks like an interesting idea 😉Note : I did those tests on Ubuntu 9.10 64bits — which is an officially supported system ; installation was quite easy.
Which means you could try those, doing an install in a Virtual Machine, for example : as long as you know a bit about Linux and compiling software, installing hiphop is not an impossible task.