November 16, 2018 By Carlos Santana 2 min read

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.

More from Announcements

IBM and MuleSoft expand global relationship to accelerate modernization on IBM Power 

2 min read - As companies undergo digital transformation, they rely on APIs as the backbone for providing new services and customer experiences. While APIs can simplify application development and deliver integrated solutions, IT shops must have a robust solution to effectively manage and govern them to ensure that response times and costs are kept low for all applications. Many customers use Salesforce’s MuleSoft, named a leader by Gartner® in full lifecycle API management for seven consecutive times, to manage and secure APIs across…

IBM Consulting augments expertise with AWS Competencies: A win-win for clients 

3 min read - In today's dynamic economic landscape, businesses demand continuous innovation and speed of execution. At IBM Consulting®, our unwavering focus on partnerships and shared commitment to delivering enterprise-level solutions to mutual clients have been core to our success.   We are thrilled to announce that IBM® has recently gained five competencies from Amazon Web Services (AWS) in vital domains including Cloud Operations, Internet of Things (IoT), Life Sciences, Mainframe Modernization, and Telecommunications. With these credentials, IBM further establishes its position as a…

Probable Root Cause: Accelerating incident remediation with causal AI 

5 min read - It has been proven time and time again that a business application’s outages are very costly. The estimated cost of an average downtime can run USD 50,000 to 500,000 per hour, and more as businesses are actively moving to digitization. The complexity of applications is growing as well, so Site Reliability Engineers (SREs) require hours—and sometimes days—to identify and resolve problems.   To alleviate this problem, we have introduced the new feature Probable Root Cause as part of Intelligent Incident…

IBM Newsletters

Get our newsletters and topic updates that deliver the latest thought leadership and insights on emerging trends.
Subscribe now More newsletters