GoAdmio Command Line: listphp with /go/listphp

/go/listphp asks the server's package manager which PHP versions it can provide and prints them, oldest first, one per line. It: It reads the repositories, not the server. The list shows versions you can install, which includes versions that are already installed. To see which versions are actually in use, check multiphp or defaultphp. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Show every PHP version the server can provide
/go/listphp

Examples

# Check whether a specific version is available (prints yes or no)
/go/listphp | grep -qx 8.4 && echo yes || echo no

# Get the newest available version
/go/listphp | tail -n 1

# Count the available versions
/go/listphp | wc -l

# Review recent calls to the command
tail -n 5 /var/log/go/listphp.log

Output

One version number per line, in ascending order, with no header or footer.

7.4
8.0
8.1
8.2
8.3
8.4
8.5

Outcome What you get
Versions found One <major>.<minor> version per line.
No supported version found Empty output.
Unsupported operating system Empty output.

The exit status is 0 in every case, including empty output, so a script cannot tell "none found" from success by the exit code. Check whether the output is empty instead.

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