How do I get the latest version of PHP in Linux-shell?

Source: Internet
Author: User
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.