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

Master Branch re-enable PHP local download mirror fallback in 123.09beta01

Discussion in 'Centmin Mod Github Commits' started by eva2000, Jun 13, 2021.

  1. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    3:09 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    re-enable PHP local download mirror fallback in 123.09beta01

    - php.net downloads switched to a CDN method instead of a mirror method years ago so Centmin Mod local mirror fallback routine was disabled as it was no longer needed as a CDN would be reliable enough to serve PHP download files
    - unfortunately it seems php.net CDN downloads are having issues with 503 service unavailable messages on some downloads for some of their CDN edge servers only and not all https://community.centminmod.com/threads/nginx-and-php-fpm-failed-to-install.21377/#post-89049. Interesting part is the centmin mod internal PHP download curl check for 404/503 status is returning 200 status but the actual php.net download is coming back 503 when downloaded. This suggests the initial curl check is hitting one CDN edge server but the download maybe hitting another CDN edge server which returns a 503 error. Thus added an additional check and re-enabled the fallback local Centmin Mod mirror download of PHP.net version files. This local Centmin Mod mirror isn't frequently updated or consistent - maybe around 0-10 days after a PHP new version release. But with the fallback being re-enabled I'll update the local mirror more frequently closer to a new PHP version release. Thanks to Cloudflare Transform rules https://blog.cloudflare.com/introducing-transform-rules-with-url-rewriting-at-the-edge/ it was easier to make the local mirror url paths more closely match the PHP.net official download paths without having to change anything on the backend Nginx/storage path wise :)

    example centmin.sh menu option 5 PHP upgrade/recompile output with the retrying local mirror download routine where first download via php.net CDN gives 503 and retrying uses local mirror


    *************************************************
    * Upgrading PHP
    *************************************************
    SG server detected

    HTTP/1.1 200 OK
    1
    0
    Initializing download: https://www.php.net/distributions/php-7.3.28.tar.gz
    HTTP/1.1 503 Service Temporarily Unavailable

    retrying local mirror download

    Initializing download: https://centminmod.com/distributions/php-7.3.28.tar.gz
    File size: 19677493 bytes
    Opening output file php-7.3.28.tar.gz
    Starting download

    Continue reading...

    Centmin Mod Github Master branch

    Master branch is where most recent commits are made as at May 24, 2015.