The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP configure order

Discussion in 'General Discussion' started by Spiral, Jul 18, 2009.

  1. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    I was up late last night with a bunch of test servers last night originally playing around with testing Cpanel's current curlwrappers bug but noticed something different that I had not paid much attention to before:

    THE ORDER OF PARAMETERS PASSED TO CONFIGURE BY EASYAPACHE!

    EasyApache doesn't appear to care what order the options selected are passed to PHP's configure command but the order does indeed matter greatly and I suppose nobody thinks about it much since I have not really paid much attention to cpanel's building with EasyApache but then again I usually build PHP manually most of the time and have very little use for EasyApache so it does not matter much for me.

    Anyway, some items if passed in the wrong order won't function properly. For example, in a number of compile tests running EasyApache, every time PHP was built, EasyApache but the graphics library paths AFTER the command to build GD but in that order, GD will show up on phpinfo() but usually won't function correctly. Those need to actually be specified first!

    In the same manner, a number of library options given at the end of the configure parameters in most of the test EasyApache builds actually need to be specified earlier or a few other dependent options won't build correctly either and can amount to code bugs with some scripts.

    The following PHP was built manually last night and puts most of these options back into their correct compile order:
    I did some testing with the same options on servers put in EasyApache's default order and my own order based on both experience and research and found that a number of test scripts I threw against PHP triggering specific functions in various PHP compile option areas would work perfectly fine under my own manual builds but would have errors and fail under EasyApache builds where the only main differences between the builds were the order of configure options passed at compile time. To further confirm this, I also built a manual build using the same compile order as EasyApache as a control and it too also failed when passed certain test scripts even though the phpinfo screen would appear to have these functions setup correctly on the surface. This further confirmed the order of compile options relevance.

    It would not be difficult for Cpanel to throw in a couple lines of code to make sure certain compile options are passed before others but in the meantime, those who understand what I am talking about may want to build their PHP builds manually just to make sure everything builds correctly.
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Thanks. I opened an internal inquiry regarding this.
     
  3. cPDan

    cPDan cPanel Staff
    Staff Member

    Joined:
    Mar 9, 2004
    Messages:
    711
    Likes Received:
    3
    Trophy Points:
    18
    From what I can tell you must be experiencing another issue since order does not appear to matter. (Nor is such order dependency documented or consistent with typical configure scripts)

    As proof of this concept I've attached a phpinfo() screenshot highlighting that --with-gd was the very last ./configure option. In that same script I have it printing out the gd_info() data structure which is:

    Here is the script I used:

    PHP:
    <?
    $array=gd_info ();
    foreach (
    $array as $key=>$val) {
      
      if (
    $val===true) {
        
    $val="Enabled";
      }

      if (
    $val===false) {
        
    $val="Disabled";
      }

      echo 
    "$key$val <br />\n";

    }
    ?>

    <hr/>

    <? phpinfo(); ?>
    I'd guess the differences are elsewhere, since easyapache does much more than simply ./configure && make && make install (e.g. patches, environment, etc etc)

    If you can give a specific, reproducible, step-by-step directions && scripts that reproduce the problem you are seeing we'd be happy to investigate and see if there is a way to address the actual cause.
     

    Attached Files:

  4. cPDan

    cPDan cPanel Staff
    Staff Member

    Joined:
    Mar 9, 2004
    Messages:
    711
    Likes Received:
    3
    Trophy Points:
    18
    BTW, Same exact effect with --with-gd before the path specification.

    Will attach screen shot to that effect shortly
     
  5. cPDan

    cPDan cPanel Staff
    Staff Member

    Joined:
    Mar 9, 2004
    Messages:
    711
    Likes Received:
    3
    Trophy Points:
    18
    gd_info() output is exactly the same

    attached screen shot is the configure section of the script's phpinfo() demonstrating this time that --with-gd is before the various path specifying flags
     

    Attached Files:

Loading...

Share This Page