Managing Multiple PHP Versions Print

  • 0

Running different versions per site.

WHY IT ARISES

Older applications require older versions, while new ones need current ones.

WHAT MAKES IT POSSIBLE

Running PHP as a separate process pool per version, rather than inside the web server.

WHAT THE SYSTEM PHP IS

The version installed for command line use, which is frequently not the one serving sites.

WHY THAT CAUSES CONFUSION

A script behaves differently on the command line than through the browser.

HOW TO SEE WHICH VERSION SERVES A SITE

A page reporting the configuration, or the control panel.

HOW TO RUN A SCRIPT WITH A SPECIFIC VERSION

Call that version's binary by its full path.

WHY THAT MATTERS FOR SCHEDULED TASKS

A cron job using plain php may use a version the application does not support.

WHAT TO ALWAYS DO IN CRON

Use the full path to the intended binary.

WHAT CONFIGURATION DIFFERS PER VERSION

Memory limits Execution time Upload sizes Extensions loaded

WHERE TO CHANGE THEM

The version-specific configuration, or the control panel.

WHAT TO CHECK AFTER CHANGING A VERSION

That the site loads That scheduled tasks still work That required extensions are present

WHAT COMMONLY BREAKS ON UPGRADE

Removed functions Stricter type handling

WHAT TO DO

Test on a copy first.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot