Skip to content

fix(examples): replace phpinfo() with hello world in php examples#796

Merged
bnusunny merged 2 commits into
mainfrom
fix/php-example-remove-phpinfo
Jul 14, 2026
Merged

fix(examples): replace phpinfo() with hello world in php examples#796
bnusunny merged 2 commits into
mainfrom
fix/php-example-remove-phpinfo

Conversation

@bnusunny

Copy link
Copy Markdown
Contributor

Problem

The php and php-zip examples call phpinfo() in app/public/index.php. phpinfo() renders the full PHP environment, which on Lambda includes the runtime-injected credentials AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN.

Both examples deploy behind a public API Gateway URL, so a user who follows the example as-is exposes live temporary credentials for their function's execution role to anyone who hits the endpoint.

Change

  • Replace the phpinfo() call with a plain-text Hello, World! response in both examples/php and examples/php-zip.
  • Update the php-zip README "Verify it works" step, which told users to expect phpinfo() output, to expect Hello, World!.

The require .../vendor/autoload.php line is kept so the example still demonstrates Composer autoloader wiring.

Testing

Neither PHP example is built or functionally tested in CI (test-image excludes php; test-zip excludes php-zip). The validate-templates job lints the SAM templates, which are unchanged. The edits are static (an echo plus a Content-Type header).

The php and php-zip examples called phpinfo() in index.php, which renders
the full PHP environment — including the Lambda-injected AWS_ACCESS_KEY_ID,
AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN — to anyone hitting the public
endpoint. Users following the examples as-is would expose their function's
temporary execution-role credentials.

Replace the phpinfo() call with a plain-text "Hello, World!" response and
update the php-zip README verification step accordingly.
@bnusunny
bnusunny requested a review from a team as a code owner July 14, 2026 16:52
@bnusunny
bnusunny merged commit 4ef9a61 into main Jul 14, 2026
25 checks passed
@bnusunny
bnusunny deleted the fix/php-example-remove-phpinfo branch July 14, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants