Discover Centmin Mod today
Register Now

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,234
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    1:13 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    You can try deleting directory at /svr-setup/php_pgo_training_scripts and recompile php via centmin.sh menu option 5 and see

     
  2. Jimmy

    Jimmy Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    11:13 AM
    Give me a few minutes to recompile.
     
  3. Jimmy

    Jimmy Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    11:13 AM
    Nope, didn't add the dbase. Did you want to see the log?
     
  4. eva2000

    eva2000 Administrator Staff Member

    55,234
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    1:13 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    you can check the log for 500 internal errors to confirm if it's same issue

    your previous log showed these
    Code (Text):
    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
     
  5. Sunka

    Sunka Well-Known Member

    1,150
    325
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +525
    Local Time:
    5:13 PM
    Nginx 1.17.9
    MariaDB 10.3.22
    xenforo works fine too
     
  6. eva2000

    eva2000 Administrator Staff Member

    55,234
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    1:13 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    it doesn't last time i tried it bugged out IIRC
     
  7. Jimmy

    Jimmy Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    11:13 AM
    Yup, same issue.
    Code:
    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
    Do you think there is an issue with php? Should I just re-install the system? Don't really want to run into issues with php on the live server.
     
  8. eva2000

    eva2000 Administrator Staff Member

    55,234
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    1:13 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    tried downgrade to PHP 7.0.18 and see ?
     
  9. Jimmy

    Jimmy Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    11:13 AM
    I downgraded to 7.0.18 still getting the same error in the log.

    Time to reinstall?
     
  10. eva2000

    eva2000 Administrator Staff Member

    55,234
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    1:13 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    ah line 32 of /svr-setup/php_pgo_training_scripts/constants.php is the php scripts DB_PASSWORD definition related to mysql root user, so must be the database password has a character in it that php script doesn't like the password is derived from mysql root password in /root/.my.cnf
     
  11. Jimmy

    Jimmy Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    11:13 AM
    That's probably it. The mysql password on the dev server is the stock one for install.

    On my live server I'm using a password with special characters which results in me having to add ' ' in the .my.cnf. Example:
    Code:
    [client]
    user=root
    password='this#is#my#password#with#special#characters'
    
    As a result the password in the constants.php file has double ' ' password ' '.

    You might have to create a check to make sure that if the .my.cnf is using ' ' because of the complexity of the password, php_pgo doesn't double ' ' <password> ' ' the entry. When I tried to build it again the entry looks like this (notice the extra ' ' around the password):
    Code:
    define('DB_USER', 'root');
    define('DB_PASSWORD', ''this#is#my#password#with#special#characters'');
    define('DB_NAME', 'pgo_train');
    define('DB_HOST', 'localhost');
    
    I try to use special characters where I can. I'm sure that someone is going to use special characters in their mysql root password, like I did.
     
  12. eva2000

    eva2000 Administrator Staff Member

    55,234
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    1:13 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Updated 123.09beta01 with fix :)
     
  13. Jimmy

    Jimmy Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    11:13 AM
    Thanks! I'll test it out later when I get back home. :)

    It's working! Thanks again! (y)

    Just a note: Anyone with this issue will have to go in and delete the below directory before it works:
    Code:
    # cd /
    # rm -rf /svr-setup/php_pgo_training_scripts
     
    Last edited: May 5, 2017
  14. eva2000

    eva2000 Administrator Staff Member

    55,234
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    1:13 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    excellent thanks for the confirmation :)
     
  15. Jimmy

    Jimmy Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    11:13 AM
    Did you roll this back? I'm getting the double single quotes again. I reinstalled the server post this fix.

    UPDATE:

    It works the first time (initial install), I can delete the php_pgo_training_scripts directory and it works (post initial install). After that, it does the same thing as above populating the constants.php file with ' ' password ' '. Might need an additional check somewhere when php and php_pgo_training_scripts has already been setup and that directory is present.
     
    Last edited: May 7, 2017
  16. eva2000

    eva2000 Administrator Staff Member

    55,234
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    1:13 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    whoops needed an additional fix for re-ran php upgrades :D

    added 2nd fix :)
     
  17. Jimmy

    Jimmy Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    11:13 AM
    Works. Second build in a row, no issues. (y)
     
  18. BamaStangGuy

    BamaStangGuy Active Member

    668
    192
    43
    May 25, 2014
    Ratings:
    +272
    Local Time:
    10:13 AM
    What if we have more than one wordpress site? How do we define more than one PHPPGO_INDEXPATH?
     
  19. eva2000

    eva2000 Administrator Staff Member

    55,234
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    1:13 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    You don't need to manually optimise for wordpress, mediawiki or drupal as their PHP execution paths in PHP 7 compiles are already optimised out of the box when you set PHP_PGO='y' and recompile PHP 7
     
  20. eva2000

    eva2000 Administrator Staff Member

    55,234
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    1:13 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    updated example of this in action with 25% better performance for the PGO specifically trained script PHP - PHP 7.3 vs 7.2 vs 7.1 vs 7.0 (PHP-FPM) Benchmarks :)