/go/defaultphp: defaultphp from the Command Line

/go/defaultphp controls which PHP version the server uses by default, including the php command on the command line. To set the PHP version for one domain, use multiphp instead. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Show the current default PHP version
/go/defaultphp

# Make PHP 8.3 the default
/go/defaultphp 8.3

Arguments

Argument Required Notes
<version> To change the version One of 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6. Always two parts, such as 8.3.
--progress No Prints progress messages, and a final 100, for use by the control panel.

A version in this list is not necessarily available for your operating system. If the package source doesn’t offer it, the install fails.

Examples

# Check, change, then check again
/go/defaultphp
/go/defaultphp 8.2
/go/defaultphp

# Debian or Ubuntu: install the version first, then make it the default
/go/installphp 8.4
/go/defaultphp 8.4

# See which versions are installed
/go/listphp

Output

Showing the version

PHP8.3.6

The name and number are printed together without a space. The exit status is 1 even though this is not an error.

Messages

Message Meaning
Invalid PHP Version The version is not in the list above. Exit status 1.
Instance (<name>) already running. The PHP install lock is in use. Exit status 1.
PHP <version> not installed. To install PHP <version>, run the following command as root: followed by /go/installphp <version> Debian or Ubuntu only. The version isn’t installed yet. Exit status 1.
Change Default PHP Version Completed Successfully and 100 Shown only with --progress, when everything finished.

See the full reference at /go/defaultphp 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 *