What's New

IBM Cloud Functions Adds Support for PHP 7.2

Share this post:

Supercharge your PHP serverless applications

IBM Cloud Functions added support for PHP 7.1 last year, and with the release of 7.2, we are updating! With PHP 7.2 you can ensure better app performance. In addition to lowering your total cost of ownership (TCO), you can improve your user experience by taking advantage of faster response times for blocking requests.

When is 7.2 available?

Now! To update your version, all you need to do is re-deploy your actions by using php:7.2 in your code. This can be done through the CLI or through the GUI. If you’re on version 7.1, you’ll want to make the update as soon as possible as PHP 7.1 has already been deprecated. When 7.1 is removed from the service, which will happen very soon, any support requests will be redirected to the PHP 7.2.

How fast?

There are significant changes in speed between 7.1 and 7.2. You should be able to see the improvements in both cold and warm invocations for you PHP 7.2 actions. Check out the following chart to see a comparison of a hello world action that uses 256MB in both PHP 7.1 and 7.2.

New to IBM Cloud Functions?

Excellent! Welcome aboard. The best way to try out the service or get started quickly is to use a hello world action. To read more about using PHP and Functions, check out the docs.

  1. Download the IBM CLI and the Functions plugin.
  2. Create a file called hello.php that contains the following code:
    function main(array $args) : array
    {
    $name = $args["message"] ?? "World";
    $greeting = "<h1>Hello World</h1>";
    return ["body" => $greeting];
    }
  3. Deploy your action as a web action:
    ibmcloud fn action update helloPHP hello.php --kind php:7.2 --web true
  4. Get the URL for the web action and open it in your browser by running the following command.:
    ibmcloud fn action get helloPHP --url

Feedback and questions

We’d love to hear from you with feedback and questions! You can get help for technical questions at Stack Overflow by using the ibm-functions tag. For non-technical questions, you can find us at IBM developerWorks with the functions tag. For defect or support needs, use the support section that is found in the IBM Cloud menu.

Senior Technical Staff Member (STSM) - IBM Cloud Functions

More What's New stories
May 3, 2019

Kubernetes Tutorials: 5 Ways to Get You Building Fast

Ready to start working with Kubernetes? Want to build your Kubernetes skills? The five tutorials in this post will teach you everything you need to know about how to manage your containerized apps with Kubernetes.

Continue reading

May 3, 2019

Using Portworx to Deploy and Manage an HA MySQL Cluster on IBM Cloud Kubernetes Service

This tutorial is a walkthrough of the steps involved in deploying and managing a highly available MySQL cluster on IBM Cloud Kubernetes Service.

Continue reading

May 2, 2019

Kubernetes v1.14.1 Now Available in IBM Cloud Kubernetes Service

We are excited to announce the availability of Kubernetes v1.14.1 for your clusters that are running in IBM Cloud Kubernetes Service. IBM Cloud Kubernetes Service continues to be the first public managed Kubernetes service to support the latest upstream versions from the community.

Continue reading