PHP Info

Get PHP info

Documentation pages that include this code sample

To view the code sample used in context, see the following documentation:

Code sample

PHP


use Psr\Http\Message\ServerRequestInterface;

function phpInfoDemo(ServerRequestInterface $request): string
{
    // phpinfo() displays its output directly in the function's
    // HTTP response, so we don't need to explicitly return it
    //
    // Note: we recommend deleting the deployed Cloud Function once you no
    // longer need it, as phpinfo() may broadcast potential security issues.
    phpinfo();
    return '';
}

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.