Skip to content

Revive: PHP 8.5 compatibility, Docker support, CI#48

Merged
miglen merged 1 commit into
masterfrom
revive
May 27, 2026
Merged

Revive: PHP 8.5 compatibility, Docker support, CI#48
miglen merged 1 commit into
masterfrom
revive

Conversation

@miglen
Copy link
Copy Markdown
Member

@miglen miglen commented May 27, 2026

Summary

Brings PHProxy back to life on modern PHP (8.5) and ships a first-class Docker install option. Built on top of the open PHP-8 PRs from the community.

What changed

PHP 8.5 compatibility

  • get_magic_quotes_gpc() removed → set stripslashes flag to false
  • Curly-brace string offsets ($_iflags{$i}, $dir{$i}) → []
  • each($_auth_creds) removed → array_key_first()-based lookup
  • $_COOKIE['userAgent'] access guarded with isset()
  • trim() inputs cast to (string) for HTTP_REFERER, response headers, cookie-domain parsing
  • ?string nullable params (PHP 8.4 deprecation, 8.5 error-on-deprecate)
  • intdiv() in the Punycode loop in idna.class.php (eliminates two float-to-int deprecations)
  • E_STRICT dropped from the develop-mode error-reporting line (removed in 8.4)

Modernization (incorporates #47)

  • Type hints across files/php/functions.inc.php
  • Short [] array syntax throughout

Docker (new)

  • Dockerfile based on php:8.5-apache, mod_rewrite enabled
  • docker-compose.yml with dev bind-mount + a comment on running prod-mode
  • .dockerignore
docker compose up -d
# open http://localhost:8080

CI (new)

  • .github/workflows/lint.ymlphp -l on every *.php, matrix on php:8.1-cli and php:8.5-cli

README

  • Docker quickstart section above standalone install
  • PHP requirement bumped to >= 8.1, tested on 8.5
  • Modern-site limitation documented (CF/JS-gated sites won't work — fundamental design limitation of a regex-rewrite proxy)

Credits

Closing PRs and the PHP-8 issue bucket (#25, #32, #38, #43, #46) after merge. #41, #42, #31 will be closed with a note pointing at the documented modern-site limitation.

Test plan

Verified inside the shipped php:8.5-apache container (PHP 8.5.6):

  • php -l clean on every *.php file
  • Entry form renders cleanly
  • Settings page (edit.php) renders cleanly
  • HTTP proxy fetch of http://example.com/ — page returned, links in body rewritten through the proxy
  • HTTPS proxy fetch of https://example.com/ — same
  • Direct IDNA encode test: münchen.de → xn--mnchen-3ya.de, 例え.テスト → xn--r8jz45g.xn--zckzah (correct Punycode)
  • POST entry-form submission redirects correctly
  • Zero deprecation/warning/notice output anywhere with error_reporting(E_ALL) and display_errors=1

🤖 Generated with Claude Code

Modernizes PHProxy to run on PHP 8.5 and ships a first-class Docker
install option. Closes the PHP-8 issue bucket (#25, #32, #38, #43, #46).

PHP 8.5 fixes:
- Drop removed get_magic_quotes_gpc(); set stripslashes flag to false
- Replace $_iflags{$i} / $dir{$i} curly-brace string offsets with []
- Replace each($_auth_creds) with array_key_first()-based lookup
- Guard $_COOKIE['userAgent'] with isset()
- Cast trim() inputs for HTTP_REFERER, response headers, cookie domain
- ?string nullable params (8.4 deprecation, 8.5 error-on-deprecate)
- intdiv() in Punycode loop (no more float-to-int deprecations)
- Drop E_STRICT (removed in 8.4)

Modernization (from PR #47):
- Type hints across files/php/functions.inc.php
- Short [] array syntax throughout

Docker (new):
- Dockerfile based on php:8.5-apache, mod_rewrite enabled
- docker-compose.yml with dev bind-mount and a prod-mode note
- .dockerignore

CI (new):
- .github/workflows/lint.yml runs php -l on every *.php
  in php:8.1-cli and php:8.5-cli containers

README:
- Docker quickstart added above standalone install
- PHP requirement bumped to >= 8.1, tested on 8.5
- Modern-site limitation documented (CF/JS-gated sites won't work)

Co-Authored-By: Roland Häder (Quix0r) <Quix0r@users.noreply.github.com>
Co-Authored-By: dacendo <dacendo@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant