Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 683343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:41:48+00:00 2026-05-14T01:41:48+00:00

HipHop compiles PHP in a C executable. What happens with PHP errors ? Is

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:41:48+00:00Added an answer on May 14, 2026 at 1:41 am

    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 :

    <?php
    
    echo "what with a parse error ?
    

    Note : the string is not finished

    Trying to run that with PHP, I get :

    $ php test-2.php 
    PHP Parse error:  syntax error, unexpected $end, expecting T_VARIABLE or T_DOLLAR_OPEN_CURLY_BRACES or T_CURLY_OPEN in /home/squale/temp/hiphop-php/tests/test-2.php on line 5
    
    Parse error: syntax error, unexpected $end, expecting T_VARIABLE or T_DOLLAR_OPEN_CURLY_BRACES or T_CURLY_OPEN in /home/squale/temp/hiphop-php/tests/test-2.php on line 5
    

    Trying to compile that with hiphop, I get :

    $ /home/squale/temp/hiphop-php/hiphop-php/src/hphp/hphp test-2.php --keep-tempdir=1 --log=3
    running hphp...
    creating temporary directory /tmp/hphp_JdsWcU ...
    parsing inputs...
    parsing ./test-2.php...
    parsing inputs took 0'00" (0 ms) wall time
    running hphp took 0'00" (154 ms) wall time
    Exception: Unable to parse file: ./test-2.php
     (Line: 5, Char: 0): syntax error, unexpected $end
    

    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 :

    <?php                                                                                                                                                                                                                                                                          
    
    error_reporting(E_ALL);                                                                                                                                                                                                                                                        
    ini_set('display_errors', 'On');                                                                                                                                                                                                                                               
    
    if ($_GET['test'] == '1') {                                                                                                                                                                                                                                                    
            $data = (object)array(10);                                                                                                                                                                                                                                             
            echo $data[0];                                                                                                                                                                                                                                                         
    } else if ($_GET['test'] == '2') {                                                                                                                                                                                                                                             
            echo 10/0;                                                                                                                                                                                                                                                             
    } else if ($_GET['test'] == '3') {                                                                                                                                                                                                                                             
            file_put_contents('/bin/non-allowed', 'hello !');                                                                                                                                                                                                                      
    }
    
    echo "plop\n";
    

    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=1 I get :

    Fatal error: Cannot use object of type stdClass as array in /home/squale/developpement/tests/temp/test-1.php on line 8
    

    And, trying http://localhost/temp/test-1.php?test=2 I get :

    Warning: Division by zero in /home/squale/developpement/tests/temp/test-1.php on line 10
    plop 
    

    And, finally, with http://localhost/temp/test-1.php?test=3, I get :

    Warning: file_put_contents(/bin/non-allowed) [function.file-put-contents]: failed to open stream: Permission denied in /home/squale/developpement/tests/temp/test-1.php on line 12
    plop
    

    Now, compiling that test-1.php file with hiphop and running it in web-server mode, I get this during the compilation phase, which means it is OK :

    $ /home/squale/temp/hiphop-php/hiphop-php/src/hphp/hphp test-1.php --keep-tempdir=1 --log=3
    running hphp...
    creating temporary directory /tmp/hphp_xXZ8US ...
    parsing inputs...
    parsing ./test-1.php...
    parsing inputs took 0'00" (1 ms) wall time
    pre-optimizing...
    pre-optimizing took 0'00" (0 ms) wall time
    inferring types...
    inferring types took 0'00" (0 ms) wall time
    post-optimizing...
    post-optimizing took 0'00" (0 ms) wall time
    creating CPP files...
    creating CPP files took 0'00" (32 ms) wall time
    compiling and linking CPP files...
    
    compiling and linking CPP files took 0'39" (39807 ms) wall time
    running executable /tmp/hphp_xXZ8US/program --file test-1.php...
    plop
    all files saved in /tmp/hphp_xXZ8US ...
    running hphp took 0'40" (40054 ms) wall time
    

    And, then, launching the server :

    $ /tmp/hphp_xXZ8US/program -m server -p 8080
    Could not mlockall
    loading static content...
    loading static content took 0'00" (0 ms) wall time
    page server started
    admin server started
    all servers started
    

    Now, let’s try accessing those three URLs ; first, calling http://localhost:8080/test-1.php?test=1 I get :

    • Nothing in the browser
    • Unhandled error: Invalid operand type was used: not ArrayAccess objects. in the console from which I started the server

    For http://localhost:8080/test-1.php?test=2, I get :

    • In the browser : plop
    • In the console from which I started the browser : Division by zero

    And, finally, for http://localhost:8080/test-1.php?test=3, I get :

    • In the browser : plop
    • In the console : nothing

    Here, 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.txt I used :

    Log {
        Level = Verbose
        NoSilencer = true
        AlwaysLogUnhandledExceptions = true
        RuntimeErrorReportingLevel = 6143
        Header = false
        InjectedStackTrace = true
        NativeStackTrace = true
        MaxMessagesPerRequest = -1
    }
    
    ErrorHandling {
        CallUserHandlerOnFatals = true
        NoInfiniteLoopDetection = false
        NoInfiniteRecursionDetection = false
        MaxStackDepth = 1000
        ThrowBadTypeExceptions = true
        ThrowNotices = true
        NoticeFrequency = 1    # 1 out of these many notices to log
        WarningFrequency = 1   # 1 out of these many warnings to log
        AssertActive = false
        AssertWarning = false
      }
    

    Re-starting the server, using the --config switch to point to that file :

    $ /tmp/hphp_xXZ8US/program -m server -p 8080 --config=config.txt
    Could not mlockall
    loading static content...
    loading static content took 0'00" (0 ms) wall time
    page server started
    admin server started
    all servers started
    

    I should get more informations… let’s try our three requests again.

    First, calling http://localhost:8080/test-1.php?test=1 I get :

    • Same as before

    For http://localhost:8080/test-1.php?test=2, I get :

    • Same as before

    And, finally, for http://localhost:8080/test-1.php?test=3, I get :

    • In the browser : plop
    • In the console : a new error message that I didn’t get before : f_file_put_contents/316: Permission denied

    I didn’t try much more, but playing with that config file and the --config switch 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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't know too much about HipHop or PHC, but i do know that
I've been reading a lot about Facebook's PHP HipHop project, but one thing I
I've looked at this article- HipHop PHP (was Hyper PHP by Facebook) However, recently
I am a PHP developer and I have always thought that micro-optimizations are not
From what I've read about PHP HipHop – it serves the purpose of converting
I'm following this Hiphop installation guide: https://github.com/facebook/hiphop-php/wiki/Building-and-installing-on-ubuntu-10.10 And when I try to make it,
The most of devepolers know something about Facebook's Hiphop for php, I want to
I have a C# application that needs to call a PHP script, and get
I think HipHop for PHP is an interesting tool. It essentially converts PHP code
I am trying to install hiphop on my pc but i am having problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.