首页 Function Compute Function Compute FAQ Code development FAQ about PHP runtimes What to do when Notices or Warnings in the PHP runtime cause a third-party library (aliyun-openapi-php-sdk) to fail?

What to do when Notices or Warnings in the PHP runtime cause a third-party library (aliyun-openapi-php-sdk) to fail?

更新时间: 2026-06-25 20:42:06

The Function Compute PHP runtime treats PHP notices and warnings as exceptions by default. When a third-party library such as aliyun-openapi-php-sdk emits a notice or warning, the runtime throws an exception and the function invocation fails.

To resolve this, call PHP's built-in set_error_handler in your function to override the default error handler. This lets you control how notices and warnings are handled and prevents them from being escalated to exceptions that abort execution.

For a detailed explanation of PHP runtime exception handling in Function Compute, see Function ComputePHP Runtime-ExceptionHandling.

上一篇: What do I do if I have a problem using the built-in Tablestore PHP SDKs in a PHP runtime? 下一篇: What do I do if the Cannot modify header information - headers already sent by (output started at ... message is reported when an HTTP trigger is used in a PHP environment?
阿里云首页 函数计算 相关技术圈