multiphp with the /go/multiphp Command

/go/multiphp sets which PHP version a hosting account runs. For each domain it changes, it: It can also print the PHP versions that are installed on the server. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# See which versions are installed
/go/multiphp return

# Change one domain
/go/multiphp example.com 8.2

Arguments

Argument Required Default Notes
<domain> Yes, unless using all or return — The account’s primary domain, as stored in GoAdmio. Subdomains and aliases are not accepted.
all — — Applies the change to every domain in /home whose name contains a dot. Case-sensitive.
return — — Lists the installed versions. Not case-sensitive.
[version] No Newest installed version Use a value printed by multiphp return.

The command has no --option flags.

Version names

The version is the name of the PHP configuration folder.

System Folder checked Example name
AlmaLinux, Rocky, CentOS, Red Hat, Fedora /etc/opt/remi/<version>/php.ini The Remi folder name, for example php83
Debian, Ubuntu /etc/php/<version>/fpm/php.ini 8.3

Only versions whose php.ini exists are listed by return and picked as the newest.

Examples

# List installed versions
/go/multiphp return

# Move one domain to PHP 8.2
/go/multiphp example.com 8.2

# Move one domain to the newest installed version
/go/multiphp example.com

# Move every domain to PHP 8.3
/go/multiphp all 8.3

Output

Outcome What you get
return The installed versions on one line, for example 7.4|8.1|8.3. Exit code 1.
Single domain changed PHP Version for <domain> changed to <version>
all [N/C] PHP Version for <domain> changed to <version> for each domain. Exit code 1.
Version not installed Installed PHP Versions: followed by the list. Exit code 1.
Domain not found Domain <domain> not exists. Exit code 1.
Unsupported operating system Unknown operating system.

return and all always exit with code 1, even when they succeed.

Logging

Every run is appended to /var/log/go/multiphp.log.

See the full reference at /go/multiphp and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *