Get the most out of your Centmin Mod LEMP stack
Become a Member

Beta Branch update inc/php_upgrade.inc add PHPPGO_INDEXPATH variable support in 123.09beta01

Discussion in 'Centmin Mod Github Commits' started by eva2000, Oct 1, 2016.

  1. eva2000

    eva2000 Administrator Staff Member

    55,225
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    9:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    update inc/php_upgrade.inc add PHPPGO_INDEXPATH variable support in 123.09beta01

    You can set in persistent config file /etc/centminmod/custom_config.inc the variable PHPPGO_INDEXPATH which you point to full path of your PHP web applications index.php page which is used for Profiled Guided Optimization PHP 7 training. This works when you set PHP_PGO='y' for PHP 7 based recompile/compiles via centmin.sh menu option 5 as outlined at Added Profile Guided Optimizations To Boost PHP 7 Performance

    So in your persistent config file /etc/centminmod/custom_config.inc set and set PHPPGO_INDEXPATH to say the full path to where you installed wordpress blog i.e. /home/nginx/domains/domain.com/public/index.php for wordpress index.php page:

    Code (Text):
    PHP_PGO='y'
    PHPPGO_INDEXPATH='/home/nginx/domains/domain.com/public/index.php'
    



    then run centmin.sh menu option 5 to recompile PHP 7 (only works on PHP 7 not PHP 5.6 and lower).

    Continue reading...

    123.09beta01 branch
     
    Last edited: Oct 2, 2016
  2. Sunka

    Sunka Well-Known Member

    1,150
    325
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +525
    Local Time:
    1:07 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    For xenforo we do not need it to setup PHPPGO_INDEXPATH variable, or?
     
  3. eva2000

    eva2000 Administrator Staff Member

    55,225
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    9:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    if you want you can for train PHP 7 for xenforo :)
     
  4. Sunka

    Sunka Well-Known Member

    1,150
    325
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +525
    Local Time:
    1:07 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    Would there be some bad things because of that?

    Index path should be like this?
    If something wrong happened, I have to only remove PHPPGO_INDEXPATH variable and recompile php again (I could leave as it is now PHP_PGO='y')?
     
  5. eva2000

    eva2000 Administrator Staff Member

    55,225
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    9:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yes

    try and see :)
     
  6. Sunka

    Sunka Well-Known Member

    1,150
    325
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +525
    Local Time:
    1:07 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    Let try then!
    (that is my 5th recompiling today because of your code updating (y))
     
  7. Sunka

    Sunka Well-Known Member

    1,150
    325
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +525
    Local Time:
    1:07 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    Done. And now, what?

    Php "train" between two recompiling. What to do now?
     
  8. eva2000

    eva2000 Administrator Staff Member

    55,225
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    9:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    PHP_PGO='y' does it all both recompiles during single centmin.sh menu option 5 run so nothing else to do but use your sites like normal :)
     
  9. hendry

    hendry Member

    59
    14
    8
    Sep 19, 2016
    Ratings:
    +18
    Local Time:
    6:07 AM
    nginx/1.11.4
    MariaDB 10
  10. eva2000

    eva2000 Administrator Staff Member

    55,225
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    9:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    good to hear - more speed is good :D
     
  11. elargento

    elargento Member

    352
    17
    18
    Jan 4, 2016
    Ratings:
    +44
    Local Time:
    8:07 PM
    10
    Did you notice any difference?
     
  12. Sunka

    Sunka Well-Known Member

    1,150
    325
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +525
    Local Time:
    1:07 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    I am not sure :LOL:
    But probably it is better.
    It can not hurt anyway ;)
     
  13. Jimmy

    Jimmy Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    7:07 PM
    I have PHP_PGO='y' on both my live and dev server. On my dev server I see a database called pgo_train, but that dbase is absent from my live server. Just curious why it's showing up on one server, but absent from the other. Both servers were setup exactly the same.
     
  14. eva2000

    eva2000 Administrator Staff Member

    55,225
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    9:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    both PHP 7.x based ? PGO only supported by PHP 7.x

    PGO only happens up php upgrade routines via centmin.sh menu option 5 and not initial install routines usually
     
  15. Jimmy

    Jimmy Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    7:07 PM
    Yea, I'm on 7.1.4. I installed php a couple of times. Always on 7.1.4. Just did another php install via option 5 on the live machine, still no pgo_train in the database.
     
  16. eva2000

    eva2000 Administrator Staff Member

    55,225
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    9:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    To troubleshoot, you need to check the the php upgrade logs at /root/centminlogs and instructions under Sharing logs and errors heading for using Pastebin.com or Gists to share a sanitised version of the contents of the nginx_upgrade and php_upgrade logs. You can see full details at How to troubleshoot Centmin Mod initial install issues

    if you type this command it lists all logs in date ascending order so latest log at bottom
    Code (Text):
    ls -lArt /root/centminlogs

    so copy the entire contents of latest php_upgrade log to gist.github.com or pastebin.com

    you can use grep to filter the logs, i.e. look for nginx_upgrade or php in log name
    Code (Text):
    ls -lahrt /root/centminlogs/ | egrep 'nginx_upgrade|php_upgrade'
    

    Code (Text):
    ls -lahrt /root/centminlogs/ | egrep 'nginx_upgrade|php_upgrade'
    -rw-r--r--  1 root root  2.6M Oct  3 03:48 centminmod_1.2.3-eva2000.09.001_031016-034409_php_upgrade.log
    -rw-r--r--  1 root root  664K Oct 12 09:24 centminmod_1.2.3-eva2000.09.001_121016-092406_nginx_upgrade.log
    

    So the last php upgrade log was named centminmod_1.2.3-eva2000.09.001_031016-034409_php_upgrade.log and located at /root/centminlogs/centminmod_1.2.3-eva2000.09.001_031016-034409_php_upgrade.log
    then use cat command to output the contents of that log.

    clear your ssh window buffer/screen and type
    Code (Text):
    cat /root/centminlogs/centminmod_1.2.3-eva2000.09.001_031016-034409_php_upgrade.log

    then select and copy and paste output to pastebin.com or gist.github.com file to share. If your SSH client's scroll buffer isn't large enough using cat might not output the entire log file contents, so you may need to download the log and use local text editor to open and copy and paste.

    so only need content of a specific log, in this case most recent php_upgrade.log logs
     
  17. Jimmy

    Jimmy Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    7:07 PM
  18. eva2000

    eva2000 Administrator Staff Member

    55,225
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    9:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Looks like PGO training script is giving 500 internal errors
    Code (Text):
    PHPMUVER = 7.1
    PHP_PGO = y
    make -j14 prof-gen
    CCACHE_DISABLE=1 make PROF_FLAGS=-fprofile-generate all
    make[1]: Entering directory `/svr-setup/php-7.1.4/fpm-build'
    
    Build complete.
    Don't forget to run 'make test'.
    
    make[1]: Leaving directory `/svr-setup/php-7.1.4/fpm-build'
    
    real    0m0.043s
    user    0m0.034s
    sys    0m0.009s
    /svr-setup/php_pgo_training_scripts /svr-setup/php-7.1.4/fpm-build
    Saved working directory and index state WIP on master: 3f4a289 Merge pull request #1 from bogdanandone/master
    HEAD is now at 3f4a289 Merge pull request #1 from bogdanandone/master
    Already up-to-date.
    /svr-setup/php-7.1.4/fpm-build
    PHP Parse error:  syntax error, unexpected 'C' (T_STRING), expecting ',' or ')' in /svr-setup/php_pgo_training_scripts/constants.php on line 32
    ./sapi/cgi/php-cgi -T100 /svr-setup/php_pgo_training_scripts/index.php
    PHP Parse error:  syntax error, unexpected 'C' (T_STRING), expecting ',' or ')' in /svr-setup/php_pgo_training_scripts/constants.php on line 32
    Status: 500 Internal Server Error
    Content-type: text/html; charset=UTF-8
    

    did you set a PHPPGO_INDEXPATH path ? that is buggy for anything other than wordpress so don't set the PHPPGO_INDEXPATH variable and try

    or could be PHP 7.1 incompatibilities
     
  19. Jimmy

    Jimmy Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    7:07 PM
    I didn't set the PHPPGO_INDEXPATH because I'm going to have several sites on the live server. My dev server didn't have that set either, but added the dbase.
     
  20. eva2000

    eva2000 Administrator Staff Member

    55,225
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    9:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    strange testing right now and PHP 7.1.4 with PHP_PGO='y' work fine on CentOS 7.3 123.09beta01 system