I need to get the latest PHP version number in the shell and check to see if the server needs to be upgraded.
For example, Apache provides the download is http://www.apache.org/dist/httpd/, it has all the versions are listed, I can easily extract the latest version number through ELinks and awk, but how to do php?
Reply content:
I need to get the latest PHP version number in the shell and check to see if the server needs to be upgraded.
For example, Apache provides the download is http://www.apache.org/dist/httpd/, it has all the versions are listed, I can easily extract the latest version number through ELinks and awk, but how to do php?
Do you mean to parse the HTML through awk and parse the version number?
http://www.php.net/downloads.php This link has current stable.
Curl Http://www.php.net/downloads.php|grep "Current stable" |awk ' {print $} '
Can get the latest version number
The PHP version number can then be obtained via PHP-V.
Thank! The issue has been resolved.