Join the community 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

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    12:59 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    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,704
    365
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +923
    Local Time:
    10:59 PM
    1.17.x
    MariaDB 10.3.x
    Give me a few minutes to recompile.
     
  3. Jimmy

    Jimmy Well-Known Member

    1,704
    365
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +923
    Local Time:
    10:59 PM
    1.17.x
    MariaDB 10.3.x
    Nope, didn't add the dbase. Did you want to see the log?
     
  4. eva2000

    eva2000 Administrator Staff Member

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    12:59 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    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,140
    312
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +508
    Local Time:
    4:59 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    xenforo works fine too
     
  6. eva2000

    eva2000 Administrator Staff Member

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    12:59 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    it doesn't last time i tried it bugged out IIRC
     
  7. Jimmy

    Jimmy Well-Known Member

    1,704
    365
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +923
    Local Time:
    10:59 PM
    1.17.x
    MariaDB 10.3.x
    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

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    12:59 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    tried downgrade to PHP 7.0.18 and see ?
     
  9. Jimmy

    Jimmy Well-Known Member

    1,704
    365
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +923
    Local Time:
    10:59 PM
    1.17.x
    MariaDB 10.3.x
    I downgraded to 7.0.18 still getting the same error in the log.

    Time to reinstall?
     
  10. eva2000

    eva2000 Administrator Staff Member

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    12:59 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    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,704
    365
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +923
    Local Time:
    10:59 PM
    1.17.x
    MariaDB 10.3.x
    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

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    12:59 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Updated 123.09beta01 with fix :)
     
  13. Jimmy

    Jimmy Well-Known Member

    1,704
    365
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +923
    Local Time:
    10:59 PM
    1.17.x
    MariaDB 10.3.x
    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

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    12:59 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    excellent thanks for the confirmation :)
     
  15. Jimmy

    Jimmy Well-Known Member

    1,704
    365
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +923
    Local Time:
    10:59 PM
    1.17.x
    MariaDB 10.3.x
    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

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    12:59 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    whoops needed an additional fix for re-ran php upgrades :D

    added 2nd fix :)
     
  17. Jimmy

    Jimmy Well-Known Member

    1,704
    365
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +923
    Local Time:
    10:59 PM
    1.17.x
    MariaDB 10.3.x
    Works. Second build in a row, no issues. (y)
     
  18. BamaStangGuy

    BamaStangGuy Premium Member Premium Member

    651
    189
    43
    May 25, 2014
    Ratings:
    +264
    Local Time:
    9:59 PM
    What if we have more than one wordpress site? How do we define more than one PHPPGO_INDEXPATH?
     
  19. eva2000

    eva2000 Administrator Staff Member

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    12:59 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    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

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    12:59 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    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 :)