├── .gitignore ├── composer.json ├── composer.lock ├── export └── .gitignore ├── php81al2 ├── Makefile ├── compiler.Dockerfile ├── export.sh ├── helpers │ └── buildArguments.php ├── php.Dockerfile ├── runtime │ ├── bootstrap │ ├── bootstrap.php │ └── php.ini └── versions.ini ├── php82al2-arm ├── Makefile ├── compiler.Dockerfile ├── export.sh ├── helpers │ └── buildArguments.php ├── php.Dockerfile ├── runtime │ ├── bootstrap │ ├── bootstrap.php │ └── php.ini └── versions.ini ├── php82al2 ├── Makefile ├── compiler.Dockerfile ├── export.sh ├── helpers │ └── buildArguments.php ├── php.Dockerfile ├── runtime │ ├── bootstrap │ ├── bootstrap.php │ └── php.ini └── versions.ini ├── php83al2-arm ├── Makefile ├── compiler.Dockerfile ├── export.sh ├── helpers │ └── buildArguments.php ├── php.Dockerfile ├── runtime │ ├── bootstrap │ ├── bootstrap.php │ └── php.ini └── versions.ini ├── php83al2 ├── Makefile ├── compiler.Dockerfile ├── export.sh ├── helpers │ └── buildArguments.php ├── php.Dockerfile ├── runtime │ ├── bootstrap │ ├── bootstrap.php │ └── php.ini └── versions.ini ├── php84al2-arm ├── Makefile ├── compiler.Dockerfile ├── export.sh ├── helpers │ └── buildArguments.php ├── php.Dockerfile ├── runtime │ ├── bootstrap │ ├── bootstrap.php │ └── php.ini └── versions.ini ├── php84al2 ├── Makefile ├── compiler.Dockerfile ├── export.sh ├── helpers │ └── buildArguments.php ├── php.Dockerfile ├── runtime │ ├── bootstrap │ ├── bootstrap.php │ └── php.ini └── versions.ini └── publish.php /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | .env 3 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "php": "^8.0", 4 | "aws/aws-sdk-php": "^3.198", 5 | "vlucas/phpdotenv": "^5.3" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "032b27be6a2ba8f547ed01633d49ff03", 8 | "packages": [ 9 | { 10 | "name": "aws/aws-crt-php", 11 | "version": "v1.2.4", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/awslabs/aws-crt-php.git", 15 | "reference": "eb0c6e4e142224a10b08f49ebf87f32611d162b2" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/eb0c6e4e142224a10b08f49ebf87f32611d162b2", 20 | "reference": "eb0c6e4e142224a10b08f49ebf87f32611d162b2", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "php": ">=5.5" 25 | }, 26 | "require-dev": { 27 | "phpunit/phpunit": "^4.8.35||^5.6.3||^9.5", 28 | "yoast/phpunit-polyfills": "^1.0" 29 | }, 30 | "suggest": { 31 | "ext-awscrt": "Make sure you install awscrt native extension to use any of the functionality." 32 | }, 33 | "type": "library", 34 | "autoload": { 35 | "classmap": [ 36 | "src/" 37 | ] 38 | }, 39 | "notification-url": "https://packagist.org/downloads/", 40 | "license": [ 41 | "Apache-2.0" 42 | ], 43 | "authors": [ 44 | { 45 | "name": "AWS SDK Common Runtime Team", 46 | "email": "aws-sdk-common-runtime@amazon.com" 47 | } 48 | ], 49 | "description": "AWS Common Runtime for PHP", 50 | "homepage": "https://github.com/awslabs/aws-crt-php", 51 | "keywords": [ 52 | "amazon", 53 | "aws", 54 | "crt", 55 | "sdk" 56 | ], 57 | "support": { 58 | "issues": "https://github.com/awslabs/aws-crt-php/issues", 59 | "source": "https://github.com/awslabs/aws-crt-php/tree/v1.2.4" 60 | }, 61 | "time": "2023-11-08T00:42:13+00:00" 62 | }, 63 | { 64 | "name": "aws/aws-sdk-php", 65 | "version": "3.288.1", 66 | "source": { 67 | "type": "git", 68 | "url": "https://github.com/aws/aws-sdk-php.git", 69 | "reference": "a1dfa12c7165de0b731ae8074c4ba1f3ae733f89" 70 | }, 71 | "dist": { 72 | "type": "zip", 73 | "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/a1dfa12c7165de0b731ae8074c4ba1f3ae733f89", 74 | "reference": "a1dfa12c7165de0b731ae8074c4ba1f3ae733f89", 75 | "shasum": "" 76 | }, 77 | "require": { 78 | "aws/aws-crt-php": "^1.2.3", 79 | "ext-json": "*", 80 | "ext-pcre": "*", 81 | "ext-simplexml": "*", 82 | "guzzlehttp/guzzle": "^6.5.8 || ^7.4.5", 83 | "guzzlehttp/promises": "^1.4.0 || ^2.0", 84 | "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", 85 | "mtdowling/jmespath.php": "^2.6", 86 | "php": ">=7.2.5", 87 | "psr/http-message": "^1.0 || ^2.0" 88 | }, 89 | "require-dev": { 90 | "andrewsville/php-token-reflection": "^1.4", 91 | "aws/aws-php-sns-message-validator": "~1.0", 92 | "behat/behat": "~3.0", 93 | "composer/composer": "^1.10.22", 94 | "dms/phpunit-arraysubset-asserts": "^0.4.0", 95 | "doctrine/cache": "~1.4", 96 | "ext-dom": "*", 97 | "ext-openssl": "*", 98 | "ext-pcntl": "*", 99 | "ext-sockets": "*", 100 | "nette/neon": "^2.3", 101 | "paragonie/random_compat": ">= 2", 102 | "phpunit/phpunit": "^5.6.3 || ^8.5 || ^9.5", 103 | "psr/cache": "^1.0", 104 | "psr/simple-cache": "^1.0", 105 | "sebastian/comparator": "^1.2.3 || ^4.0", 106 | "yoast/phpunit-polyfills": "^1.0" 107 | }, 108 | "suggest": { 109 | "aws/aws-php-sns-message-validator": "To validate incoming SNS notifications", 110 | "doctrine/cache": "To use the DoctrineCacheAdapter", 111 | "ext-curl": "To send requests using cURL", 112 | "ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages", 113 | "ext-sockets": "To use client-side monitoring" 114 | }, 115 | "type": "library", 116 | "extra": { 117 | "branch-alias": { 118 | "dev-master": "3.0-dev" 119 | } 120 | }, 121 | "autoload": { 122 | "files": [ 123 | "src/functions.php" 124 | ], 125 | "psr-4": { 126 | "Aws\\": "src/" 127 | } 128 | }, 129 | "notification-url": "https://packagist.org/downloads/", 130 | "license": [ 131 | "Apache-2.0" 132 | ], 133 | "authors": [ 134 | { 135 | "name": "Amazon Web Services", 136 | "homepage": "http://aws.amazon.com" 137 | } 138 | ], 139 | "description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project", 140 | "homepage": "http://aws.amazon.com/sdkforphp", 141 | "keywords": [ 142 | "amazon", 143 | "aws", 144 | "cloud", 145 | "dynamodb", 146 | "ec2", 147 | "glacier", 148 | "s3", 149 | "sdk" 150 | ], 151 | "support": { 152 | "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", 153 | "issues": "https://github.com/aws/aws-sdk-php/issues", 154 | "source": "https://github.com/aws/aws-sdk-php/tree/3.288.1" 155 | }, 156 | "time": "2023-11-22T19:35:38+00:00" 157 | }, 158 | { 159 | "name": "graham-campbell/result-type", 160 | "version": "v1.1.0", 161 | "source": { 162 | "type": "git", 163 | "url": "https://github.com/GrahamCampbell/Result-Type.git", 164 | "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8" 165 | }, 166 | "dist": { 167 | "type": "zip", 168 | "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/a878d45c1914464426dc94da61c9e1d36ae262a8", 169 | "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8", 170 | "shasum": "" 171 | }, 172 | "require": { 173 | "php": "^7.2.5 || ^8.0", 174 | "phpoption/phpoption": "^1.9" 175 | }, 176 | "require-dev": { 177 | "phpunit/phpunit": "^8.5.28 || ^9.5.21" 178 | }, 179 | "type": "library", 180 | "autoload": { 181 | "psr-4": { 182 | "GrahamCampbell\\ResultType\\": "src/" 183 | } 184 | }, 185 | "notification-url": "https://packagist.org/downloads/", 186 | "license": [ 187 | "MIT" 188 | ], 189 | "authors": [ 190 | { 191 | "name": "Graham Campbell", 192 | "email": "hello@gjcampbell.co.uk", 193 | "homepage": "https://github.com/GrahamCampbell" 194 | } 195 | ], 196 | "description": "An Implementation Of The Result Type", 197 | "keywords": [ 198 | "Graham Campbell", 199 | "GrahamCampbell", 200 | "Result Type", 201 | "Result-Type", 202 | "result" 203 | ], 204 | "support": { 205 | "issues": "https://github.com/GrahamCampbell/Result-Type/issues", 206 | "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.0" 207 | }, 208 | "funding": [ 209 | { 210 | "url": "https://github.com/GrahamCampbell", 211 | "type": "github" 212 | }, 213 | { 214 | "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", 215 | "type": "tidelift" 216 | } 217 | ], 218 | "time": "2022-07-30T15:56:11+00:00" 219 | }, 220 | { 221 | "name": "guzzlehttp/guzzle", 222 | "version": "7.8.1", 223 | "source": { 224 | "type": "git", 225 | "url": "https://github.com/guzzle/guzzle.git", 226 | "reference": "41042bc7ab002487b876a0683fc8dce04ddce104" 227 | }, 228 | "dist": { 229 | "type": "zip", 230 | "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104", 231 | "reference": "41042bc7ab002487b876a0683fc8dce04ddce104", 232 | "shasum": "" 233 | }, 234 | "require": { 235 | "ext-json": "*", 236 | "guzzlehttp/promises": "^1.5.3 || ^2.0.1", 237 | "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", 238 | "php": "^7.2.5 || ^8.0", 239 | "psr/http-client": "^1.0", 240 | "symfony/deprecation-contracts": "^2.2 || ^3.0" 241 | }, 242 | "provide": { 243 | "psr/http-client-implementation": "1.0" 244 | }, 245 | "require-dev": { 246 | "bamarni/composer-bin-plugin": "^1.8.2", 247 | "ext-curl": "*", 248 | "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", 249 | "php-http/message-factory": "^1.1", 250 | "phpunit/phpunit": "^8.5.36 || ^9.6.15", 251 | "psr/log": "^1.1 || ^2.0 || ^3.0" 252 | }, 253 | "suggest": { 254 | "ext-curl": "Required for CURL handler support", 255 | "ext-intl": "Required for Internationalized Domain Name (IDN) support", 256 | "psr/log": "Required for using the Log middleware" 257 | }, 258 | "type": "library", 259 | "extra": { 260 | "bamarni-bin": { 261 | "bin-links": true, 262 | "forward-command": false 263 | } 264 | }, 265 | "autoload": { 266 | "files": [ 267 | "src/functions_include.php" 268 | ], 269 | "psr-4": { 270 | "GuzzleHttp\\": "src/" 271 | } 272 | }, 273 | "notification-url": "https://packagist.org/downloads/", 274 | "license": [ 275 | "MIT" 276 | ], 277 | "authors": [ 278 | { 279 | "name": "Graham Campbell", 280 | "email": "hello@gjcampbell.co.uk", 281 | "homepage": "https://github.com/GrahamCampbell" 282 | }, 283 | { 284 | "name": "Michael Dowling", 285 | "email": "mtdowling@gmail.com", 286 | "homepage": "https://github.com/mtdowling" 287 | }, 288 | { 289 | "name": "Jeremy Lindblom", 290 | "email": "jeremeamia@gmail.com", 291 | "homepage": "https://github.com/jeremeamia" 292 | }, 293 | { 294 | "name": "George Mponos", 295 | "email": "gmponos@gmail.com", 296 | "homepage": "https://github.com/gmponos" 297 | }, 298 | { 299 | "name": "Tobias Nyholm", 300 | "email": "tobias.nyholm@gmail.com", 301 | "homepage": "https://github.com/Nyholm" 302 | }, 303 | { 304 | "name": "Márk Sági-Kazár", 305 | "email": "mark.sagikazar@gmail.com", 306 | "homepage": "https://github.com/sagikazarmark" 307 | }, 308 | { 309 | "name": "Tobias Schultze", 310 | "email": "webmaster@tubo-world.de", 311 | "homepage": "https://github.com/Tobion" 312 | } 313 | ], 314 | "description": "Guzzle is a PHP HTTP client library", 315 | "keywords": [ 316 | "client", 317 | "curl", 318 | "framework", 319 | "http", 320 | "http client", 321 | "psr-18", 322 | "psr-7", 323 | "rest", 324 | "web service" 325 | ], 326 | "support": { 327 | "issues": "https://github.com/guzzle/guzzle/issues", 328 | "source": "https://github.com/guzzle/guzzle/tree/7.8.1" 329 | }, 330 | "funding": [ 331 | { 332 | "url": "https://github.com/GrahamCampbell", 333 | "type": "github" 334 | }, 335 | { 336 | "url": "https://github.com/Nyholm", 337 | "type": "github" 338 | }, 339 | { 340 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", 341 | "type": "tidelift" 342 | } 343 | ], 344 | "time": "2023-12-03T20:35:24+00:00" 345 | }, 346 | { 347 | "name": "guzzlehttp/promises", 348 | "version": "2.0.2", 349 | "source": { 350 | "type": "git", 351 | "url": "https://github.com/guzzle/promises.git", 352 | "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" 353 | }, 354 | "dist": { 355 | "type": "zip", 356 | "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", 357 | "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", 358 | "shasum": "" 359 | }, 360 | "require": { 361 | "php": "^7.2.5 || ^8.0" 362 | }, 363 | "require-dev": { 364 | "bamarni/composer-bin-plugin": "^1.8.2", 365 | "phpunit/phpunit": "^8.5.36 || ^9.6.15" 366 | }, 367 | "type": "library", 368 | "extra": { 369 | "bamarni-bin": { 370 | "bin-links": true, 371 | "forward-command": false 372 | } 373 | }, 374 | "autoload": { 375 | "psr-4": { 376 | "GuzzleHttp\\Promise\\": "src/" 377 | } 378 | }, 379 | "notification-url": "https://packagist.org/downloads/", 380 | "license": [ 381 | "MIT" 382 | ], 383 | "authors": [ 384 | { 385 | "name": "Graham Campbell", 386 | "email": "hello@gjcampbell.co.uk", 387 | "homepage": "https://github.com/GrahamCampbell" 388 | }, 389 | { 390 | "name": "Michael Dowling", 391 | "email": "mtdowling@gmail.com", 392 | "homepage": "https://github.com/mtdowling" 393 | }, 394 | { 395 | "name": "Tobias Nyholm", 396 | "email": "tobias.nyholm@gmail.com", 397 | "homepage": "https://github.com/Nyholm" 398 | }, 399 | { 400 | "name": "Tobias Schultze", 401 | "email": "webmaster@tubo-world.de", 402 | "homepage": "https://github.com/Tobion" 403 | } 404 | ], 405 | "description": "Guzzle promises library", 406 | "keywords": [ 407 | "promise" 408 | ], 409 | "support": { 410 | "issues": "https://github.com/guzzle/promises/issues", 411 | "source": "https://github.com/guzzle/promises/tree/2.0.2" 412 | }, 413 | "funding": [ 414 | { 415 | "url": "https://github.com/GrahamCampbell", 416 | "type": "github" 417 | }, 418 | { 419 | "url": "https://github.com/Nyholm", 420 | "type": "github" 421 | }, 422 | { 423 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", 424 | "type": "tidelift" 425 | } 426 | ], 427 | "time": "2023-12-03T20:19:20+00:00" 428 | }, 429 | { 430 | "name": "guzzlehttp/psr7", 431 | "version": "2.6.2", 432 | "source": { 433 | "type": "git", 434 | "url": "https://github.com/guzzle/psr7.git", 435 | "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" 436 | }, 437 | "dist": { 438 | "type": "zip", 439 | "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", 440 | "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", 441 | "shasum": "" 442 | }, 443 | "require": { 444 | "php": "^7.2.5 || ^8.0", 445 | "psr/http-factory": "^1.0", 446 | "psr/http-message": "^1.1 || ^2.0", 447 | "ralouphie/getallheaders": "^3.0" 448 | }, 449 | "provide": { 450 | "psr/http-factory-implementation": "1.0", 451 | "psr/http-message-implementation": "1.0" 452 | }, 453 | "require-dev": { 454 | "bamarni/composer-bin-plugin": "^1.8.2", 455 | "http-interop/http-factory-tests": "^0.9", 456 | "phpunit/phpunit": "^8.5.36 || ^9.6.15" 457 | }, 458 | "suggest": { 459 | "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" 460 | }, 461 | "type": "library", 462 | "extra": { 463 | "bamarni-bin": { 464 | "bin-links": true, 465 | "forward-command": false 466 | } 467 | }, 468 | "autoload": { 469 | "psr-4": { 470 | "GuzzleHttp\\Psr7\\": "src/" 471 | } 472 | }, 473 | "notification-url": "https://packagist.org/downloads/", 474 | "license": [ 475 | "MIT" 476 | ], 477 | "authors": [ 478 | { 479 | "name": "Graham Campbell", 480 | "email": "hello@gjcampbell.co.uk", 481 | "homepage": "https://github.com/GrahamCampbell" 482 | }, 483 | { 484 | "name": "Michael Dowling", 485 | "email": "mtdowling@gmail.com", 486 | "homepage": "https://github.com/mtdowling" 487 | }, 488 | { 489 | "name": "George Mponos", 490 | "email": "gmponos@gmail.com", 491 | "homepage": "https://github.com/gmponos" 492 | }, 493 | { 494 | "name": "Tobias Nyholm", 495 | "email": "tobias.nyholm@gmail.com", 496 | "homepage": "https://github.com/Nyholm" 497 | }, 498 | { 499 | "name": "Márk Sági-Kazár", 500 | "email": "mark.sagikazar@gmail.com", 501 | "homepage": "https://github.com/sagikazarmark" 502 | }, 503 | { 504 | "name": "Tobias Schultze", 505 | "email": "webmaster@tubo-world.de", 506 | "homepage": "https://github.com/Tobion" 507 | }, 508 | { 509 | "name": "Márk Sági-Kazár", 510 | "email": "mark.sagikazar@gmail.com", 511 | "homepage": "https://sagikazarmark.hu" 512 | } 513 | ], 514 | "description": "PSR-7 message implementation that also provides common utility methods", 515 | "keywords": [ 516 | "http", 517 | "message", 518 | "psr-7", 519 | "request", 520 | "response", 521 | "stream", 522 | "uri", 523 | "url" 524 | ], 525 | "support": { 526 | "issues": "https://github.com/guzzle/psr7/issues", 527 | "source": "https://github.com/guzzle/psr7/tree/2.6.2" 528 | }, 529 | "funding": [ 530 | { 531 | "url": "https://github.com/GrahamCampbell", 532 | "type": "github" 533 | }, 534 | { 535 | "url": "https://github.com/Nyholm", 536 | "type": "github" 537 | }, 538 | { 539 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", 540 | "type": "tidelift" 541 | } 542 | ], 543 | "time": "2023-12-03T20:05:35+00:00" 544 | }, 545 | { 546 | "name": "mtdowling/jmespath.php", 547 | "version": "2.7.0", 548 | "source": { 549 | "type": "git", 550 | "url": "https://github.com/jmespath/jmespath.php.git", 551 | "reference": "bbb69a935c2cbb0c03d7f481a238027430f6440b" 552 | }, 553 | "dist": { 554 | "type": "zip", 555 | "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/bbb69a935c2cbb0c03d7f481a238027430f6440b", 556 | "reference": "bbb69a935c2cbb0c03d7f481a238027430f6440b", 557 | "shasum": "" 558 | }, 559 | "require": { 560 | "php": "^7.2.5 || ^8.0", 561 | "symfony/polyfill-mbstring": "^1.17" 562 | }, 563 | "require-dev": { 564 | "composer/xdebug-handler": "^3.0.3", 565 | "phpunit/phpunit": "^8.5.33" 566 | }, 567 | "bin": [ 568 | "bin/jp.php" 569 | ], 570 | "type": "library", 571 | "extra": { 572 | "branch-alias": { 573 | "dev-master": "2.7-dev" 574 | } 575 | }, 576 | "autoload": { 577 | "files": [ 578 | "src/JmesPath.php" 579 | ], 580 | "psr-4": { 581 | "JmesPath\\": "src/" 582 | } 583 | }, 584 | "notification-url": "https://packagist.org/downloads/", 585 | "license": [ 586 | "MIT" 587 | ], 588 | "authors": [ 589 | { 590 | "name": "Graham Campbell", 591 | "email": "hello@gjcampbell.co.uk", 592 | "homepage": "https://github.com/GrahamCampbell" 593 | }, 594 | { 595 | "name": "Michael Dowling", 596 | "email": "mtdowling@gmail.com", 597 | "homepage": "https://github.com/mtdowling" 598 | } 599 | ], 600 | "description": "Declaratively specify how to extract elements from a JSON document", 601 | "keywords": [ 602 | "json", 603 | "jsonpath" 604 | ], 605 | "support": { 606 | "issues": "https://github.com/jmespath/jmespath.php/issues", 607 | "source": "https://github.com/jmespath/jmespath.php/tree/2.7.0" 608 | }, 609 | "time": "2023-08-25T10:54:48+00:00" 610 | }, 611 | { 612 | "name": "phpoption/phpoption", 613 | "version": "1.9.0", 614 | "source": { 615 | "type": "git", 616 | "url": "https://github.com/schmittjoh/php-option.git", 617 | "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab" 618 | }, 619 | "dist": { 620 | "type": "zip", 621 | "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", 622 | "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", 623 | "shasum": "" 624 | }, 625 | "require": { 626 | "php": "^7.2.5 || ^8.0" 627 | }, 628 | "require-dev": { 629 | "bamarni/composer-bin-plugin": "^1.8", 630 | "phpunit/phpunit": "^8.5.28 || ^9.5.21" 631 | }, 632 | "type": "library", 633 | "extra": { 634 | "bamarni-bin": { 635 | "bin-links": true, 636 | "forward-command": true 637 | }, 638 | "branch-alias": { 639 | "dev-master": "1.9-dev" 640 | } 641 | }, 642 | "autoload": { 643 | "psr-4": { 644 | "PhpOption\\": "src/PhpOption/" 645 | } 646 | }, 647 | "notification-url": "https://packagist.org/downloads/", 648 | "license": [ 649 | "Apache-2.0" 650 | ], 651 | "authors": [ 652 | { 653 | "name": "Johannes M. Schmitt", 654 | "email": "schmittjoh@gmail.com", 655 | "homepage": "https://github.com/schmittjoh" 656 | }, 657 | { 658 | "name": "Graham Campbell", 659 | "email": "hello@gjcampbell.co.uk", 660 | "homepage": "https://github.com/GrahamCampbell" 661 | } 662 | ], 663 | "description": "Option Type for PHP", 664 | "keywords": [ 665 | "language", 666 | "option", 667 | "php", 668 | "type" 669 | ], 670 | "support": { 671 | "issues": "https://github.com/schmittjoh/php-option/issues", 672 | "source": "https://github.com/schmittjoh/php-option/tree/1.9.0" 673 | }, 674 | "funding": [ 675 | { 676 | "url": "https://github.com/GrahamCampbell", 677 | "type": "github" 678 | }, 679 | { 680 | "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", 681 | "type": "tidelift" 682 | } 683 | ], 684 | "time": "2022-07-30T15:51:26+00:00" 685 | }, 686 | { 687 | "name": "psr/http-client", 688 | "version": "1.0.3", 689 | "source": { 690 | "type": "git", 691 | "url": "https://github.com/php-fig/http-client.git", 692 | "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" 693 | }, 694 | "dist": { 695 | "type": "zip", 696 | "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", 697 | "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", 698 | "shasum": "" 699 | }, 700 | "require": { 701 | "php": "^7.0 || ^8.0", 702 | "psr/http-message": "^1.0 || ^2.0" 703 | }, 704 | "type": "library", 705 | "extra": { 706 | "branch-alias": { 707 | "dev-master": "1.0.x-dev" 708 | } 709 | }, 710 | "autoload": { 711 | "psr-4": { 712 | "Psr\\Http\\Client\\": "src/" 713 | } 714 | }, 715 | "notification-url": "https://packagist.org/downloads/", 716 | "license": [ 717 | "MIT" 718 | ], 719 | "authors": [ 720 | { 721 | "name": "PHP-FIG", 722 | "homepage": "https://www.php-fig.org/" 723 | } 724 | ], 725 | "description": "Common interface for HTTP clients", 726 | "homepage": "https://github.com/php-fig/http-client", 727 | "keywords": [ 728 | "http", 729 | "http-client", 730 | "psr", 731 | "psr-18" 732 | ], 733 | "support": { 734 | "source": "https://github.com/php-fig/http-client" 735 | }, 736 | "time": "2023-09-23T14:17:50+00:00" 737 | }, 738 | { 739 | "name": "psr/http-factory", 740 | "version": "1.0.2", 741 | "source": { 742 | "type": "git", 743 | "url": "https://github.com/php-fig/http-factory.git", 744 | "reference": "e616d01114759c4c489f93b099585439f795fe35" 745 | }, 746 | "dist": { 747 | "type": "zip", 748 | "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", 749 | "reference": "e616d01114759c4c489f93b099585439f795fe35", 750 | "shasum": "" 751 | }, 752 | "require": { 753 | "php": ">=7.0.0", 754 | "psr/http-message": "^1.0 || ^2.0" 755 | }, 756 | "type": "library", 757 | "extra": { 758 | "branch-alias": { 759 | "dev-master": "1.0.x-dev" 760 | } 761 | }, 762 | "autoload": { 763 | "psr-4": { 764 | "Psr\\Http\\Message\\": "src/" 765 | } 766 | }, 767 | "notification-url": "https://packagist.org/downloads/", 768 | "license": [ 769 | "MIT" 770 | ], 771 | "authors": [ 772 | { 773 | "name": "PHP-FIG", 774 | "homepage": "https://www.php-fig.org/" 775 | } 776 | ], 777 | "description": "Common interfaces for PSR-7 HTTP message factories", 778 | "keywords": [ 779 | "factory", 780 | "http", 781 | "message", 782 | "psr", 783 | "psr-17", 784 | "psr-7", 785 | "request", 786 | "response" 787 | ], 788 | "support": { 789 | "source": "https://github.com/php-fig/http-factory/tree/1.0.2" 790 | }, 791 | "time": "2023-04-10T20:10:41+00:00" 792 | }, 793 | { 794 | "name": "psr/http-message", 795 | "version": "2.0", 796 | "source": { 797 | "type": "git", 798 | "url": "https://github.com/php-fig/http-message.git", 799 | "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" 800 | }, 801 | "dist": { 802 | "type": "zip", 803 | "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", 804 | "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", 805 | "shasum": "" 806 | }, 807 | "require": { 808 | "php": "^7.2 || ^8.0" 809 | }, 810 | "type": "library", 811 | "extra": { 812 | "branch-alias": { 813 | "dev-master": "2.0.x-dev" 814 | } 815 | }, 816 | "autoload": { 817 | "psr-4": { 818 | "Psr\\Http\\Message\\": "src/" 819 | } 820 | }, 821 | "notification-url": "https://packagist.org/downloads/", 822 | "license": [ 823 | "MIT" 824 | ], 825 | "authors": [ 826 | { 827 | "name": "PHP-FIG", 828 | "homepage": "https://www.php-fig.org/" 829 | } 830 | ], 831 | "description": "Common interface for HTTP messages", 832 | "homepage": "https://github.com/php-fig/http-message", 833 | "keywords": [ 834 | "http", 835 | "http-message", 836 | "psr", 837 | "psr-7", 838 | "request", 839 | "response" 840 | ], 841 | "support": { 842 | "source": "https://github.com/php-fig/http-message/tree/2.0" 843 | }, 844 | "time": "2023-04-04T09:54:51+00:00" 845 | }, 846 | { 847 | "name": "ralouphie/getallheaders", 848 | "version": "3.0.3", 849 | "source": { 850 | "type": "git", 851 | "url": "https://github.com/ralouphie/getallheaders.git", 852 | "reference": "120b605dfeb996808c31b6477290a714d356e822" 853 | }, 854 | "dist": { 855 | "type": "zip", 856 | "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", 857 | "reference": "120b605dfeb996808c31b6477290a714d356e822", 858 | "shasum": "" 859 | }, 860 | "require": { 861 | "php": ">=5.6" 862 | }, 863 | "require-dev": { 864 | "php-coveralls/php-coveralls": "^2.1", 865 | "phpunit/phpunit": "^5 || ^6.5" 866 | }, 867 | "type": "library", 868 | "autoload": { 869 | "files": [ 870 | "src/getallheaders.php" 871 | ] 872 | }, 873 | "notification-url": "https://packagist.org/downloads/", 874 | "license": [ 875 | "MIT" 876 | ], 877 | "authors": [ 878 | { 879 | "name": "Ralph Khattar", 880 | "email": "ralph.khattar@gmail.com" 881 | } 882 | ], 883 | "description": "A polyfill for getallheaders.", 884 | "support": { 885 | "issues": "https://github.com/ralouphie/getallheaders/issues", 886 | "source": "https://github.com/ralouphie/getallheaders/tree/develop" 887 | }, 888 | "time": "2019-03-08T08:55:37+00:00" 889 | }, 890 | { 891 | "name": "symfony/deprecation-contracts", 892 | "version": "v2.5.2", 893 | "source": { 894 | "type": "git", 895 | "url": "https://github.com/symfony/deprecation-contracts.git", 896 | "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" 897 | }, 898 | "dist": { 899 | "type": "zip", 900 | "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", 901 | "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", 902 | "shasum": "" 903 | }, 904 | "require": { 905 | "php": ">=7.1" 906 | }, 907 | "type": "library", 908 | "extra": { 909 | "branch-alias": { 910 | "dev-main": "2.5-dev" 911 | }, 912 | "thanks": { 913 | "name": "symfony/contracts", 914 | "url": "https://github.com/symfony/contracts" 915 | } 916 | }, 917 | "autoload": { 918 | "files": [ 919 | "function.php" 920 | ] 921 | }, 922 | "notification-url": "https://packagist.org/downloads/", 923 | "license": [ 924 | "MIT" 925 | ], 926 | "authors": [ 927 | { 928 | "name": "Nicolas Grekas", 929 | "email": "p@tchwork.com" 930 | }, 931 | { 932 | "name": "Symfony Community", 933 | "homepage": "https://symfony.com/contributors" 934 | } 935 | ], 936 | "description": "A generic function and convention to trigger deprecation notices", 937 | "homepage": "https://symfony.com", 938 | "support": { 939 | "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" 940 | }, 941 | "funding": [ 942 | { 943 | "url": "https://symfony.com/sponsor", 944 | "type": "custom" 945 | }, 946 | { 947 | "url": "https://github.com/fabpot", 948 | "type": "github" 949 | }, 950 | { 951 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 952 | "type": "tidelift" 953 | } 954 | ], 955 | "time": "2022-01-02T09:53:40+00:00" 956 | }, 957 | { 958 | "name": "symfony/polyfill-ctype", 959 | "version": "v1.27.0", 960 | "source": { 961 | "type": "git", 962 | "url": "https://github.com/symfony/polyfill-ctype.git", 963 | "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" 964 | }, 965 | "dist": { 966 | "type": "zip", 967 | "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", 968 | "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", 969 | "shasum": "" 970 | }, 971 | "require": { 972 | "php": ">=7.1" 973 | }, 974 | "provide": { 975 | "ext-ctype": "*" 976 | }, 977 | "suggest": { 978 | "ext-ctype": "For best performance" 979 | }, 980 | "type": "library", 981 | "extra": { 982 | "branch-alias": { 983 | "dev-main": "1.27-dev" 984 | }, 985 | "thanks": { 986 | "name": "symfony/polyfill", 987 | "url": "https://github.com/symfony/polyfill" 988 | } 989 | }, 990 | "autoload": { 991 | "files": [ 992 | "bootstrap.php" 993 | ], 994 | "psr-4": { 995 | "Symfony\\Polyfill\\Ctype\\": "" 996 | } 997 | }, 998 | "notification-url": "https://packagist.org/downloads/", 999 | "license": [ 1000 | "MIT" 1001 | ], 1002 | "authors": [ 1003 | { 1004 | "name": "Gert de Pagter", 1005 | "email": "BackEndTea@gmail.com" 1006 | }, 1007 | { 1008 | "name": "Symfony Community", 1009 | "homepage": "https://symfony.com/contributors" 1010 | } 1011 | ], 1012 | "description": "Symfony polyfill for ctype functions", 1013 | "homepage": "https://symfony.com", 1014 | "keywords": [ 1015 | "compatibility", 1016 | "ctype", 1017 | "polyfill", 1018 | "portable" 1019 | ], 1020 | "support": { 1021 | "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" 1022 | }, 1023 | "funding": [ 1024 | { 1025 | "url": "https://symfony.com/sponsor", 1026 | "type": "custom" 1027 | }, 1028 | { 1029 | "url": "https://github.com/fabpot", 1030 | "type": "github" 1031 | }, 1032 | { 1033 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1034 | "type": "tidelift" 1035 | } 1036 | ], 1037 | "time": "2022-11-03T14:55:06+00:00" 1038 | }, 1039 | { 1040 | "name": "symfony/polyfill-mbstring", 1041 | "version": "v1.28.0", 1042 | "source": { 1043 | "type": "git", 1044 | "url": "https://github.com/symfony/polyfill-mbstring.git", 1045 | "reference": "42292d99c55abe617799667f454222c54c60e229" 1046 | }, 1047 | "dist": { 1048 | "type": "zip", 1049 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", 1050 | "reference": "42292d99c55abe617799667f454222c54c60e229", 1051 | "shasum": "" 1052 | }, 1053 | "require": { 1054 | "php": ">=7.1" 1055 | }, 1056 | "provide": { 1057 | "ext-mbstring": "*" 1058 | }, 1059 | "suggest": { 1060 | "ext-mbstring": "For best performance" 1061 | }, 1062 | "type": "library", 1063 | "extra": { 1064 | "branch-alias": { 1065 | "dev-main": "1.28-dev" 1066 | }, 1067 | "thanks": { 1068 | "name": "symfony/polyfill", 1069 | "url": "https://github.com/symfony/polyfill" 1070 | } 1071 | }, 1072 | "autoload": { 1073 | "files": [ 1074 | "bootstrap.php" 1075 | ], 1076 | "psr-4": { 1077 | "Symfony\\Polyfill\\Mbstring\\": "" 1078 | } 1079 | }, 1080 | "notification-url": "https://packagist.org/downloads/", 1081 | "license": [ 1082 | "MIT" 1083 | ], 1084 | "authors": [ 1085 | { 1086 | "name": "Nicolas Grekas", 1087 | "email": "p@tchwork.com" 1088 | }, 1089 | { 1090 | "name": "Symfony Community", 1091 | "homepage": "https://symfony.com/contributors" 1092 | } 1093 | ], 1094 | "description": "Symfony polyfill for the Mbstring extension", 1095 | "homepage": "https://symfony.com", 1096 | "keywords": [ 1097 | "compatibility", 1098 | "mbstring", 1099 | "polyfill", 1100 | "portable", 1101 | "shim" 1102 | ], 1103 | "support": { 1104 | "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" 1105 | }, 1106 | "funding": [ 1107 | { 1108 | "url": "https://symfony.com/sponsor", 1109 | "type": "custom" 1110 | }, 1111 | { 1112 | "url": "https://github.com/fabpot", 1113 | "type": "github" 1114 | }, 1115 | { 1116 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1117 | "type": "tidelift" 1118 | } 1119 | ], 1120 | "time": "2023-07-28T09:04:16+00:00" 1121 | }, 1122 | { 1123 | "name": "symfony/polyfill-php80", 1124 | "version": "v1.27.0", 1125 | "source": { 1126 | "type": "git", 1127 | "url": "https://github.com/symfony/polyfill-php80.git", 1128 | "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" 1129 | }, 1130 | "dist": { 1131 | "type": "zip", 1132 | "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", 1133 | "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", 1134 | "shasum": "" 1135 | }, 1136 | "require": { 1137 | "php": ">=7.1" 1138 | }, 1139 | "type": "library", 1140 | "extra": { 1141 | "branch-alias": { 1142 | "dev-main": "1.27-dev" 1143 | }, 1144 | "thanks": { 1145 | "name": "symfony/polyfill", 1146 | "url": "https://github.com/symfony/polyfill" 1147 | } 1148 | }, 1149 | "autoload": { 1150 | "files": [ 1151 | "bootstrap.php" 1152 | ], 1153 | "psr-4": { 1154 | "Symfony\\Polyfill\\Php80\\": "" 1155 | }, 1156 | "classmap": [ 1157 | "Resources/stubs" 1158 | ] 1159 | }, 1160 | "notification-url": "https://packagist.org/downloads/", 1161 | "license": [ 1162 | "MIT" 1163 | ], 1164 | "authors": [ 1165 | { 1166 | "name": "Ion Bazan", 1167 | "email": "ion.bazan@gmail.com" 1168 | }, 1169 | { 1170 | "name": "Nicolas Grekas", 1171 | "email": "p@tchwork.com" 1172 | }, 1173 | { 1174 | "name": "Symfony Community", 1175 | "homepage": "https://symfony.com/contributors" 1176 | } 1177 | ], 1178 | "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", 1179 | "homepage": "https://symfony.com", 1180 | "keywords": [ 1181 | "compatibility", 1182 | "polyfill", 1183 | "portable", 1184 | "shim" 1185 | ], 1186 | "support": { 1187 | "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" 1188 | }, 1189 | "funding": [ 1190 | { 1191 | "url": "https://symfony.com/sponsor", 1192 | "type": "custom" 1193 | }, 1194 | { 1195 | "url": "https://github.com/fabpot", 1196 | "type": "github" 1197 | }, 1198 | { 1199 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1200 | "type": "tidelift" 1201 | } 1202 | ], 1203 | "time": "2022-11-03T14:55:06+00:00" 1204 | }, 1205 | { 1206 | "name": "vlucas/phpdotenv", 1207 | "version": "v5.5.0", 1208 | "source": { 1209 | "type": "git", 1210 | "url": "https://github.com/vlucas/phpdotenv.git", 1211 | "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7" 1212 | }, 1213 | "dist": { 1214 | "type": "zip", 1215 | "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", 1216 | "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", 1217 | "shasum": "" 1218 | }, 1219 | "require": { 1220 | "ext-pcre": "*", 1221 | "graham-campbell/result-type": "^1.0.2", 1222 | "php": "^7.1.3 || ^8.0", 1223 | "phpoption/phpoption": "^1.8", 1224 | "symfony/polyfill-ctype": "^1.23", 1225 | "symfony/polyfill-mbstring": "^1.23.1", 1226 | "symfony/polyfill-php80": "^1.23.1" 1227 | }, 1228 | "require-dev": { 1229 | "bamarni/composer-bin-plugin": "^1.4.1", 1230 | "ext-filter": "*", 1231 | "phpunit/phpunit": "^7.5.20 || ^8.5.30 || ^9.5.25" 1232 | }, 1233 | "suggest": { 1234 | "ext-filter": "Required to use the boolean validator." 1235 | }, 1236 | "type": "library", 1237 | "extra": { 1238 | "bamarni-bin": { 1239 | "bin-links": true, 1240 | "forward-command": true 1241 | }, 1242 | "branch-alias": { 1243 | "dev-master": "5.5-dev" 1244 | } 1245 | }, 1246 | "autoload": { 1247 | "psr-4": { 1248 | "Dotenv\\": "src/" 1249 | } 1250 | }, 1251 | "notification-url": "https://packagist.org/downloads/", 1252 | "license": [ 1253 | "BSD-3-Clause" 1254 | ], 1255 | "authors": [ 1256 | { 1257 | "name": "Graham Campbell", 1258 | "email": "hello@gjcampbell.co.uk", 1259 | "homepage": "https://github.com/GrahamCampbell" 1260 | }, 1261 | { 1262 | "name": "Vance Lucas", 1263 | "email": "vance@vancelucas.com", 1264 | "homepage": "https://github.com/vlucas" 1265 | } 1266 | ], 1267 | "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", 1268 | "keywords": [ 1269 | "dotenv", 1270 | "env", 1271 | "environment" 1272 | ], 1273 | "support": { 1274 | "issues": "https://github.com/vlucas/phpdotenv/issues", 1275 | "source": "https://github.com/vlucas/phpdotenv/tree/v5.5.0" 1276 | }, 1277 | "funding": [ 1278 | { 1279 | "url": "https://github.com/GrahamCampbell", 1280 | "type": "github" 1281 | }, 1282 | { 1283 | "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", 1284 | "type": "tidelift" 1285 | } 1286 | ], 1287 | "time": "2022-10-16T01:01:54+00:00" 1288 | } 1289 | ], 1290 | "packages-dev": [], 1291 | "aliases": [], 1292 | "minimum-stability": "stable", 1293 | "stability-flags": [], 1294 | "prefer-stable": false, 1295 | "prefer-lowest": false, 1296 | "platform": { 1297 | "php": "^8.0" 1298 | }, 1299 | "platform-dev": [], 1300 | "plugin-api-version": "2.6.0" 1301 | } 1302 | -------------------------------------------------------------------------------- /export/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /php81al2/Makefile: -------------------------------------------------------------------------------- 1 | SHELL := /bin/bash 2 | 3 | compiler: compiler.Dockerfile 4 | docker build -f ${PWD}/compiler.Dockerfile -t vapor/runtime/compiler:latest . 5 | 6 | build: compiler 7 | docker build -f ${PWD}/php.Dockerfile -t vapor/runtime/php-81al2:latest $(shell helpers/buildArguments.php php81) . 8 | 9 | distribution: build 10 | docker run --rm \ 11 | --env PHP_SHORT_VERSION=81al2 \ 12 | --volume ${PWD}/runtime:/runtime:ro \ 13 | --volume ${PWD}/../export:/export \ 14 | --volume ${PWD}/export.sh:/export.sh:ro \ 15 | vapor/runtime/php-81al2:latest \ 16 | /export.sh 17 | -------------------------------------------------------------------------------- /php81al2/compiler.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=linux/amd64 amazonlinux:2 2 | 3 | WORKDIR /tmp 4 | 5 | # Lock To Proper Release 6 | 7 | RUN sed -i 's/releasever=latest/releaserver=amzn2/' /etc/yum.conf 8 | 9 | # Install Development Tools 10 | 11 | RUN set -xe \ 12 | && yum makecache \ 13 | && yum groupinstall -y "Development Tools" --setopt=group_package_types=mandatory,default 14 | 15 | # Install CMake 16 | 17 | RUN yum -y install openssl-devel perl-IPC-Cmd 18 | 19 | RUN set -xe \ 20 | && mkdir -p /tmp/cmake \ 21 | && cd /tmp/cmake \ 22 | && curl -Ls https://github.com/Kitware/CMake/releases/download/v3.30.1/cmake-3.30.1.tar.gz \ 23 | | tar xzC /tmp/cmake --strip-components=1 \ 24 | && ./bootstrap --prefix=/usr/local \ 25 | && make -j $(nproc) \ 26 | && make install 27 | -------------------------------------------------------------------------------- /php81al2/export.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -u 5 | set -x 6 | 7 | cd /opt 8 | 9 | cp /runtime/bootstrap bootstrap 10 | cp /runtime/bootstrap.php bootstrap.php 11 | 12 | chmod 755 bootstrap 13 | chmod 755 bootstrap.php 14 | 15 | rm -rf vapor/ 16 | 17 | mkdir -p vapor/etc/php/conf.d 18 | cp /runtime/php.ini vapor/etc/php/conf.d/vapor.ini 19 | 20 | # cp /runtime/imagick/bin/* bin 21 | # cp /runtime/imagick/lib/* lib 22 | 23 | ls -la 24 | 25 | zip --quiet --recurse-paths /export/php-${PHP_SHORT_VERSION}.zip . --exclude "*php-cgi" 26 | # zip --delete /export/php-${PHP_SHORT_VERSION}.zip vapor/sbin/php-fpm bin/php-fpm 27 | -------------------------------------------------------------------------------- /php81al2/helpers/buildArguments.php: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | $value){ 9 | $buildArguments .= "--build-arg $key=$value "; 10 | } 11 | 12 | print $buildArguments; 13 | -------------------------------------------------------------------------------- /php81al2/php.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=linux/amd64 vapor/runtime/compiler:latest as php_builder 2 | 3 | SHELL ["/bin/bash", "-c"] 4 | 5 | ENV BUILD_DIR="/tmp/build" 6 | ENV INSTALL_DIR="/opt/vapor" 7 | 8 | # Configure Default Compiler Variables 9 | 10 | ENV PKG_CONFIG_PATH="${INSTALL_DIR}/lib64/pkgconfig:${INSTALL_DIR}/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig" \ 11 | PKG_CONFIG="/usr/bin/pkg-config" \ 12 | PATH="${INSTALL_DIR}/bin:${PATH}" 13 | 14 | ENV LD_LIBRARY_PATH="${INSTALL_DIR}/lib64:${INSTALL_DIR}/lib" 15 | 16 | # Create All The Necessary Build Directories 17 | 18 | RUN mkdir -p ${BUILD_DIR} \ 19 | ${INSTALL_DIR}/bin \ 20 | ${INSTALL_DIR}/doc \ 21 | ${INSTALL_DIR}/etc/php \ 22 | ${INSTALL_DIR}/etc/php/conf.d \ 23 | ${INSTALL_DIR}/include \ 24 | ${INSTALL_DIR}/lib \ 25 | ${INSTALL_DIR}/lib64 \ 26 | ${INSTALL_DIR}/libexec \ 27 | ${INSTALL_DIR}/sbin \ 28 | ${INSTALL_DIR}/share 29 | 30 | 31 | # Build ZLIB (https://github.com/madler/zlib/releases) 32 | 33 | ARG zlib 34 | ENV VERSION_ZLIB=${zlib} 35 | ENV ZLIB_BUILD_DIR=${BUILD_DIR}/zlib 36 | 37 | RUN set -xe; \ 38 | mkdir -p ${ZLIB_BUILD_DIR}; \ 39 | curl -Ls https://github.com/madler/zlib/releases/download/v${VERSION_ZLIB}/zlib-${VERSION_ZLIB}.tar.xz \ 40 | | tar xJC ${ZLIB_BUILD_DIR} --strip-components=1 41 | 42 | WORKDIR ${ZLIB_BUILD_DIR}/ 43 | 44 | RUN set -xe; \ 45 | make distclean \ 46 | && CFLAGS="" \ 47 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 48 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 49 | ./configure \ 50 | --prefix=${INSTALL_DIR} \ 51 | --64 52 | 53 | RUN set -xe; \ 54 | make install \ 55 | && rm ${INSTALL_DIR}/lib/libz.a 56 | 57 | # Build OpenSSL (https://github.com/openssl/openssl/releases) 58 | 59 | ARG openssl 60 | ENV VERSION_OPENSSL=${openssl} 61 | ENV OPENSSL_BUILD_DIR=${BUILD_DIR}/openssl 62 | ENV CA_BUNDLE_SOURCE="https://curl.se/ca/cacert.pem" 63 | ENV CA_BUNDLE="${INSTALL_DIR}/ssl/cert.pem" 64 | 65 | RUN set -xe; \ 66 | mkdir -p ${OPENSSL_BUILD_DIR}; \ 67 | curl -Ls https://github.com/openssl/openssl/archive/openssl-${VERSION_OPENSSL}.tar.gz \ 68 | | tar xzC ${OPENSSL_BUILD_DIR} --strip-components=1 69 | 70 | WORKDIR ${OPENSSL_BUILD_DIR}/ 71 | 72 | RUN set -xe; \ 73 | CFLAGS="" \ 74 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 75 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 76 | ./config \ 77 | --prefix=${INSTALL_DIR} \ 78 | --openssldir=${INSTALL_DIR}/ssl \ 79 | --release \ 80 | enable-tls1_3 \ 81 | no-tests \ 82 | shared \ 83 | zlib 84 | 85 | RUN set -xe; \ 86 | make install \ 87 | && curl -L -k -o ${CA_BUNDLE} ${CA_BUNDLE_SOURCE} 88 | 89 | # Build LibXML2 (https://gitlab.gnome.org/GNOME/libxml2/-/releases) 90 | 91 | ARG libxml2 92 | ENV VERSION_XML2=${libxml2} 93 | ENV XML2_BUILD_DIR=${BUILD_DIR}/xml2 94 | 95 | RUN set -xe; \ 96 | mkdir -p ${XML2_BUILD_DIR}; \ 97 | curl -Ls https://download.gnome.org/sources/libxml2/${VERSION_XML2%.*}/libxml2-${VERSION_XML2}.tar.xz \ 98 | | tar xJC ${XML2_BUILD_DIR} --strip-components=1 99 | 100 | WORKDIR ${XML2_BUILD_DIR}/ 101 | 102 | RUN set -xe; \ 103 | CFLAGS="" \ 104 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 105 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 106 | ./configure \ 107 | --prefix=${INSTALL_DIR} \ 108 | --with-sysroot=${INSTALL_DIR} \ 109 | --enable-shared \ 110 | --disable-static \ 111 | --with-html \ 112 | --with-history \ 113 | --enable-ipv6=no \ 114 | --with-icu \ 115 | --with-zlib=${INSTALL_DIR} \ 116 | --without-python 117 | 118 | RUN set -xe; \ 119 | make install \ 120 | && cp xml2-config ${INSTALL_DIR}/bin/xml2-config 121 | 122 | # Build LibSSH2 (https://github.com/libssh2/libssh2/releases/) 123 | 124 | ARG libssh2 125 | ENV VERSION_LIBSSH2=${libssh2} 126 | ENV LIBSSH2_BUILD_DIR=${BUILD_DIR}/libssh2 127 | 128 | RUN set -xe; \ 129 | mkdir -p ${LIBSSH2_BUILD_DIR}/bin; \ 130 | curl -Ls https://github.com/libssh2/libssh2/releases/download/libssh2-${VERSION_LIBSSH2}/libssh2-${VERSION_LIBSSH2}.tar.gz \ 131 | | tar xzC ${LIBSSH2_BUILD_DIR} --strip-components=1 132 | 133 | WORKDIR ${LIBSSH2_BUILD_DIR}/bin/ 134 | 135 | RUN set -xe; \ 136 | CFLAGS="" \ 137 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 138 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 139 | cmake .. \ 140 | -DBUILD_SHARED_LIBS=ON \ 141 | -DCRYPTO_BACKEND=OpenSSL \ 142 | -DENABLE_ZLIB_COMPRESSION=ON \ 143 | -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ 144 | -DCMAKE_BUILD_TYPE=RELEASE 145 | 146 | RUN set -xe; \ 147 | cmake --build . --target install 148 | 149 | # Build nghttp2 (https://github.com/nghttp2/nghttp2/releases/) 150 | 151 | ARG nghttp2 152 | ENV VERSION_NGHTTP2=${nghttp2} 153 | ENV NGHTTP2_BUILD_DIR=${BUILD_DIR}/nghttp2 154 | 155 | RUN set -xe; \ 156 | mkdir -p ${NGHTTP2_BUILD_DIR}/bin; \ 157 | curl -Ls https://github.com/nghttp2/nghttp2/releases/download/v${VERSION_NGHTTP2}/nghttp2-${VERSION_NGHTTP2}.tar.gz \ 158 | | tar xzC ${NGHTTP2_BUILD_DIR} --strip-components=1 159 | 160 | WORKDIR ${NGHTTP2_BUILD_DIR}/ 161 | 162 | RUN set -xe; \ 163 | CFLAGS="" \ 164 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 165 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 166 | ./configure --enable-lib-only --prefix=${INSTALL_DIR} && \ 167 | make -j $(nproc) && \ 168 | make install 169 | 170 | # Build Curl (https://github.com/curl/curl/releases/) 171 | 172 | ARG curl 173 | ENV VERSION_CURL=${curl} 174 | ENV CURL_BUILD_DIR=${BUILD_DIR}/curl 175 | 176 | RUN set -xe; \ 177 | mkdir -p ${CURL_BUILD_DIR}/bin; \ 178 | curl -Ls https://github.com/curl/curl/archive/curl-${VERSION_CURL//./_}.tar.gz \ 179 | | tar xzC ${CURL_BUILD_DIR} --strip-components=1 180 | 181 | WORKDIR ${CURL_BUILD_DIR}/ 182 | 183 | RUN set -xe; \ 184 | ./buildconf \ 185 | && CFLAGS="" \ 186 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 187 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 188 | ./configure \ 189 | --prefix=${INSTALL_DIR} \ 190 | --with-ca-bundle=${CA_BUNDLE} \ 191 | --enable-shared \ 192 | --disable-static \ 193 | --enable-optimize \ 194 | --disable-warnings \ 195 | --disable-dependency-tracking \ 196 | --with-zlib \ 197 | --enable-http \ 198 | --enable-ftp \ 199 | --enable-file \ 200 | --enable-ldaps \ 201 | --enable-proxy \ 202 | --enable-tftp \ 203 | --enable-ipv6 \ 204 | --enable-openssl-auto-load-config \ 205 | --enable-cookies \ 206 | --with-gnu-ld \ 207 | --with-ssl \ 208 | --with-libssh2 \ 209 | --with-nghttp2 \ 210 | --without-libpsl 211 | 212 | RUN set -xe; \ 213 | make install 214 | 215 | # Build Libzip (https://github.com/nih-at/libzip/releases) 216 | 217 | ARG libzip 218 | ENV VERSION_ZIP=${libzip} 219 | ENV ZIP_BUILD_DIR=${BUILD_DIR}/zip 220 | 221 | RUN set -xe; \ 222 | mkdir -p ${ZIP_BUILD_DIR}/bin/; \ 223 | # Download and upack the source code 224 | curl -Ls https://github.com/nih-at/libzip/releases/download/v${VERSION_ZIP}/libzip-${VERSION_ZIP}.tar.gz \ 225 | | tar xzC ${ZIP_BUILD_DIR} --strip-components=1 226 | 227 | # Move into the unpackaged code directory 228 | WORKDIR ${ZIP_BUILD_DIR}/bin/ 229 | 230 | # Configure the build 231 | RUN set -xe; \ 232 | CFLAGS="" \ 233 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 234 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 235 | cmake .. \ 236 | -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ 237 | -DCMAKE_BUILD_TYPE=RELEASE 238 | 239 | RUN set -xe; \ 240 | cmake --build . --target install 241 | 242 | # Build Libsodium (https://github.com/jedisct1/libsodium/releases) 243 | 244 | ARG libsodium 245 | ENV VERSION_LIBSODIUM=${libsodium} 246 | ENV LIBSODIUM_BUILD_DIR=${BUILD_DIR}/libsodium 247 | 248 | RUN set -xe; \ 249 | mkdir -p ${LIBSODIUM_BUILD_DIR}; \ 250 | curl -Ls https://github.com/jedisct1/libsodium/archive/${VERSION_LIBSODIUM}-RELEASE.tar.gz \ 251 | | tar xzC ${LIBSODIUM_BUILD_DIR} --strip-components=1 252 | 253 | WORKDIR ${LIBSODIUM_BUILD_DIR}/ 254 | 255 | RUN set -xe; \ 256 | CFLAGS="" \ 257 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 258 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 259 | ./autogen.sh \ 260 | && ./configure --prefix=${INSTALL_DIR} 261 | 262 | RUN set -xe; \ 263 | make install 264 | 265 | # Build Postgres (https://github.com/postgres/postgres/releases/) 266 | 267 | ARG postgres 268 | ENV VERSION_POSTGRES=${postgres} 269 | ENV POSTGRES_BUILD_DIR=${BUILD_DIR}/postgres 270 | 271 | RUN set -xe; \ 272 | mkdir -p ${POSTGRES_BUILD_DIR}/bin; \ 273 | curl -Ls https://github.com/postgres/postgres/archive/REL_${VERSION_POSTGRES//./_}.tar.gz \ 274 | | tar xzC ${POSTGRES_BUILD_DIR} --strip-components=1 275 | 276 | WORKDIR ${POSTGRES_BUILD_DIR}/ 277 | 278 | RUN set -xe; \ 279 | CFLAGS="" \ 280 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 281 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 282 | ./configure --prefix=${INSTALL_DIR} --with-openssl --without-readline 283 | 284 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/interfaces/libpq && make && make install 285 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/bin/pg_config && make && make install 286 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/backend && make generated-headers 287 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/include && make install 288 | 289 | # Build libjpeg 290 | 291 | ARG libjpeg 292 | ENV VERSION_LIBJPEG=${libjpeg} 293 | ENV LIBJPEG_BUILD_DIR=${BUILD_DIR}/libjpeg 294 | 295 | RUN set -xe; \ 296 | mkdir -p ${LIBJPEG_BUILD_DIR}/bin; \ 297 | curl -Ls http://www.ijg.org/files/jpegsrc.${VERSION_LIBJPEG}.tar.gz \ 298 | | tar xzC ${LIBJPEG_BUILD_DIR} --strip-components=1 299 | 300 | WORKDIR ${LIBJPEG_BUILD_DIR}/ 301 | 302 | RUN set -xe; \ 303 | CFLAGS="" \ 304 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 305 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 306 | ./configure \ 307 | --prefix=${INSTALL_DIR} \ 308 | --enable-shared \ 309 | --disable-static 310 | 311 | RUN set -xe; \ 312 | make install 313 | 314 | # Build libpng 315 | 316 | ARG libpng 317 | ENV VERSION_LIBPNG=${libpng} 318 | ENV LIBPNG_BUILD_DIR=${BUILD_DIR}/libpng 319 | 320 | RUN set -xe; \ 321 | mkdir -p ${LIBPNG_BUILD_DIR}/bin; \ 322 | curl -Ls https://download.sourceforge.net/libpng/libpng-${VERSION_LIBPNG}.tar.gz \ 323 | | tar xzC ${LIBPNG_BUILD_DIR} --strip-components=1 324 | 325 | WORKDIR ${LIBPNG_BUILD_DIR}/ 326 | 327 | RUN set -xe; \ 328 | CFLAGS="" \ 329 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 330 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 331 | ./configure \ 332 | --prefix=${INSTALL_DIR} \ 333 | --enable-shared \ 334 | --disable-static 335 | 336 | RUN set -xe; \ 337 | make install 338 | 339 | # Build Oniguruma 340 | 341 | ARG oniguruma 342 | ENV VERSION_ONIGURUMA=${oniguruma} 343 | ENV LIBONIG_BUILD_DIR=${BUILD_DIR}/libonig 344 | 345 | RUN set -xe \ 346 | && mkdir -p ${LIBONIG_BUILD_DIR}/bin \ 347 | && curl -Ls https://github.com/kkos/oniguruma/releases/download/v${VERSION_ONIGURUMA}/onig-${VERSION_ONIGURUMA}.tar.gz \ 348 | | tar xzC ${LIBONIG_BUILD_DIR} --strip-components=1 349 | 350 | WORKDIR ${LIBONIG_BUILD_DIR}/ 351 | 352 | RUN set -xe; \ 353 | CFLAGS="" \ 354 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 355 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 356 | && ./configure \ 357 | --prefix=${INSTALL_DIR} \ 358 | --enable-shared \ 359 | --disable-static 360 | 361 | RUN set -xe; \ 362 | make install 363 | 364 | # Build PHP 365 | 366 | ARG php 367 | ENV VERSION_PHP=${php} 368 | ENV PHP_BUILD_DIR=${BUILD_DIR}/php 369 | 370 | RUN set -xe; \ 371 | mkdir -p ${PHP_BUILD_DIR}; \ 372 | curl -Ls https://php.net/distributions/php-${VERSION_PHP}.tar.gz \ 373 | | tar xzC ${PHP_BUILD_DIR} --strip-components=1 374 | 375 | # Configure The PHP Build 376 | 377 | WORKDIR ${PHP_BUILD_DIR}/ 378 | 379 | RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel sqlite-devel libxslt-devel ImageMagick-devel 380 | 381 | RUN cp -a /usr/lib64/libgpg-error.so* ${INSTALL_DIR}/lib64/ 382 | RUN cp -a /usr/lib64/libtinfo.so* ${INSTALL_DIR}/lib64/ 383 | RUN cp -a /usr/lib64/libgcrypt.so* ${INSTALL_DIR}/lib64/ 384 | RUN cp -a /usr/lib64/libreadline.so?* ${INSTALL_DIR}/lib64/ 385 | RUN cp -a /usr/lib64/libasprintf.so* ${INSTALL_DIR}/lib64/ 386 | RUN cp -a /usr/lib64/libgettextpo.so* ${INSTALL_DIR}/lib64/ 387 | RUN cp -a /usr/lib64/preloadable_libintl.so* ${INSTALL_DIR}/lib64/ 388 | RUN cp -a /usr/lib64/lib*xslt*.so* ${INSTALL_DIR}/lib64/ 389 | RUN cp -a /usr/lib64/libsqlite3*.so* ${INSTALL_DIR}/lib64/ 390 | 391 | RUN set -xe \ 392 | && ./buildconf --force \ 393 | && CFLAGS="-fstack-protector-strong -fpic -fpie -Os -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \ 394 | CPPFLAGS="-fstack-protector-strong -fpic -fpie -Os -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \ 395 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib -Wl,-O1 -Wl,--strip-all -Wl,--hash-style=both -pie" \ 396 | ./configure \ 397 | --build=x86_64-pc-linux-gnu \ 398 | --prefix=${INSTALL_DIR} \ 399 | --enable-option-checking=fatal \ 400 | --with-config-file-path=${INSTALL_DIR}/etc/php \ 401 | --with-config-file-scan-dir=${INSTALL_DIR}/etc/php/conf.d:/var/task/php/conf.d \ 402 | --enable-fpm \ 403 | --disable-cgi \ 404 | --enable-cli \ 405 | --with-jpeg=${INSTALL_DIR} \ 406 | --with-xsl=${INSTALL_DIR} \ 407 | --enable-gd \ 408 | --disable-phpdbg \ 409 | # --disable-phpdbg-webhelper \ 410 | --with-sodium \ 411 | --with-readline \ 412 | --with-openssl \ 413 | --with-zlib=${INSTALL_DIR} \ 414 | --with-curl \ 415 | --enable-bcmath \ 416 | --enable-sockets \ 417 | --enable-exif \ 418 | --enable-ftp \ 419 | --with-gettext \ 420 | --with-pear \ 421 | --enable-mbstring \ 422 | --enable-soap \ 423 | --with-pdo-mysql=shared,mysqlnd \ 424 | --enable-pcntl \ 425 | --with-zip \ 426 | --with-pdo-pgsql=shared,${INSTALL_DIR} \ 427 | --enable-intl=shared 428 | 429 | RUN make -j $(nproc) 430 | 431 | # Override PEAR URL Since It Is Down 432 | 433 | RUN set -xe; \ 434 | make install PEAR_INSTALLER_URL='https://github.com/pear/pearweb_phars/raw/master/install-pear-nozlib.phar'; \ 435 | { find ${INSTALL_DIR}/bin ${INSTALL_DIR}/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ 436 | make clean; \ 437 | cp php.ini-production ${INSTALL_DIR}/etc/php/php.ini 438 | 439 | # Build Redis (https://pecl.php.net/package/redis/) 440 | 441 | ARG redis 442 | ENV VERSION_REDIS=${redis} 443 | 444 | RUN pecl install -f redis-${VERSION_REDIS} 445 | 446 | # Strip All Unneeded Symbols 447 | 448 | RUN find ${INSTALL_DIR} -type f -name "*.so*" -o -name "*.a" -exec strip --strip-unneeded {} \; 449 | RUN find ${INSTALL_DIR} -type f -executable -exec sh -c "file -i '{}' | grep -q 'x-executable; charset=binary'" \; -print|xargs strip --strip-all 450 | 451 | # Symlink All Binaries / Libaries 452 | 453 | RUN mkdir -p /opt/bin 454 | RUN mkdir -p /opt/lib 455 | RUN mkdir -p /opt/lib/curl 456 | 457 | RUN cp /opt/vapor/bin/* /opt/bin 458 | RUN cp /opt/vapor/sbin/* /opt/bin 459 | RUN cp /opt/vapor/lib/php/extensions/no-debug-non-zts-20210902/* /opt/bin 460 | 461 | RUN cp /opt/vapor/lib/* /opt/lib || true 462 | RUN cp /opt/vapor/lib/libcurl* /opt/lib/curl || true 463 | 464 | RUN cp "${INSTALL_DIR}/ssl/cert.pem" /opt/lib/curl/cert.pem 465 | RUN cp /opt/vapor/lib64/* /opt/lib || true 466 | 467 | RUN ls /opt/bin 468 | RUN /opt/bin/php -i | grep curl 469 | 470 | # Copy Everything To The Base Container 471 | 472 | FROM amazonlinux:2 473 | 474 | ENV INSTALL_DIR="/opt/vapor" 475 | 476 | ENV PATH="/opt/bin:${PATH}" \ 477 | LD_LIBRARY_PATH="${INSTALL_DIR}/lib64:${INSTALL_DIR}/lib" 478 | 479 | RUN mkdir -p /opt 480 | 481 | WORKDIR /opt 482 | 483 | COPY --from=php_builder /opt /opt 484 | RUN LD_LIBRARY_PATH= yum -y install zip 485 | -------------------------------------------------------------------------------- /php81al2/runtime/bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | while true 4 | do 5 | /opt/bin/php /opt/bootstrap.php 6 | done 7 | -------------------------------------------------------------------------------- /php81al2/runtime/bootstrap.php: -------------------------------------------------------------------------------- 1 | #!/opt/bin/php 2 | $value){ 9 | $buildArguments .= "--build-arg $key=$value "; 10 | } 11 | 12 | print $buildArguments; 13 | -------------------------------------------------------------------------------- /php82al2-arm/php.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=linux/arm64 vapor/runtime/compiler:latest as php_builder 2 | 3 | SHELL ["/bin/bash", "-c"] 4 | 5 | ENV BUILD_DIR="/tmp/build" 6 | ENV INSTALL_DIR="/opt/vapor" 7 | 8 | # Configure Default Compiler Variables 9 | 10 | ENV PKG_CONFIG_PATH="${INSTALL_DIR}/lib64/pkgconfig:${INSTALL_DIR}/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig" \ 11 | PKG_CONFIG="/usr/bin/pkg-config" \ 12 | PATH="${INSTALL_DIR}/bin:${PATH}" 13 | 14 | ENV LD_LIBRARY_PATH="${INSTALL_DIR}/lib64:${INSTALL_DIR}/lib" 15 | 16 | # Create All The Necessary Build Directories 17 | 18 | RUN mkdir -p ${BUILD_DIR} \ 19 | ${INSTALL_DIR}/bin \ 20 | ${INSTALL_DIR}/doc \ 21 | ${INSTALL_DIR}/etc/php \ 22 | ${INSTALL_DIR}/etc/php/conf.d \ 23 | ${INSTALL_DIR}/include \ 24 | ${INSTALL_DIR}/lib \ 25 | ${INSTALL_DIR}/lib64 \ 26 | ${INSTALL_DIR}/libexec \ 27 | ${INSTALL_DIR}/sbin \ 28 | ${INSTALL_DIR}/share 29 | 30 | 31 | # Build ZLIB (https://github.com/madler/zlib/releases) 32 | 33 | ARG zlib 34 | ENV VERSION_ZLIB=${zlib} 35 | ENV ZLIB_BUILD_DIR=${BUILD_DIR}/zlib 36 | 37 | RUN set -xe; \ 38 | mkdir -p ${ZLIB_BUILD_DIR}; \ 39 | curl -Ls https://github.com/madler/zlib/releases/download/v${VERSION_ZLIB}/zlib-${VERSION_ZLIB}.tar.xz \ 40 | | tar xJC ${ZLIB_BUILD_DIR} --strip-components=1 41 | 42 | WORKDIR ${ZLIB_BUILD_DIR}/ 43 | 44 | RUN set -xe; \ 45 | make distclean \ 46 | && CFLAGS="" \ 47 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 48 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 49 | ./configure \ 50 | --prefix=${INSTALL_DIR} 51 | 52 | RUN set -xe; \ 53 | make install \ 54 | && rm ${INSTALL_DIR}/lib/libz.a 55 | 56 | # Build OpenSSL (https://github.com/openssl/openssl/releases) 57 | 58 | ARG openssl 59 | ENV VERSION_OPENSSL=${openssl} 60 | ENV OPENSSL_BUILD_DIR=${BUILD_DIR}/openssl 61 | ENV CA_BUNDLE_SOURCE="https://curl.se/ca/cacert.pem" 62 | ENV CA_BUNDLE="${INSTALL_DIR}/ssl/cert.pem" 63 | 64 | RUN set -xe; \ 65 | mkdir -p ${OPENSSL_BUILD_DIR}; \ 66 | curl -Ls https://github.com/openssl/openssl/archive/openssl-${VERSION_OPENSSL}.tar.gz \ 67 | | tar xzC ${OPENSSL_BUILD_DIR} --strip-components=1 68 | 69 | WORKDIR ${OPENSSL_BUILD_DIR}/ 70 | 71 | RUN set -xe; \ 72 | CFLAGS="" \ 73 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 74 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 75 | ./config \ 76 | --prefix=${INSTALL_DIR} \ 77 | --openssldir=${INSTALL_DIR}/ssl \ 78 | --release \ 79 | enable-tls1_3 \ 80 | no-tests \ 81 | shared \ 82 | zlib 83 | 84 | RUN set -xe; \ 85 | make install \ 86 | && curl -L -k -o ${CA_BUNDLE} ${CA_BUNDLE_SOURCE} 87 | 88 | # Build LibXML2 (https://gitlab.gnome.org/GNOME/libxml2/-/releases) 89 | 90 | ARG libxml2 91 | ENV VERSION_XML2=${libxml2} 92 | ENV XML2_BUILD_DIR=${BUILD_DIR}/xml2 93 | 94 | RUN set -xe; \ 95 | mkdir -p ${XML2_BUILD_DIR}; \ 96 | curl -Ls https://download.gnome.org/sources/libxml2/${VERSION_XML2%.*}/libxml2-${VERSION_XML2}.tar.xz \ 97 | | tar xJC ${XML2_BUILD_DIR} --strip-components=1 98 | 99 | WORKDIR ${XML2_BUILD_DIR}/ 100 | 101 | RUN set -xe; \ 102 | CFLAGS="" \ 103 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 104 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 105 | ./configure \ 106 | --prefix=${INSTALL_DIR} \ 107 | --with-sysroot=${INSTALL_DIR} \ 108 | --enable-shared \ 109 | --disable-static \ 110 | --with-html \ 111 | --with-history \ 112 | --enable-ipv6=no \ 113 | --with-icu \ 114 | --with-zlib=${INSTALL_DIR} \ 115 | --without-python 116 | 117 | RUN set -xe; \ 118 | make install \ 119 | && cp xml2-config ${INSTALL_DIR}/bin/xml2-config 120 | 121 | # Build LibSSH2 (https://github.com/libssh2/libssh2/releases/) 122 | 123 | ARG libssh2 124 | ENV VERSION_LIBSSH2=${libssh2} 125 | ENV LIBSSH2_BUILD_DIR=${BUILD_DIR}/libssh2 126 | 127 | RUN set -xe; \ 128 | mkdir -p ${LIBSSH2_BUILD_DIR}/bin; \ 129 | curl -Ls https://github.com/libssh2/libssh2/releases/download/libssh2-${VERSION_LIBSSH2}/libssh2-${VERSION_LIBSSH2}.tar.gz \ 130 | | tar xzC ${LIBSSH2_BUILD_DIR} --strip-components=1 131 | 132 | WORKDIR ${LIBSSH2_BUILD_DIR}/bin/ 133 | 134 | RUN set -xe; \ 135 | CFLAGS="" \ 136 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 137 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 138 | cmake .. \ 139 | -DBUILD_SHARED_LIBS=ON \ 140 | -DCRYPTO_BACKEND=OpenSSL \ 141 | -DENABLE_ZLIB_COMPRESSION=ON \ 142 | -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ 143 | -DCMAKE_BUILD_TYPE=RELEASE 144 | 145 | RUN set -xe; \ 146 | cmake --build . --target install 147 | 148 | # Build nghttp2 (https://github.com/nghttp2/nghttp2/releases/) 149 | 150 | ARG nghttp2 151 | ENV VERSION_NGHTTP2=${nghttp2} 152 | ENV NGHTTP2_BUILD_DIR=${BUILD_DIR}/nghttp2 153 | 154 | RUN set -xe; \ 155 | mkdir -p ${NGHTTP2_BUILD_DIR}/bin; \ 156 | curl -Ls https://github.com/nghttp2/nghttp2/releases/download/v${VERSION_NGHTTP2}/nghttp2-${VERSION_NGHTTP2}.tar.gz \ 157 | | tar xzC ${NGHTTP2_BUILD_DIR} --strip-components=1 158 | 159 | WORKDIR ${NGHTTP2_BUILD_DIR}/ 160 | 161 | RUN set -xe; \ 162 | CFLAGS="" \ 163 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 164 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 165 | ./configure --enable-lib-only --prefix=${INSTALL_DIR} && \ 166 | make -j $(nproc) && \ 167 | make install 168 | 169 | # Build Curl (https://github.com/curl/curl/releases/) 170 | 171 | ARG curl 172 | ENV VERSION_CURL=${curl} 173 | ENV CURL_BUILD_DIR=${BUILD_DIR}/curl 174 | 175 | RUN set -xe; \ 176 | mkdir -p ${CURL_BUILD_DIR}/bin; \ 177 | curl -Ls https://github.com/curl/curl/archive/curl-${VERSION_CURL//./_}.tar.gz \ 178 | | tar xzC ${CURL_BUILD_DIR} --strip-components=1 179 | 180 | WORKDIR ${CURL_BUILD_DIR}/ 181 | 182 | RUN set -xe; \ 183 | ./buildconf \ 184 | && CFLAGS="" \ 185 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 186 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 187 | ./configure \ 188 | --prefix=${INSTALL_DIR} \ 189 | --with-ca-bundle=${CA_BUNDLE} \ 190 | --enable-shared \ 191 | --disable-static \ 192 | --enable-optimize \ 193 | --disable-warnings \ 194 | --disable-dependency-tracking \ 195 | --with-zlib \ 196 | --enable-http \ 197 | --enable-ftp \ 198 | --enable-file \ 199 | --enable-ldaps \ 200 | --enable-proxy \ 201 | --enable-tftp \ 202 | --enable-ipv6 \ 203 | --enable-openssl-auto-load-config \ 204 | --enable-cookies \ 205 | --with-gnu-ld \ 206 | --with-ssl \ 207 | --with-libssh2 \ 208 | --with-nghttp2 \ 209 | --without-libpsl 210 | 211 | RUN set -xe; \ 212 | make install 213 | 214 | # Build Libzip (https://github.com/nih-at/libzip/releases) 215 | 216 | ARG libzip 217 | ENV VERSION_ZIP=${libzip} 218 | ENV ZIP_BUILD_DIR=${BUILD_DIR}/zip 219 | 220 | RUN set -xe; \ 221 | mkdir -p ${ZIP_BUILD_DIR}/bin/; \ 222 | # Download and upack the source code 223 | curl -Ls https://github.com/nih-at/libzip/releases/download/v${VERSION_ZIP}/libzip-${VERSION_ZIP}.tar.gz \ 224 | | tar xzC ${ZIP_BUILD_DIR} --strip-components=1 225 | 226 | # Move into the unpackaged code directory 227 | WORKDIR ${ZIP_BUILD_DIR}/bin/ 228 | 229 | # Configure the build 230 | RUN set -xe; \ 231 | CFLAGS="" \ 232 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 233 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 234 | cmake .. \ 235 | -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ 236 | -DCMAKE_BUILD_TYPE=RELEASE 237 | 238 | RUN set -xe; \ 239 | cmake --build . --target install 240 | 241 | # Build Libsodium (https://github.com/jedisct1/libsodium/releases) 242 | 243 | ARG libsodium 244 | ENV VERSION_LIBSODIUM=${libsodium} 245 | ENV LIBSODIUM_BUILD_DIR=${BUILD_DIR}/libsodium 246 | 247 | RUN set -xe; \ 248 | mkdir -p ${LIBSODIUM_BUILD_DIR}; \ 249 | curl -Ls https://github.com/jedisct1/libsodium/archive/${VERSION_LIBSODIUM}-RELEASE.tar.gz \ 250 | | tar xzC ${LIBSODIUM_BUILD_DIR} --strip-components=1 251 | 252 | WORKDIR ${LIBSODIUM_BUILD_DIR}/ 253 | 254 | RUN set -xe; \ 255 | CFLAGS="" \ 256 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 257 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 258 | ./autogen.sh \ 259 | && ./configure --prefix=${INSTALL_DIR} 260 | 261 | RUN set -xe; \ 262 | make install 263 | 264 | # Build Postgres (https://github.com/postgres/postgres/releases/) 265 | 266 | ARG postgres 267 | ENV VERSION_POSTGRES=${postgres} 268 | ENV POSTGRES_BUILD_DIR=${BUILD_DIR}/postgres 269 | 270 | RUN set -xe; \ 271 | mkdir -p ${POSTGRES_BUILD_DIR}/bin; \ 272 | curl -Ls https://github.com/postgres/postgres/archive/REL_${VERSION_POSTGRES//./_}.tar.gz \ 273 | | tar xzC ${POSTGRES_BUILD_DIR} --strip-components=1 274 | 275 | WORKDIR ${POSTGRES_BUILD_DIR}/ 276 | 277 | RUN set -xe; \ 278 | CFLAGS="" \ 279 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 280 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 281 | ./configure --prefix=${INSTALL_DIR} --with-openssl --without-readline 282 | 283 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/interfaces/libpq && make && make install 284 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/bin/pg_config && make && make install 285 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/backend && make generated-headers 286 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/include && make install 287 | 288 | # Build libjpeg 289 | 290 | ARG libjpeg 291 | ENV VERSION_LIBJPEG=${libjpeg} 292 | ENV LIBJPEG_BUILD_DIR=${BUILD_DIR}/libjpeg 293 | 294 | RUN set -xe; \ 295 | mkdir -p ${LIBJPEG_BUILD_DIR}/bin; \ 296 | curl -Ls http://www.ijg.org/files/jpegsrc.${VERSION_LIBJPEG}.tar.gz \ 297 | | tar xzC ${LIBJPEG_BUILD_DIR} --strip-components=1 298 | 299 | WORKDIR ${LIBJPEG_BUILD_DIR}/ 300 | 301 | RUN set -xe; \ 302 | CFLAGS="" \ 303 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 304 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 305 | ./configure \ 306 | --prefix=${INSTALL_DIR} \ 307 | --enable-shared \ 308 | --disable-static 309 | 310 | RUN set -xe; \ 311 | make install 312 | 313 | # Build libpng 314 | 315 | ARG libpng 316 | ENV VERSION_LIBPNG=${libpng} 317 | ENV LIBPNG_BUILD_DIR=${BUILD_DIR}/libpng 318 | 319 | RUN set -xe; \ 320 | mkdir -p ${LIBPNG_BUILD_DIR}/bin; \ 321 | curl -Ls https://download.sourceforge.net/libpng/libpng-${VERSION_LIBPNG}.tar.gz \ 322 | | tar xzC ${LIBPNG_BUILD_DIR} --strip-components=1 323 | 324 | WORKDIR ${LIBPNG_BUILD_DIR}/ 325 | 326 | RUN set -xe; \ 327 | CFLAGS="" \ 328 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 329 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 330 | ./configure \ 331 | --prefix=${INSTALL_DIR} \ 332 | --enable-shared \ 333 | --disable-static 334 | 335 | RUN set -xe; \ 336 | make install 337 | 338 | # Build Oniguruma 339 | 340 | ARG oniguruma 341 | ENV VERSION_ONIGURUMA=${oniguruma} 342 | ENV LIBONIG_BUILD_DIR=${BUILD_DIR}/libonig 343 | 344 | RUN set -xe \ 345 | && mkdir -p ${LIBONIG_BUILD_DIR}/bin \ 346 | && curl -Ls https://github.com/kkos/oniguruma/releases/download/v${VERSION_ONIGURUMA}/onig-${VERSION_ONIGURUMA}.tar.gz \ 347 | | tar xzC ${LIBONIG_BUILD_DIR} --strip-components=1 348 | 349 | WORKDIR ${LIBONIG_BUILD_DIR}/ 350 | 351 | RUN set -xe; \ 352 | CFLAGS="" \ 353 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 354 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 355 | && ./configure \ 356 | --prefix=${INSTALL_DIR} \ 357 | --enable-shared \ 358 | --disable-static 359 | 360 | RUN set -xe; \ 361 | make install 362 | 363 | # Build SQLite 364 | 365 | ARG sqlite 366 | ENV VERSION_SQLITE=${sqlite} 367 | ENV SQLITE_BUILD_DIR=${BUILD_DIR}/libsqlite3 368 | 369 | RUN LD_LIBRARY_PATH= yum install -y tcl 370 | 371 | RUN set -xe; \ 372 | mkdir -p ${SQLITE_BUILD_DIR}; \ 373 | curl -Ls https://github.com/sqlite/sqlite/archive/refs/tags/version-${VERSION_SQLITE}.tar.gz \ 374 | | tar xzC ${SQLITE_BUILD_DIR} --strip-components=1 375 | 376 | WORKDIR ${SQLITE_BUILD_DIR}/ 377 | 378 | RUN ./configure --prefix=${INSTALL_DIR} 379 | 380 | RUN make && make install 381 | 382 | # Build PHP 383 | 384 | ARG php 385 | ENV VERSION_PHP=${php} 386 | ENV PHP_BUILD_DIR=${BUILD_DIR}/php 387 | 388 | RUN set -xe; \ 389 | mkdir -p ${PHP_BUILD_DIR}; \ 390 | curl -Ls https://php.net/distributions/php-${VERSION_PHP}.tar.gz \ 391 | | tar xzC ${PHP_BUILD_DIR} --strip-components=1 392 | 393 | # Configure The PHP Build 394 | 395 | WORKDIR ${PHP_BUILD_DIR}/ 396 | 397 | RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel ImageMagick-devel 398 | 399 | RUN cp -a /usr/lib64/libgpg-error.so* ${INSTALL_DIR}/lib64/ 400 | RUN cp -a /usr/lib64/libtinfo.so* ${INSTALL_DIR}/lib64/ 401 | RUN cp -a /usr/lib64/libgcrypt.so* ${INSTALL_DIR}/lib64/ 402 | RUN cp -a /usr/lib64/libreadline.so?* ${INSTALL_DIR}/lib64/ 403 | RUN cp -a /usr/lib64/libasprintf.so* ${INSTALL_DIR}/lib64/ 404 | RUN cp -a /usr/lib64/libgettextpo.so* ${INSTALL_DIR}/lib64/ 405 | RUN cp -a /usr/lib64/preloadable_libintl.so* ${INSTALL_DIR}/lib64/ 406 | RUN cp -a /usr/lib64/lib*xslt*.so* ${INSTALL_DIR}/lib64/ 407 | 408 | RUN set -xe \ 409 | && ./buildconf --force \ 410 | && CFLAGS="-fstack-protector-strong -fpic -fpie -Os -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \ 411 | CPPFLAGS="-fstack-protector-strong -fpic -fpie -Os -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \ 412 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib -Wl,-O1 -Wl,--strip-all -Wl,--hash-style=both -pie" \ 413 | ./configure \ 414 | --prefix=${INSTALL_DIR} \ 415 | --enable-option-checking=fatal \ 416 | --with-config-file-path=${INSTALL_DIR}/etc/php \ 417 | --with-config-file-scan-dir=${INSTALL_DIR}/etc/php/conf.d:/var/task/php/conf.d \ 418 | --enable-fpm \ 419 | --disable-cgi \ 420 | --enable-cli \ 421 | --with-jpeg=${INSTALL_DIR} \ 422 | --with-xsl=${INSTALL_DIR} \ 423 | --enable-gd \ 424 | --disable-phpdbg \ 425 | # --disable-phpdbg-webhelper \ 426 | --with-sodium \ 427 | --with-readline \ 428 | --with-openssl \ 429 | --with-zlib=${INSTALL_DIR} \ 430 | --with-curl \ 431 | --enable-bcmath \ 432 | --enable-sockets \ 433 | --enable-exif \ 434 | --enable-ftp \ 435 | --with-gettext \ 436 | --with-pear \ 437 | --enable-mbstring \ 438 | --enable-soap \ 439 | --with-pdo-mysql=shared,mysqlnd \ 440 | --enable-pcntl \ 441 | --with-zip \ 442 | --with-pdo-pgsql=shared,${INSTALL_DIR} \ 443 | --enable-intl=shared 444 | 445 | RUN make -j $(nproc) 446 | 447 | # Override PEAR URL Since It Is Down 448 | 449 | RUN set -xe; \ 450 | make install PEAR_INSTALLER_URL='https://github.com/pear/pearweb_phars/raw/master/install-pear-nozlib.phar'; \ 451 | { find ${INSTALL_DIR}/bin ${INSTALL_DIR}/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ 452 | make clean; \ 453 | cp php.ini-production ${INSTALL_DIR}/etc/php/php.ini 454 | 455 | # Build Redis (https://pecl.php.net/package/redis/) 456 | 457 | ARG redis 458 | ENV VERSION_REDIS=${redis} 459 | 460 | RUN pecl install -f redis-${VERSION_REDIS} 461 | 462 | # Strip All Unneeded Symbols 463 | 464 | RUN find ${INSTALL_DIR} -type f -name "*.so*" -o -name "*.a" -exec strip --strip-unneeded {} \; 465 | RUN find ${INSTALL_DIR} -type f -executable -exec sh -c "file -i '{}' | grep -q 'x-executable; charset=binary'" \; -print|xargs strip --strip-all 466 | 467 | # Symlink All Binaries / Libaries 468 | 469 | RUN mkdir -p /opt/bin 470 | RUN mkdir -p /opt/lib 471 | RUN mkdir -p /opt/lib/curl 472 | 473 | RUN cp /opt/vapor/bin/* /opt/bin 474 | RUN cp /opt/vapor/sbin/* /opt/bin 475 | RUN cp /opt/vapor/lib/php/extensions/no-debug-non-zts-20220829/* /opt/bin 476 | 477 | RUN cp /opt/vapor/lib/* /opt/lib || true 478 | RUN cp /opt/vapor/lib/libcurl* /opt/lib/curl || true 479 | 480 | RUN cp "${INSTALL_DIR}/ssl/cert.pem" /opt/lib/curl/cert.pem 481 | RUN cp /opt/vapor/lib64/* /opt/lib || true 482 | 483 | RUN ls /opt/bin 484 | RUN /opt/bin/php -i | grep curl 485 | 486 | # Copy Everything To The Base Container 487 | 488 | FROM --platform=linux/arm64 amazonlinux:2 489 | 490 | ENV INSTALL_DIR="/opt/vapor" 491 | 492 | ENV PATH="/opt/bin:${PATH}" \ 493 | LD_LIBRARY_PATH="${INSTALL_DIR}/lib64:${INSTALL_DIR}/lib" 494 | 495 | RUN mkdir -p /opt 496 | 497 | WORKDIR /opt 498 | 499 | COPY --from=php_builder /opt /opt 500 | RUN LD_LIBRARY_PATH= yum -y install zip 501 | -------------------------------------------------------------------------------- /php82al2-arm/runtime/bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | while true 4 | do 5 | /opt/bin/php /opt/bootstrap.php 6 | done 7 | -------------------------------------------------------------------------------- /php82al2-arm/runtime/bootstrap.php: -------------------------------------------------------------------------------- 1 | #!/opt/bin/php 2 | $value){ 9 | $buildArguments .= "--build-arg $key=$value "; 10 | } 11 | 12 | print $buildArguments; 13 | -------------------------------------------------------------------------------- /php82al2/php.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=linux/amd64 vapor/runtime/compiler:latest as php_builder 2 | 3 | SHELL ["/bin/bash", "-c"] 4 | 5 | ENV BUILD_DIR="/tmp/build" 6 | ENV INSTALL_DIR="/opt/vapor" 7 | 8 | # Configure Default Compiler Variables 9 | 10 | ENV PKG_CONFIG_PATH="${INSTALL_DIR}/lib64/pkgconfig:${INSTALL_DIR}/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig" \ 11 | PKG_CONFIG="/usr/bin/pkg-config" \ 12 | PATH="${INSTALL_DIR}/bin:${PATH}" 13 | 14 | ENV LD_LIBRARY_PATH="${INSTALL_DIR}/lib64:${INSTALL_DIR}/lib" 15 | 16 | # Create All The Necessary Build Directories 17 | 18 | RUN mkdir -p ${BUILD_DIR} \ 19 | ${INSTALL_DIR}/bin \ 20 | ${INSTALL_DIR}/doc \ 21 | ${INSTALL_DIR}/etc/php \ 22 | ${INSTALL_DIR}/etc/php/conf.d \ 23 | ${INSTALL_DIR}/include \ 24 | ${INSTALL_DIR}/lib \ 25 | ${INSTALL_DIR}/lib64 \ 26 | ${INSTALL_DIR}/libexec \ 27 | ${INSTALL_DIR}/sbin \ 28 | ${INSTALL_DIR}/share 29 | 30 | 31 | # Build ZLIB (https://github.com/madler/zlib/releases) 32 | 33 | ARG zlib 34 | ENV VERSION_ZLIB=${zlib} 35 | ENV ZLIB_BUILD_DIR=${BUILD_DIR}/zlib 36 | 37 | RUN set -xe; \ 38 | mkdir -p ${ZLIB_BUILD_DIR}; \ 39 | curl -Ls https://github.com/madler/zlib/releases/download/v${VERSION_ZLIB}/zlib-${VERSION_ZLIB}.tar.xz \ 40 | | tar xJC ${ZLIB_BUILD_DIR} --strip-components=1 41 | 42 | WORKDIR ${ZLIB_BUILD_DIR}/ 43 | 44 | RUN set -xe; \ 45 | make distclean \ 46 | && CFLAGS="" \ 47 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 48 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 49 | ./configure \ 50 | --prefix=${INSTALL_DIR} \ 51 | --64 52 | 53 | RUN set -xe; \ 54 | make install \ 55 | && rm ${INSTALL_DIR}/lib/libz.a 56 | 57 | # Build OpenSSL (https://github.com/openssl/openssl/releases) 58 | 59 | ARG openssl 60 | ENV VERSION_OPENSSL=${openssl} 61 | ENV OPENSSL_BUILD_DIR=${BUILD_DIR}/openssl 62 | ENV CA_BUNDLE_SOURCE="https://curl.se/ca/cacert.pem" 63 | ENV CA_BUNDLE="${INSTALL_DIR}/ssl/cert.pem" 64 | 65 | RUN set -xe; \ 66 | mkdir -p ${OPENSSL_BUILD_DIR}; \ 67 | curl -Ls https://github.com/openssl/openssl/archive/openssl-${VERSION_OPENSSL}.tar.gz \ 68 | | tar xzC ${OPENSSL_BUILD_DIR} --strip-components=1 69 | 70 | WORKDIR ${OPENSSL_BUILD_DIR}/ 71 | 72 | RUN set -xe; \ 73 | CFLAGS="" \ 74 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 75 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 76 | ./config \ 77 | --prefix=${INSTALL_DIR} \ 78 | --openssldir=${INSTALL_DIR}/ssl \ 79 | --release \ 80 | enable-tls1_3 \ 81 | no-tests \ 82 | shared \ 83 | zlib 84 | 85 | RUN set -xe; \ 86 | make install \ 87 | && curl -L -k -o ${CA_BUNDLE} ${CA_BUNDLE_SOURCE} 88 | 89 | # Build LibXML2 (https://gitlab.gnome.org/GNOME/libxml2/-/releases) 90 | 91 | ARG libxml2 92 | ENV VERSION_XML2=${libxml2} 93 | ENV XML2_BUILD_DIR=${BUILD_DIR}/xml2 94 | 95 | RUN set -xe; \ 96 | mkdir -p ${XML2_BUILD_DIR}; \ 97 | curl -Ls https://download.gnome.org/sources/libxml2/${VERSION_XML2%.*}/libxml2-${VERSION_XML2}.tar.xz \ 98 | | tar xJC ${XML2_BUILD_DIR} --strip-components=1 99 | 100 | WORKDIR ${XML2_BUILD_DIR}/ 101 | 102 | RUN set -xe; \ 103 | CFLAGS="" \ 104 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 105 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 106 | ./configure \ 107 | --prefix=${INSTALL_DIR} \ 108 | --with-sysroot=${INSTALL_DIR} \ 109 | --enable-shared \ 110 | --disable-static \ 111 | --with-html \ 112 | --with-history \ 113 | --enable-ipv6=no \ 114 | --with-icu \ 115 | --with-zlib=${INSTALL_DIR} \ 116 | --without-python 117 | 118 | RUN set -xe; \ 119 | make install \ 120 | && cp xml2-config ${INSTALL_DIR}/bin/xml2-config 121 | 122 | # Build LibSSH2 (https://github.com/libssh2/libssh2/releases/) 123 | 124 | ARG libssh2 125 | ENV VERSION_LIBSSH2=${libssh2} 126 | ENV LIBSSH2_BUILD_DIR=${BUILD_DIR}/libssh2 127 | 128 | RUN set -xe; \ 129 | mkdir -p ${LIBSSH2_BUILD_DIR}/bin; \ 130 | curl -Ls https://github.com/libssh2/libssh2/releases/download/libssh2-${VERSION_LIBSSH2}/libssh2-${VERSION_LIBSSH2}.tar.gz \ 131 | | tar xzC ${LIBSSH2_BUILD_DIR} --strip-components=1 132 | 133 | WORKDIR ${LIBSSH2_BUILD_DIR}/bin/ 134 | 135 | RUN set -xe; \ 136 | CFLAGS="" \ 137 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 138 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 139 | cmake .. \ 140 | -DBUILD_SHARED_LIBS=ON \ 141 | -DCRYPTO_BACKEND=OpenSSL \ 142 | -DENABLE_ZLIB_COMPRESSION=ON \ 143 | -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ 144 | -DCMAKE_BUILD_TYPE=RELEASE 145 | 146 | RUN set -xe; \ 147 | cmake --build . --target install 148 | 149 | # Build nghttp2 (https://github.com/nghttp2/nghttp2/releases/) 150 | 151 | ARG nghttp2 152 | ENV VERSION_NGHTTP2=${nghttp2} 153 | ENV NGHTTP2_BUILD_DIR=${BUILD_DIR}/nghttp2 154 | 155 | RUN set -xe; \ 156 | mkdir -p ${NGHTTP2_BUILD_DIR}/bin; \ 157 | curl -Ls https://github.com/nghttp2/nghttp2/releases/download/v${VERSION_NGHTTP2}/nghttp2-${VERSION_NGHTTP2}.tar.gz \ 158 | | tar xzC ${NGHTTP2_BUILD_DIR} --strip-components=1 159 | 160 | WORKDIR ${NGHTTP2_BUILD_DIR}/ 161 | 162 | RUN set -xe; \ 163 | CFLAGS="" \ 164 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 165 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 166 | ./configure --enable-lib-only --prefix=${INSTALL_DIR} && \ 167 | make -j $(nproc) && \ 168 | make install 169 | 170 | # Build Curl (https://github.com/curl/curl/releases/) 171 | 172 | ARG curl 173 | ENV VERSION_CURL=${curl} 174 | ENV CURL_BUILD_DIR=${BUILD_DIR}/curl 175 | 176 | RUN set -xe; \ 177 | mkdir -p ${CURL_BUILD_DIR}/bin; \ 178 | curl -Ls https://github.com/curl/curl/archive/curl-${VERSION_CURL//./_}.tar.gz \ 179 | | tar xzC ${CURL_BUILD_DIR} --strip-components=1 180 | 181 | WORKDIR ${CURL_BUILD_DIR}/ 182 | 183 | RUN set -xe; \ 184 | ./buildconf \ 185 | && CFLAGS="" \ 186 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 187 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 188 | ./configure \ 189 | --prefix=${INSTALL_DIR} \ 190 | --with-ca-bundle=${CA_BUNDLE} \ 191 | --enable-shared \ 192 | --disable-static \ 193 | --enable-optimize \ 194 | --disable-warnings \ 195 | --disable-dependency-tracking \ 196 | --with-zlib \ 197 | --enable-http \ 198 | --enable-ftp \ 199 | --enable-file \ 200 | --enable-ldaps \ 201 | --enable-proxy \ 202 | --enable-tftp \ 203 | --enable-ipv6 \ 204 | --enable-openssl-auto-load-config \ 205 | --enable-cookies \ 206 | --with-gnu-ld \ 207 | --with-ssl \ 208 | --with-libssh2 \ 209 | --with-nghttp2 \ 210 | --without-libpsl 211 | 212 | RUN set -xe; \ 213 | make install 214 | 215 | # Build Libzip (https://github.com/nih-at/libzip/releases) 216 | 217 | ARG libzip 218 | ENV VERSION_ZIP=${libzip} 219 | ENV ZIP_BUILD_DIR=${BUILD_DIR}/zip 220 | 221 | RUN set -xe; \ 222 | mkdir -p ${ZIP_BUILD_DIR}/bin/; \ 223 | # Download and upack the source code 224 | curl -Ls https://github.com/nih-at/libzip/releases/download/v${VERSION_ZIP}/libzip-${VERSION_ZIP}.tar.gz \ 225 | | tar xzC ${ZIP_BUILD_DIR} --strip-components=1 226 | 227 | # Move into the unpackaged code directory 228 | WORKDIR ${ZIP_BUILD_DIR}/bin/ 229 | 230 | # Configure the build 231 | RUN set -xe; \ 232 | CFLAGS="" \ 233 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 234 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 235 | cmake .. \ 236 | -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ 237 | -DCMAKE_BUILD_TYPE=RELEASE 238 | 239 | RUN set -xe; \ 240 | cmake --build . --target install 241 | 242 | # Build Libsodium (https://github.com/jedisct1/libsodium/releases) 243 | 244 | ARG libsodium 245 | ENV VERSION_LIBSODIUM=${libsodium} 246 | ENV LIBSODIUM_BUILD_DIR=${BUILD_DIR}/libsodium 247 | 248 | RUN set -xe; \ 249 | mkdir -p ${LIBSODIUM_BUILD_DIR}; \ 250 | curl -Ls https://github.com/jedisct1/libsodium/archive/${VERSION_LIBSODIUM}-RELEASE.tar.gz \ 251 | | tar xzC ${LIBSODIUM_BUILD_DIR} --strip-components=1 252 | 253 | WORKDIR ${LIBSODIUM_BUILD_DIR}/ 254 | 255 | RUN set -xe; \ 256 | CFLAGS="" \ 257 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 258 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 259 | ./autogen.sh \ 260 | && ./configure --prefix=${INSTALL_DIR} 261 | 262 | RUN set -xe; \ 263 | make install 264 | 265 | # Build Postgres (https://github.com/postgres/postgres/releases/) 266 | 267 | ARG postgres 268 | ENV VERSION_POSTGRES=${postgres} 269 | ENV POSTGRES_BUILD_DIR=${BUILD_DIR}/postgres 270 | 271 | RUN set -xe; \ 272 | mkdir -p ${POSTGRES_BUILD_DIR}/bin; \ 273 | curl -Ls https://github.com/postgres/postgres/archive/REL_${VERSION_POSTGRES//./_}.tar.gz \ 274 | | tar xzC ${POSTGRES_BUILD_DIR} --strip-components=1 275 | 276 | WORKDIR ${POSTGRES_BUILD_DIR}/ 277 | 278 | RUN set -xe; \ 279 | CFLAGS="" \ 280 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 281 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 282 | ./configure --prefix=${INSTALL_DIR} --with-openssl --without-readline 283 | 284 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/interfaces/libpq && make && make install 285 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/bin/pg_config && make && make install 286 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/backend && make generated-headers 287 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/include && make install 288 | 289 | # Build libjpeg 290 | 291 | ARG libjpeg 292 | ENV VERSION_LIBJPEG=${libjpeg} 293 | ENV LIBJPEG_BUILD_DIR=${BUILD_DIR}/libjpeg 294 | 295 | RUN set -xe; \ 296 | mkdir -p ${LIBJPEG_BUILD_DIR}/bin; \ 297 | curl -Ls http://www.ijg.org/files/jpegsrc.${VERSION_LIBJPEG}.tar.gz \ 298 | | tar xzC ${LIBJPEG_BUILD_DIR} --strip-components=1 299 | 300 | WORKDIR ${LIBJPEG_BUILD_DIR}/ 301 | 302 | RUN set -xe; \ 303 | CFLAGS="" \ 304 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 305 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 306 | ./configure \ 307 | --prefix=${INSTALL_DIR} \ 308 | --enable-shared \ 309 | --disable-static 310 | 311 | RUN set -xe; \ 312 | make install 313 | 314 | # Build libpng 315 | 316 | ARG libpng 317 | ENV VERSION_LIBPNG=${libpng} 318 | ENV LIBPNG_BUILD_DIR=${BUILD_DIR}/libpng 319 | 320 | RUN set -xe; \ 321 | mkdir -p ${LIBPNG_BUILD_DIR}/bin; \ 322 | curl -Ls https://download.sourceforge.net/libpng/libpng-${VERSION_LIBPNG}.tar.gz \ 323 | | tar xzC ${LIBPNG_BUILD_DIR} --strip-components=1 324 | 325 | WORKDIR ${LIBPNG_BUILD_DIR}/ 326 | 327 | RUN set -xe; \ 328 | CFLAGS="" \ 329 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 330 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 331 | ./configure \ 332 | --prefix=${INSTALL_DIR} \ 333 | --enable-shared \ 334 | --disable-static 335 | 336 | RUN set -xe; \ 337 | make install 338 | 339 | # Build Oniguruma 340 | 341 | ARG oniguruma 342 | ENV VERSION_ONIGURUMA=${oniguruma} 343 | ENV LIBONIG_BUILD_DIR=${BUILD_DIR}/libonig 344 | 345 | RUN set -xe \ 346 | && mkdir -p ${LIBONIG_BUILD_DIR}/bin \ 347 | && curl -Ls https://github.com/kkos/oniguruma/releases/download/v${VERSION_ONIGURUMA}/onig-${VERSION_ONIGURUMA}.tar.gz \ 348 | | tar xzC ${LIBONIG_BUILD_DIR} --strip-components=1 349 | 350 | WORKDIR ${LIBONIG_BUILD_DIR}/ 351 | 352 | RUN set -xe; \ 353 | CFLAGS="" \ 354 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 355 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 356 | && ./configure \ 357 | --prefix=${INSTALL_DIR} \ 358 | --enable-shared \ 359 | --disable-static 360 | 361 | RUN set -xe; \ 362 | make install 363 | 364 | # Build SQLite 365 | 366 | ARG sqlite 367 | ENV VERSION_SQLITE=${sqlite} 368 | ENV SQLITE_BUILD_DIR=${BUILD_DIR}/libsqlite3 369 | 370 | RUN LD_LIBRARY_PATH= yum install -y tcl 371 | 372 | RUN set -xe; \ 373 | mkdir -p ${SQLITE_BUILD_DIR}; \ 374 | curl -Ls https://github.com/sqlite/sqlite/archive/refs/tags/version-${VERSION_SQLITE}.tar.gz \ 375 | | tar xzC ${SQLITE_BUILD_DIR} --strip-components=1 376 | 377 | WORKDIR ${SQLITE_BUILD_DIR}/ 378 | 379 | RUN ./configure --prefix=${INSTALL_DIR} 380 | 381 | RUN make && make install 382 | 383 | # Build PHP 384 | 385 | ARG php 386 | ENV VERSION_PHP=${php} 387 | ENV PHP_BUILD_DIR=${BUILD_DIR}/php 388 | 389 | RUN set -xe; \ 390 | mkdir -p ${PHP_BUILD_DIR}; \ 391 | curl -Ls https://php.net/distributions/php-${VERSION_PHP}.tar.gz \ 392 | | tar xzC ${PHP_BUILD_DIR} --strip-components=1 393 | 394 | # Configure The PHP Build 395 | 396 | WORKDIR ${PHP_BUILD_DIR}/ 397 | 398 | RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel ImageMagick-devel 399 | 400 | RUN cp -a /usr/lib64/libgpg-error.so* ${INSTALL_DIR}/lib64/ 401 | RUN cp -a /usr/lib64/libtinfo.so* ${INSTALL_DIR}/lib64/ 402 | RUN cp -a /usr/lib64/libgcrypt.so* ${INSTALL_DIR}/lib64/ 403 | RUN cp -a /usr/lib64/libreadline.so?* ${INSTALL_DIR}/lib64/ 404 | RUN cp -a /usr/lib64/libasprintf.so* ${INSTALL_DIR}/lib64/ 405 | RUN cp -a /usr/lib64/libgettextpo.so* ${INSTALL_DIR}/lib64/ 406 | RUN cp -a /usr/lib64/preloadable_libintl.so* ${INSTALL_DIR}/lib64/ 407 | RUN cp -a /usr/lib64/lib*xslt*.so* ${INSTALL_DIR}/lib64/ 408 | 409 | RUN set -xe \ 410 | && ./buildconf --force \ 411 | && CFLAGS="-fstack-protector-strong -fpic -fpie -Os -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \ 412 | CPPFLAGS="-fstack-protector-strong -fpic -fpie -Os -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \ 413 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib -Wl,-O1 -Wl,--strip-all -Wl,--hash-style=both -pie" \ 414 | ./configure \ 415 | --build=x86_64-pc-linux-gnu \ 416 | --prefix=${INSTALL_DIR} \ 417 | --enable-option-checking=fatal \ 418 | --with-config-file-path=${INSTALL_DIR}/etc/php \ 419 | --with-config-file-scan-dir=${INSTALL_DIR}/etc/php/conf.d:/var/task/php/conf.d \ 420 | --enable-fpm \ 421 | --disable-cgi \ 422 | --enable-cli \ 423 | --with-jpeg=${INSTALL_DIR} \ 424 | --with-xsl=${INSTALL_DIR} \ 425 | --enable-gd \ 426 | --disable-phpdbg \ 427 | # --disable-phpdbg-webhelper \ 428 | --with-sodium \ 429 | --with-readline \ 430 | --with-openssl \ 431 | --with-zlib=${INSTALL_DIR} \ 432 | --with-curl \ 433 | --enable-bcmath \ 434 | --enable-sockets \ 435 | --enable-exif \ 436 | --enable-ftp \ 437 | --with-gettext \ 438 | --with-pear \ 439 | --enable-mbstring \ 440 | --enable-soap \ 441 | --with-pdo-mysql=shared,mysqlnd \ 442 | --enable-pcntl \ 443 | --with-zip \ 444 | --with-pdo-pgsql=shared,${INSTALL_DIR} \ 445 | --enable-intl=shared 446 | 447 | RUN make -j $(nproc) 448 | 449 | # Override PEAR URL Since It Is Down 450 | 451 | RUN set -xe; \ 452 | make install PEAR_INSTALLER_URL='https://github.com/pear/pearweb_phars/raw/master/install-pear-nozlib.phar'; \ 453 | { find ${INSTALL_DIR}/bin ${INSTALL_DIR}/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ 454 | make clean; \ 455 | cp php.ini-production ${INSTALL_DIR}/etc/php/php.ini 456 | 457 | # Build Redis (https://pecl.php.net/package/redis/) 458 | 459 | ARG redis 460 | ENV VERSION_REDIS=${redis} 461 | 462 | RUN pecl install -f redis-${VERSION_REDIS} 463 | 464 | # Strip All Unneeded Symbols 465 | 466 | RUN find ${INSTALL_DIR} -type f -name "*.so*" -o -name "*.a" -exec strip --strip-unneeded {} \; 467 | RUN find ${INSTALL_DIR} -type f -executable -exec sh -c "file -i '{}' | grep -q 'x-executable; charset=binary'" \; -print|xargs strip --strip-all 468 | 469 | # Symlink All Binaries / Libaries 470 | 471 | RUN mkdir -p /opt/bin 472 | RUN mkdir -p /opt/lib 473 | RUN mkdir -p /opt/lib/curl 474 | 475 | RUN cp /opt/vapor/bin/* /opt/bin 476 | RUN cp /opt/vapor/sbin/* /opt/bin 477 | RUN cp /opt/vapor/lib/php/extensions/no-debug-non-zts-20220829/* /opt/bin 478 | 479 | RUN cp /opt/vapor/lib/* /opt/lib || true 480 | RUN cp /opt/vapor/lib/libcurl* /opt/lib/curl || true 481 | 482 | RUN cp "${INSTALL_DIR}/ssl/cert.pem" /opt/lib/curl/cert.pem 483 | RUN cp /opt/vapor/lib64/* /opt/lib || true 484 | 485 | RUN ls /opt/bin 486 | RUN /opt/bin/php -i | grep curl 487 | 488 | # Copy Everything To The Base Container 489 | 490 | FROM amazonlinux:2 491 | 492 | ENV INSTALL_DIR="/opt/vapor" 493 | 494 | ENV PATH="/opt/bin:${PATH}" \ 495 | LD_LIBRARY_PATH="${INSTALL_DIR}/lib64:${INSTALL_DIR}/lib" 496 | 497 | RUN mkdir -p /opt 498 | 499 | WORKDIR /opt 500 | 501 | COPY --from=php_builder /opt /opt 502 | RUN LD_LIBRARY_PATH= yum -y install zip 503 | -------------------------------------------------------------------------------- /php82al2/runtime/bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | while true 4 | do 5 | /opt/bin/php /opt/bootstrap.php 6 | done 7 | -------------------------------------------------------------------------------- /php82al2/runtime/bootstrap.php: -------------------------------------------------------------------------------- 1 | #!/opt/bin/php 2 | $value){ 9 | $buildArguments .= "--build-arg $key=$value "; 10 | } 11 | 12 | print $buildArguments; 13 | -------------------------------------------------------------------------------- /php83al2-arm/php.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=linux/arm64 vapor/runtime/compiler:latest as php_builder 2 | 3 | SHELL ["/bin/bash", "-c"] 4 | 5 | ENV BUILD_DIR="/tmp/build" 6 | ENV INSTALL_DIR="/opt/vapor" 7 | 8 | # Configure Default Compiler Variables 9 | 10 | ENV PKG_CONFIG_PATH="${INSTALL_DIR}/lib64/pkgconfig:${INSTALL_DIR}/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig" \ 11 | PKG_CONFIG="/usr/bin/pkg-config" \ 12 | PATH="${INSTALL_DIR}/bin:${PATH}" 13 | 14 | ENV LD_LIBRARY_PATH="${INSTALL_DIR}/lib64:${INSTALL_DIR}/lib" 15 | 16 | # Create All The Necessary Build Directories 17 | 18 | RUN mkdir -p ${BUILD_DIR} \ 19 | ${INSTALL_DIR}/bin \ 20 | ${INSTALL_DIR}/doc \ 21 | ${INSTALL_DIR}/etc/php \ 22 | ${INSTALL_DIR}/etc/php/conf.d \ 23 | ${INSTALL_DIR}/include \ 24 | ${INSTALL_DIR}/lib \ 25 | ${INSTALL_DIR}/lib64 \ 26 | ${INSTALL_DIR}/libexec \ 27 | ${INSTALL_DIR}/sbin \ 28 | ${INSTALL_DIR}/share 29 | 30 | 31 | # Build ZLIB (https://github.com/madler/zlib/releases) 32 | 33 | ARG zlib 34 | ENV VERSION_ZLIB=${zlib} 35 | ENV ZLIB_BUILD_DIR=${BUILD_DIR}/zlib 36 | 37 | RUN set -xe; \ 38 | mkdir -p ${ZLIB_BUILD_DIR}; \ 39 | curl -Ls https://github.com/madler/zlib/releases/download/v${VERSION_ZLIB}/zlib-${VERSION_ZLIB}.tar.xz \ 40 | | tar xJC ${ZLIB_BUILD_DIR} --strip-components=1 41 | 42 | WORKDIR ${ZLIB_BUILD_DIR}/ 43 | 44 | RUN set -xe; \ 45 | make distclean \ 46 | && CFLAGS="" \ 47 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 48 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 49 | ./configure \ 50 | --prefix=${INSTALL_DIR} 51 | 52 | RUN set -xe; \ 53 | make install \ 54 | && rm ${INSTALL_DIR}/lib/libz.a 55 | 56 | # Build OpenSSL (https://github.com/openssl/openssl/releases) 57 | 58 | ARG openssl 59 | ENV VERSION_OPENSSL=${openssl} 60 | ENV OPENSSL_BUILD_DIR=${BUILD_DIR}/openssl 61 | ENV CA_BUNDLE_SOURCE="https://curl.se/ca/cacert.pem" 62 | ENV CA_BUNDLE="${INSTALL_DIR}/ssl/cert.pem" 63 | 64 | RUN set -xe; \ 65 | mkdir -p ${OPENSSL_BUILD_DIR}; \ 66 | curl -Ls https://github.com/openssl/openssl/archive/openssl-${VERSION_OPENSSL}.tar.gz \ 67 | | tar xzC ${OPENSSL_BUILD_DIR} --strip-components=1 68 | 69 | WORKDIR ${OPENSSL_BUILD_DIR}/ 70 | 71 | RUN set -xe; \ 72 | CFLAGS="" \ 73 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 74 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 75 | ./config \ 76 | --prefix=${INSTALL_DIR} \ 77 | --openssldir=${INSTALL_DIR}/ssl \ 78 | --release \ 79 | enable-tls1_3 \ 80 | no-tests \ 81 | shared \ 82 | zlib 83 | 84 | RUN set -xe; \ 85 | make install \ 86 | && curl -L -k -o ${CA_BUNDLE} ${CA_BUNDLE_SOURCE} 87 | 88 | # Build LibXML2 (https://gitlab.gnome.org/GNOME/libxml2/-/releases) 89 | 90 | ARG libxml2 91 | ENV VERSION_XML2=${libxml2} 92 | ENV XML2_BUILD_DIR=${BUILD_DIR}/xml2 93 | 94 | RUN set -xe; \ 95 | mkdir -p ${XML2_BUILD_DIR}; \ 96 | curl -Ls https://download.gnome.org/sources/libxml2/${VERSION_XML2%.*}/libxml2-${VERSION_XML2}.tar.xz \ 97 | | tar xJC ${XML2_BUILD_DIR} --strip-components=1 98 | 99 | WORKDIR ${XML2_BUILD_DIR}/ 100 | 101 | RUN set -xe; \ 102 | CFLAGS="" \ 103 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 104 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 105 | ./configure \ 106 | --prefix=${INSTALL_DIR} \ 107 | --with-sysroot=${INSTALL_DIR} \ 108 | --enable-shared \ 109 | --disable-static \ 110 | --with-html \ 111 | --with-history \ 112 | --enable-ipv6=no \ 113 | --with-icu \ 114 | --with-zlib=${INSTALL_DIR} \ 115 | --without-python 116 | 117 | RUN set -xe; \ 118 | make install \ 119 | && cp xml2-config ${INSTALL_DIR}/bin/xml2-config 120 | 121 | # Build LibSSH2 (https://github.com/libssh2/libssh2/releases/) 122 | 123 | ARG libssh2 124 | ENV VERSION_LIBSSH2=${libssh2} 125 | ENV LIBSSH2_BUILD_DIR=${BUILD_DIR}/libssh2 126 | 127 | RUN set -xe; \ 128 | mkdir -p ${LIBSSH2_BUILD_DIR}/bin; \ 129 | curl -Ls https://github.com/libssh2/libssh2/releases/download/libssh2-${VERSION_LIBSSH2}/libssh2-${VERSION_LIBSSH2}.tar.gz \ 130 | | tar xzC ${LIBSSH2_BUILD_DIR} --strip-components=1 131 | 132 | WORKDIR ${LIBSSH2_BUILD_DIR}/bin/ 133 | 134 | RUN set -xe; \ 135 | CFLAGS="" \ 136 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 137 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 138 | cmake .. \ 139 | -DBUILD_SHARED_LIBS=ON \ 140 | -DCRYPTO_BACKEND=OpenSSL \ 141 | -DENABLE_ZLIB_COMPRESSION=ON \ 142 | -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ 143 | -DCMAKE_BUILD_TYPE=RELEASE 144 | 145 | RUN set -xe; \ 146 | cmake --build . --target install 147 | 148 | # Build nghttp2 (https://github.com/nghttp2/nghttp2/releases/) 149 | 150 | ARG nghttp2 151 | ENV VERSION_NGHTTP2=${nghttp2} 152 | ENV NGHTTP2_BUILD_DIR=${BUILD_DIR}/nghttp2 153 | 154 | RUN set -xe; \ 155 | mkdir -p ${NGHTTP2_BUILD_DIR}/bin; \ 156 | curl -Ls https://github.com/nghttp2/nghttp2/releases/download/v${VERSION_NGHTTP2}/nghttp2-${VERSION_NGHTTP2}.tar.gz \ 157 | | tar xzC ${NGHTTP2_BUILD_DIR} --strip-components=1 158 | 159 | WORKDIR ${NGHTTP2_BUILD_DIR}/ 160 | 161 | RUN set -xe; \ 162 | CFLAGS="" \ 163 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 164 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 165 | ./configure --enable-lib-only --prefix=${INSTALL_DIR} && \ 166 | make -j $(nproc) && \ 167 | make install 168 | 169 | # Build Curl (https://github.com/curl/curl/releases/) 170 | 171 | ARG curl 172 | ENV VERSION_CURL=${curl} 173 | ENV CURL_BUILD_DIR=${BUILD_DIR}/curl 174 | 175 | RUN set -xe; \ 176 | mkdir -p ${CURL_BUILD_DIR}/bin; \ 177 | curl -Ls https://github.com/curl/curl/archive/curl-${VERSION_CURL//./_}.tar.gz \ 178 | | tar xzC ${CURL_BUILD_DIR} --strip-components=1 179 | 180 | WORKDIR ${CURL_BUILD_DIR}/ 181 | 182 | RUN set -xe; \ 183 | ./buildconf \ 184 | && CFLAGS="" \ 185 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 186 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 187 | ./configure \ 188 | --prefix=${INSTALL_DIR} \ 189 | --with-ca-bundle=${CA_BUNDLE} \ 190 | --enable-shared \ 191 | --disable-static \ 192 | --enable-optimize \ 193 | --disable-warnings \ 194 | --disable-dependency-tracking \ 195 | --with-zlib \ 196 | --enable-http \ 197 | --enable-ftp \ 198 | --enable-file \ 199 | --enable-ldaps \ 200 | --enable-proxy \ 201 | --enable-tftp \ 202 | --enable-ipv6 \ 203 | --enable-openssl-auto-load-config \ 204 | --enable-cookies \ 205 | --with-gnu-ld \ 206 | --with-ssl \ 207 | --with-libssh2 \ 208 | --with-nghttp2 \ 209 | --without-libpsl 210 | 211 | RUN set -xe; \ 212 | make install 213 | 214 | # Build Libzip (https://github.com/nih-at/libzip/releases) 215 | 216 | ARG libzip 217 | ENV VERSION_ZIP=${libzip} 218 | ENV ZIP_BUILD_DIR=${BUILD_DIR}/zip 219 | 220 | RUN set -xe; \ 221 | mkdir -p ${ZIP_BUILD_DIR}/bin/; \ 222 | # Download and upack the source code 223 | curl -Ls https://github.com/nih-at/libzip/releases/download/v${VERSION_ZIP}/libzip-${VERSION_ZIP}.tar.gz \ 224 | | tar xzC ${ZIP_BUILD_DIR} --strip-components=1 225 | 226 | # Move into the unpackaged code directory 227 | WORKDIR ${ZIP_BUILD_DIR}/bin/ 228 | 229 | # Configure the build 230 | RUN set -xe; \ 231 | CFLAGS="" \ 232 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 233 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 234 | cmake .. \ 235 | -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ 236 | -DCMAKE_BUILD_TYPE=RELEASE 237 | 238 | RUN set -xe; \ 239 | cmake --build . --target install 240 | 241 | # Build Libsodium (https://github.com/jedisct1/libsodium/releases) 242 | 243 | ARG libsodium 244 | ENV VERSION_LIBSODIUM=${libsodium} 245 | ENV LIBSODIUM_BUILD_DIR=${BUILD_DIR}/libsodium 246 | 247 | RUN set -xe; \ 248 | mkdir -p ${LIBSODIUM_BUILD_DIR}; \ 249 | curl -Ls https://github.com/jedisct1/libsodium/archive/${VERSION_LIBSODIUM}-RELEASE.tar.gz \ 250 | | tar xzC ${LIBSODIUM_BUILD_DIR} --strip-components=1 251 | 252 | WORKDIR ${LIBSODIUM_BUILD_DIR}/ 253 | 254 | RUN set -xe; \ 255 | CFLAGS="" \ 256 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 257 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 258 | ./autogen.sh \ 259 | && ./configure --prefix=${INSTALL_DIR} 260 | 261 | RUN set -xe; \ 262 | make install 263 | 264 | # Build Postgres (https://github.com/postgres/postgres/releases/) 265 | 266 | ARG postgres 267 | ENV VERSION_POSTGRES=${postgres} 268 | ENV POSTGRES_BUILD_DIR=${BUILD_DIR}/postgres 269 | 270 | RUN set -xe; \ 271 | mkdir -p ${POSTGRES_BUILD_DIR}/bin; \ 272 | curl -Ls https://github.com/postgres/postgres/archive/REL_${VERSION_POSTGRES//./_}.tar.gz \ 273 | | tar xzC ${POSTGRES_BUILD_DIR} --strip-components=1 274 | 275 | WORKDIR ${POSTGRES_BUILD_DIR}/ 276 | 277 | RUN set -xe; \ 278 | CFLAGS="" \ 279 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 280 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 281 | ./configure --prefix=${INSTALL_DIR} --with-openssl --without-readline 282 | 283 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/interfaces/libpq && make && make install 284 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/bin/pg_config && make && make install 285 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/backend && make generated-headers 286 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/include && make install 287 | 288 | # Build libjpeg 289 | 290 | ARG libjpeg 291 | ENV VERSION_LIBJPEG=${libjpeg} 292 | ENV LIBJPEG_BUILD_DIR=${BUILD_DIR}/libjpeg 293 | 294 | RUN set -xe; \ 295 | mkdir -p ${LIBJPEG_BUILD_DIR}/bin; \ 296 | curl -Ls http://www.ijg.org/files/jpegsrc.${VERSION_LIBJPEG}.tar.gz \ 297 | | tar xzC ${LIBJPEG_BUILD_DIR} --strip-components=1 298 | 299 | WORKDIR ${LIBJPEG_BUILD_DIR}/ 300 | 301 | RUN set -xe; \ 302 | CFLAGS="" \ 303 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 304 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 305 | ./configure \ 306 | --prefix=${INSTALL_DIR} \ 307 | --enable-shared \ 308 | --disable-static 309 | 310 | RUN set -xe; \ 311 | make install 312 | 313 | # Build libpng 314 | 315 | ARG libpng 316 | ENV VERSION_LIBPNG=${libpng} 317 | ENV LIBPNG_BUILD_DIR=${BUILD_DIR}/libpng 318 | 319 | RUN set -xe; \ 320 | mkdir -p ${LIBPNG_BUILD_DIR}/bin; \ 321 | curl -Ls https://download.sourceforge.net/libpng/libpng-${VERSION_LIBPNG}.tar.gz \ 322 | | tar xzC ${LIBPNG_BUILD_DIR} --strip-components=1 323 | 324 | WORKDIR ${LIBPNG_BUILD_DIR}/ 325 | 326 | RUN set -xe; \ 327 | CFLAGS="" \ 328 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 329 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 330 | ./configure \ 331 | --prefix=${INSTALL_DIR} \ 332 | --enable-shared \ 333 | --disable-static 334 | 335 | RUN set -xe; \ 336 | make install 337 | 338 | # Build Oniguruma 339 | 340 | ARG oniguruma 341 | ENV VERSION_ONIGURUMA=${oniguruma} 342 | ENV LIBONIG_BUILD_DIR=${BUILD_DIR}/libonig 343 | 344 | RUN set -xe \ 345 | && mkdir -p ${LIBONIG_BUILD_DIR}/bin \ 346 | && curl -Ls https://github.com/kkos/oniguruma/releases/download/v${VERSION_ONIGURUMA}/onig-${VERSION_ONIGURUMA}.tar.gz \ 347 | | tar xzC ${LIBONIG_BUILD_DIR} --strip-components=1 348 | 349 | WORKDIR ${LIBONIG_BUILD_DIR}/ 350 | 351 | RUN set -xe; \ 352 | CFLAGS="" \ 353 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 354 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 355 | && ./configure \ 356 | --prefix=${INSTALL_DIR} \ 357 | --enable-shared \ 358 | --disable-static 359 | 360 | RUN set -xe; \ 361 | make install 362 | 363 | # Build SQLite 364 | 365 | ARG sqlite 366 | ENV VERSION_SQLITE=${sqlite} 367 | ENV SQLITE_BUILD_DIR=${BUILD_DIR}/libsqlite3 368 | 369 | RUN LD_LIBRARY_PATH= yum install -y tcl 370 | 371 | RUN set -xe; \ 372 | mkdir -p ${SQLITE_BUILD_DIR}; \ 373 | curl -Ls https://github.com/sqlite/sqlite/archive/refs/tags/version-${VERSION_SQLITE}.tar.gz \ 374 | | tar xzC ${SQLITE_BUILD_DIR} --strip-components=1 375 | 376 | WORKDIR ${SQLITE_BUILD_DIR}/ 377 | 378 | RUN ./configure --prefix=${INSTALL_DIR} 379 | 380 | RUN make && make install 381 | 382 | # Build PHP 383 | 384 | ARG php 385 | ENV VERSION_PHP=${php} 386 | ENV PHP_BUILD_DIR=${BUILD_DIR}/php 387 | 388 | RUN set -xe; \ 389 | mkdir -p ${PHP_BUILD_DIR}; \ 390 | curl -Ls https://php.net/distributions/php-${VERSION_PHP}.tar.gz \ 391 | | tar xzC ${PHP_BUILD_DIR} --strip-components=1 392 | 393 | # Configure The PHP Build 394 | 395 | WORKDIR ${PHP_BUILD_DIR}/ 396 | 397 | RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel ImageMagick-devel 398 | 399 | RUN cp -a /usr/lib64/libgpg-error.so* ${INSTALL_DIR}/lib64/ 400 | RUN cp -a /usr/lib64/libtinfo.so* ${INSTALL_DIR}/lib64/ 401 | RUN cp -a /usr/lib64/libgcrypt.so* ${INSTALL_DIR}/lib64/ 402 | RUN cp -a /usr/lib64/libreadline.so?* ${INSTALL_DIR}/lib64/ 403 | RUN cp -a /usr/lib64/libasprintf.so* ${INSTALL_DIR}/lib64/ 404 | RUN cp -a /usr/lib64/libgettextpo.so* ${INSTALL_DIR}/lib64/ 405 | RUN cp -a /usr/lib64/preloadable_libintl.so* ${INSTALL_DIR}/lib64/ 406 | RUN cp -a /usr/lib64/lib*xslt*.so* ${INSTALL_DIR}/lib64/ 407 | 408 | RUN set -xe \ 409 | && ./buildconf --force \ 410 | && CFLAGS="-fstack-protector-strong -fpic -fpie -Os -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \ 411 | CPPFLAGS="-fstack-protector-strong -fpic -fpie -Os -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \ 412 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib -Wl,-O1 -Wl,--strip-all -Wl,--hash-style=both -pie" \ 413 | ./configure \ 414 | --prefix=${INSTALL_DIR} \ 415 | --enable-option-checking=fatal \ 416 | --with-config-file-path=${INSTALL_DIR}/etc/php \ 417 | --with-config-file-scan-dir=${INSTALL_DIR}/etc/php/conf.d:/var/task/php/conf.d \ 418 | --enable-fpm \ 419 | --disable-cgi \ 420 | --enable-cli \ 421 | --with-jpeg=${INSTALL_DIR} \ 422 | --with-xsl=${INSTALL_DIR} \ 423 | --enable-gd \ 424 | --disable-phpdbg \ 425 | # --disable-phpdbg-webhelper \ 426 | --with-sodium \ 427 | --with-readline \ 428 | --with-openssl \ 429 | --with-zlib=${INSTALL_DIR} \ 430 | --with-curl \ 431 | --enable-bcmath \ 432 | --enable-sockets \ 433 | --enable-exif \ 434 | --enable-ftp \ 435 | --with-gettext \ 436 | --with-pear \ 437 | --enable-mbstring \ 438 | --enable-soap \ 439 | --with-pdo-mysql=shared,mysqlnd \ 440 | --enable-pcntl \ 441 | --with-zip \ 442 | --with-pdo-pgsql=shared,${INSTALL_DIR} \ 443 | --enable-intl=shared 444 | 445 | RUN make -j $(nproc) 446 | 447 | # Override PEAR URL Since It Is Down 448 | 449 | RUN set -xe; \ 450 | make install PEAR_INSTALLER_URL='https://github.com/pear/pearweb_phars/raw/master/install-pear-nozlib.phar'; \ 451 | { find ${INSTALL_DIR}/bin ${INSTALL_DIR}/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ 452 | make clean; \ 453 | cp php.ini-production ${INSTALL_DIR}/etc/php/php.ini 454 | 455 | # Build Redis (https://pecl.php.net/package/redis/) 456 | 457 | ARG redis 458 | ENV VERSION_REDIS=${redis} 459 | 460 | RUN pecl install -f redis-${VERSION_REDIS} 461 | 462 | # Strip All Unneeded Symbols 463 | 464 | RUN find ${INSTALL_DIR} -type f -name "*.so*" -o -name "*.a" -exec strip --strip-unneeded {} \; 465 | RUN find ${INSTALL_DIR} -type f -executable -exec sh -c "file -i '{}' | grep -q 'x-executable; charset=binary'" \; -print|xargs strip --strip-all 466 | 467 | # Symlink All Binaries / Libaries 468 | 469 | RUN mkdir -p /opt/bin 470 | RUN mkdir -p /opt/lib 471 | RUN mkdir -p /opt/lib/curl 472 | 473 | RUN cp /opt/vapor/bin/* /opt/bin 474 | RUN cp /opt/vapor/sbin/* /opt/bin 475 | RUN cp /opt/vapor/lib/php/extensions/no-debug-non-zts-20230831/* /opt/bin 476 | 477 | RUN cp /opt/vapor/lib/* /opt/lib || true 478 | RUN cp /opt/vapor/lib/libcurl* /opt/lib/curl || true 479 | 480 | RUN cp "${INSTALL_DIR}/ssl/cert.pem" /opt/lib/curl/cert.pem 481 | RUN cp /opt/vapor/lib64/* /opt/lib || true 482 | 483 | RUN ls /opt/bin 484 | RUN /opt/bin/php -i | grep curl 485 | 486 | # Copy Everything To The Base Container 487 | 488 | FROM --platform=linux/arm64 amazonlinux:2 489 | 490 | ENV INSTALL_DIR="/opt/vapor" 491 | 492 | ENV PATH="/opt/bin:${PATH}" \ 493 | LD_LIBRARY_PATH="${INSTALL_DIR}/lib64:${INSTALL_DIR}/lib" 494 | 495 | RUN mkdir -p /opt 496 | 497 | WORKDIR /opt 498 | 499 | COPY --from=php_builder /opt /opt 500 | RUN LD_LIBRARY_PATH= yum -y install zip 501 | -------------------------------------------------------------------------------- /php83al2-arm/runtime/bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | while true 4 | do 5 | /opt/bin/php /opt/bootstrap.php 6 | done 7 | -------------------------------------------------------------------------------- /php83al2-arm/runtime/bootstrap.php: -------------------------------------------------------------------------------- 1 | #!/opt/bin/php 2 | $value){ 9 | $buildArguments .= "--build-arg $key=$value "; 10 | } 11 | 12 | print $buildArguments; 13 | -------------------------------------------------------------------------------- /php83al2/php.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=linux/amd64 vapor/runtime/compiler:latest as php_builder 2 | 3 | SHELL ["/bin/bash", "-c"] 4 | 5 | ENV BUILD_DIR="/tmp/build" 6 | ENV INSTALL_DIR="/opt/vapor" 7 | 8 | # Configure Default Compiler Variables 9 | 10 | ENV PKG_CONFIG_PATH="${INSTALL_DIR}/lib64/pkgconfig:${INSTALL_DIR}/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig" \ 11 | PKG_CONFIG="/usr/bin/pkg-config" \ 12 | PATH="${INSTALL_DIR}/bin:${PATH}" 13 | 14 | ENV LD_LIBRARY_PATH="${INSTALL_DIR}/lib64:${INSTALL_DIR}/lib" 15 | 16 | # Create All The Necessary Build Directories 17 | 18 | RUN mkdir -p ${BUILD_DIR} \ 19 | ${INSTALL_DIR}/bin \ 20 | ${INSTALL_DIR}/doc \ 21 | ${INSTALL_DIR}/etc/php \ 22 | ${INSTALL_DIR}/etc/php/conf.d \ 23 | ${INSTALL_DIR}/include \ 24 | ${INSTALL_DIR}/lib \ 25 | ${INSTALL_DIR}/lib64 \ 26 | ${INSTALL_DIR}/libexec \ 27 | ${INSTALL_DIR}/sbin \ 28 | ${INSTALL_DIR}/share 29 | 30 | 31 | # Build ZLIB (https://github.com/madler/zlib/releases) 32 | 33 | ARG zlib 34 | ENV VERSION_ZLIB=${zlib} 35 | ENV ZLIB_BUILD_DIR=${BUILD_DIR}/zlib 36 | 37 | RUN set -xe; \ 38 | mkdir -p ${ZLIB_BUILD_DIR}; \ 39 | curl -Ls https://github.com/madler/zlib/releases/download/v${VERSION_ZLIB}/zlib-${VERSION_ZLIB}.tar.xz \ 40 | | tar xJC ${ZLIB_BUILD_DIR} --strip-components=1 41 | 42 | WORKDIR ${ZLIB_BUILD_DIR}/ 43 | 44 | RUN set -xe; \ 45 | make distclean \ 46 | && CFLAGS="" \ 47 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 48 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 49 | ./configure \ 50 | --prefix=${INSTALL_DIR} \ 51 | --64 52 | 53 | RUN set -xe; \ 54 | make install \ 55 | && rm ${INSTALL_DIR}/lib/libz.a 56 | 57 | # Build OpenSSL (https://github.com/openssl/openssl/releases) 58 | 59 | ARG openssl 60 | ENV VERSION_OPENSSL=${openssl} 61 | ENV OPENSSL_BUILD_DIR=${BUILD_DIR}/openssl 62 | ENV CA_BUNDLE_SOURCE="https://curl.se/ca/cacert.pem" 63 | ENV CA_BUNDLE="${INSTALL_DIR}/ssl/cert.pem" 64 | 65 | RUN set -xe; \ 66 | mkdir -p ${OPENSSL_BUILD_DIR}; \ 67 | curl -Ls https://github.com/openssl/openssl/archive/openssl-${VERSION_OPENSSL}.tar.gz \ 68 | | tar xzC ${OPENSSL_BUILD_DIR} --strip-components=1 69 | 70 | WORKDIR ${OPENSSL_BUILD_DIR}/ 71 | 72 | RUN set -xe; \ 73 | CFLAGS="" \ 74 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 75 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 76 | ./config \ 77 | --prefix=${INSTALL_DIR} \ 78 | --openssldir=${INSTALL_DIR}/ssl \ 79 | --release \ 80 | enable-tls1_3 \ 81 | no-tests \ 82 | shared \ 83 | zlib 84 | 85 | RUN set -xe; \ 86 | make install \ 87 | && curl -L -k -o ${CA_BUNDLE} ${CA_BUNDLE_SOURCE} 88 | 89 | # Build LibXML2 (https://gitlab.gnome.org/GNOME/libxml2/-/releases) 90 | 91 | ARG libxml2 92 | ENV VERSION_XML2=${libxml2} 93 | ENV XML2_BUILD_DIR=${BUILD_DIR}/xml2 94 | 95 | RUN set -xe; \ 96 | mkdir -p ${XML2_BUILD_DIR}; \ 97 | curl -Ls https://download.gnome.org/sources/libxml2/${VERSION_XML2%.*}/libxml2-${VERSION_XML2}.tar.xz \ 98 | | tar xJC ${XML2_BUILD_DIR} --strip-components=1 99 | 100 | WORKDIR ${XML2_BUILD_DIR}/ 101 | 102 | RUN set -xe; \ 103 | CFLAGS="" \ 104 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 105 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 106 | ./configure \ 107 | --prefix=${INSTALL_DIR} \ 108 | --with-sysroot=${INSTALL_DIR} \ 109 | --enable-shared \ 110 | --disable-static \ 111 | --with-html \ 112 | --with-history \ 113 | --enable-ipv6=no \ 114 | --with-icu \ 115 | --with-zlib=${INSTALL_DIR} \ 116 | --without-python 117 | 118 | RUN set -xe; \ 119 | make install \ 120 | && cp xml2-config ${INSTALL_DIR}/bin/xml2-config 121 | 122 | # Build LibSSH2 (https://github.com/libssh2/libssh2/releases/) 123 | 124 | ARG libssh2 125 | ENV VERSION_LIBSSH2=${libssh2} 126 | ENV LIBSSH2_BUILD_DIR=${BUILD_DIR}/libssh2 127 | 128 | RUN set -xe; \ 129 | mkdir -p ${LIBSSH2_BUILD_DIR}/bin; \ 130 | curl -Ls https://github.com/libssh2/libssh2/releases/download/libssh2-${VERSION_LIBSSH2}/libssh2-${VERSION_LIBSSH2}.tar.gz \ 131 | | tar xzC ${LIBSSH2_BUILD_DIR} --strip-components=1 132 | 133 | WORKDIR ${LIBSSH2_BUILD_DIR}/bin/ 134 | 135 | RUN set -xe; \ 136 | CFLAGS="" \ 137 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 138 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 139 | cmake .. \ 140 | -DBUILD_SHARED_LIBS=ON \ 141 | -DCRYPTO_BACKEND=OpenSSL \ 142 | -DENABLE_ZLIB_COMPRESSION=ON \ 143 | -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ 144 | -DCMAKE_BUILD_TYPE=RELEASE 145 | 146 | RUN set -xe; \ 147 | cmake --build . --target install 148 | 149 | # Build nghttp2 (https://github.com/nghttp2/nghttp2/releases/) 150 | 151 | ARG nghttp2 152 | ENV VERSION_NGHTTP2=${nghttp2} 153 | ENV NGHTTP2_BUILD_DIR=${BUILD_DIR}/nghttp2 154 | 155 | RUN set -xe; \ 156 | mkdir -p ${NGHTTP2_BUILD_DIR}/bin; \ 157 | curl -Ls https://github.com/nghttp2/nghttp2/releases/download/v${VERSION_NGHTTP2}/nghttp2-${VERSION_NGHTTP2}.tar.gz \ 158 | | tar xzC ${NGHTTP2_BUILD_DIR} --strip-components=1 159 | 160 | WORKDIR ${NGHTTP2_BUILD_DIR}/ 161 | 162 | RUN set -xe; \ 163 | CFLAGS="" \ 164 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 165 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 166 | ./configure --enable-lib-only --prefix=${INSTALL_DIR} && \ 167 | make -j $(nproc) && \ 168 | make install 169 | 170 | # Build Curl (https://github.com/curl/curl/releases/) 171 | 172 | ARG curl 173 | ENV VERSION_CURL=${curl} 174 | ENV CURL_BUILD_DIR=${BUILD_DIR}/curl 175 | 176 | RUN set -xe; \ 177 | mkdir -p ${CURL_BUILD_DIR}/bin; \ 178 | curl -Ls https://github.com/curl/curl/archive/curl-${VERSION_CURL//./_}.tar.gz \ 179 | | tar xzC ${CURL_BUILD_DIR} --strip-components=1 180 | 181 | WORKDIR ${CURL_BUILD_DIR}/ 182 | 183 | RUN set -xe; \ 184 | ./buildconf \ 185 | && CFLAGS="" \ 186 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 187 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 188 | ./configure \ 189 | --prefix=${INSTALL_DIR} \ 190 | --with-ca-bundle=${CA_BUNDLE} \ 191 | --enable-shared \ 192 | --disable-static \ 193 | --enable-optimize \ 194 | --disable-warnings \ 195 | --disable-dependency-tracking \ 196 | --with-zlib \ 197 | --enable-http \ 198 | --enable-ftp \ 199 | --enable-file \ 200 | --enable-ldaps \ 201 | --enable-proxy \ 202 | --enable-tftp \ 203 | --enable-ipv6 \ 204 | --enable-openssl-auto-load-config \ 205 | --enable-cookies \ 206 | --with-gnu-ld \ 207 | --with-ssl \ 208 | --with-libssh2 \ 209 | --with-nghttp2 \ 210 | --without-libpsl 211 | 212 | RUN set -xe; \ 213 | make install 214 | 215 | # Build Libzip (https://github.com/nih-at/libzip/releases) 216 | 217 | ARG libzip 218 | ENV VERSION_ZIP=${libzip} 219 | ENV ZIP_BUILD_DIR=${BUILD_DIR}/zip 220 | 221 | RUN set -xe; \ 222 | mkdir -p ${ZIP_BUILD_DIR}/bin/; \ 223 | # Download and upack the source code 224 | curl -Ls https://github.com/nih-at/libzip/releases/download/v${VERSION_ZIP}/libzip-${VERSION_ZIP}.tar.gz \ 225 | | tar xzC ${ZIP_BUILD_DIR} --strip-components=1 226 | 227 | # Move into the unpackaged code directory 228 | WORKDIR ${ZIP_BUILD_DIR}/bin/ 229 | 230 | # Configure the build 231 | RUN set -xe; \ 232 | CFLAGS="" \ 233 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 234 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 235 | cmake .. \ 236 | -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ 237 | -DCMAKE_BUILD_TYPE=RELEASE 238 | 239 | RUN set -xe; \ 240 | cmake --build . --target install 241 | 242 | # Build Libsodium (https://github.com/jedisct1/libsodium/releases) 243 | 244 | ARG libsodium 245 | ENV VERSION_LIBSODIUM=${libsodium} 246 | ENV LIBSODIUM_BUILD_DIR=${BUILD_DIR}/libsodium 247 | 248 | RUN set -xe; \ 249 | mkdir -p ${LIBSODIUM_BUILD_DIR}; \ 250 | curl -Ls https://github.com/jedisct1/libsodium/archive/${VERSION_LIBSODIUM}-RELEASE.tar.gz \ 251 | | tar xzC ${LIBSODIUM_BUILD_DIR} --strip-components=1 252 | 253 | WORKDIR ${LIBSODIUM_BUILD_DIR}/ 254 | 255 | RUN set -xe; \ 256 | CFLAGS="" \ 257 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 258 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 259 | ./autogen.sh \ 260 | && ./configure --prefix=${INSTALL_DIR} 261 | 262 | RUN set -xe; \ 263 | make install 264 | 265 | # Build Postgres (https://github.com/postgres/postgres/releases/) 266 | 267 | ARG postgres 268 | ENV VERSION_POSTGRES=${postgres} 269 | ENV POSTGRES_BUILD_DIR=${BUILD_DIR}/postgres 270 | 271 | RUN set -xe; \ 272 | mkdir -p ${POSTGRES_BUILD_DIR}/bin; \ 273 | curl -Ls https://github.com/postgres/postgres/archive/REL_${VERSION_POSTGRES//./_}.tar.gz \ 274 | | tar xzC ${POSTGRES_BUILD_DIR} --strip-components=1 275 | 276 | WORKDIR ${POSTGRES_BUILD_DIR}/ 277 | 278 | RUN set -xe; \ 279 | CFLAGS="" \ 280 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 281 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 282 | ./configure --prefix=${INSTALL_DIR} --with-openssl --without-readline 283 | 284 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/interfaces/libpq && make && make install 285 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/bin/pg_config && make && make install 286 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/backend && make generated-headers 287 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/include && make install 288 | 289 | # Build libjpeg 290 | 291 | ARG libjpeg 292 | ENV VERSION_LIBJPEG=${libjpeg} 293 | ENV LIBJPEG_BUILD_DIR=${BUILD_DIR}/libjpeg 294 | 295 | RUN set -xe; \ 296 | mkdir -p ${LIBJPEG_BUILD_DIR}/bin; \ 297 | curl -Ls http://www.ijg.org/files/jpegsrc.${VERSION_LIBJPEG}.tar.gz \ 298 | | tar xzC ${LIBJPEG_BUILD_DIR} --strip-components=1 299 | 300 | WORKDIR ${LIBJPEG_BUILD_DIR}/ 301 | 302 | RUN set -xe; \ 303 | CFLAGS="" \ 304 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 305 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 306 | ./configure \ 307 | --prefix=${INSTALL_DIR} \ 308 | --enable-shared \ 309 | --disable-static 310 | 311 | RUN set -xe; \ 312 | make install 313 | 314 | # Build libpng 315 | 316 | ARG libpng 317 | ENV VERSION_LIBPNG=${libpng} 318 | ENV LIBPNG_BUILD_DIR=${BUILD_DIR}/libpng 319 | 320 | RUN set -xe; \ 321 | mkdir -p ${LIBPNG_BUILD_DIR}/bin; \ 322 | curl -Ls https://download.sourceforge.net/libpng/libpng-${VERSION_LIBPNG}.tar.gz \ 323 | | tar xzC ${LIBPNG_BUILD_DIR} --strip-components=1 324 | 325 | WORKDIR ${LIBPNG_BUILD_DIR}/ 326 | 327 | RUN set -xe; \ 328 | CFLAGS="" \ 329 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 330 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 331 | ./configure \ 332 | --prefix=${INSTALL_DIR} \ 333 | --enable-shared \ 334 | --disable-static 335 | 336 | RUN set -xe; \ 337 | make install 338 | 339 | # Build Oniguruma 340 | 341 | ARG oniguruma 342 | ENV VERSION_ONIGURUMA=${oniguruma} 343 | ENV LIBONIG_BUILD_DIR=${BUILD_DIR}/libonig 344 | 345 | RUN set -xe \ 346 | && mkdir -p ${LIBONIG_BUILD_DIR}/bin \ 347 | && curl -Ls https://github.com/kkos/oniguruma/releases/download/v${VERSION_ONIGURUMA}/onig-${VERSION_ONIGURUMA}.tar.gz \ 348 | | tar xzC ${LIBONIG_BUILD_DIR} --strip-components=1 349 | 350 | WORKDIR ${LIBONIG_BUILD_DIR}/ 351 | 352 | RUN set -xe; \ 353 | CFLAGS="" \ 354 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 355 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 356 | && ./configure \ 357 | --prefix=${INSTALL_DIR} \ 358 | --enable-shared \ 359 | --disable-static 360 | 361 | RUN set -xe; \ 362 | make install 363 | 364 | # Build SQLite 365 | 366 | ARG sqlite 367 | ENV VERSION_SQLITE=${sqlite} 368 | ENV SQLITE_BUILD_DIR=${BUILD_DIR}/libsqlite3 369 | 370 | RUN LD_LIBRARY_PATH= yum install -y tcl 371 | 372 | RUN set -xe; \ 373 | mkdir -p ${SQLITE_BUILD_DIR}; \ 374 | curl -Ls https://github.com/sqlite/sqlite/archive/refs/tags/version-${VERSION_SQLITE}.tar.gz \ 375 | | tar xzC ${SQLITE_BUILD_DIR} --strip-components=1 376 | 377 | WORKDIR ${SQLITE_BUILD_DIR}/ 378 | 379 | RUN ./configure --prefix=${INSTALL_DIR} 380 | 381 | RUN make && make install 382 | 383 | # Build PHP 384 | 385 | ARG php 386 | ENV VERSION_PHP=${php} 387 | ENV PHP_BUILD_DIR=${BUILD_DIR}/php 388 | 389 | RUN set -xe; \ 390 | mkdir -p ${PHP_BUILD_DIR}; \ 391 | curl -Ls https://php.net/distributions/php-${VERSION_PHP}.tar.gz \ 392 | | tar xzC ${PHP_BUILD_DIR} --strip-components=1 393 | 394 | # Configure The PHP Build 395 | 396 | WORKDIR ${PHP_BUILD_DIR}/ 397 | 398 | RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel ImageMagick-devel 399 | 400 | RUN cp -a /usr/lib64/libgpg-error.so* ${INSTALL_DIR}/lib64/ 401 | RUN cp -a /usr/lib64/libtinfo.so* ${INSTALL_DIR}/lib64/ 402 | RUN cp -a /usr/lib64/libgcrypt.so* ${INSTALL_DIR}/lib64/ 403 | RUN cp -a /usr/lib64/libreadline.so?* ${INSTALL_DIR}/lib64/ 404 | RUN cp -a /usr/lib64/libasprintf.so* ${INSTALL_DIR}/lib64/ 405 | RUN cp -a /usr/lib64/libgettextpo.so* ${INSTALL_DIR}/lib64/ 406 | RUN cp -a /usr/lib64/preloadable_libintl.so* ${INSTALL_DIR}/lib64/ 407 | RUN cp -a /usr/lib64/lib*xslt*.so* ${INSTALL_DIR}/lib64/ 408 | 409 | RUN set -xe \ 410 | && ./buildconf --force \ 411 | && CFLAGS="-fstack-protector-strong -fpic -fpie -Os -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \ 412 | CPPFLAGS="-fstack-protector-strong -fpic -fpie -Os -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \ 413 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib -Wl,-O1 -Wl,--strip-all -Wl,--hash-style=both -pie" \ 414 | ./configure \ 415 | --build=x86_64-pc-linux-gnu \ 416 | --prefix=${INSTALL_DIR} \ 417 | --enable-option-checking=fatal \ 418 | --with-config-file-path=${INSTALL_DIR}/etc/php \ 419 | --with-config-file-scan-dir=${INSTALL_DIR}/etc/php/conf.d:/var/task/php/conf.d \ 420 | --enable-fpm \ 421 | --disable-cgi \ 422 | --enable-cli \ 423 | --with-jpeg=${INSTALL_DIR} \ 424 | --with-xsl=${INSTALL_DIR} \ 425 | --enable-gd \ 426 | --disable-phpdbg \ 427 | # --disable-phpdbg-webhelper \ 428 | --with-sodium \ 429 | --with-readline \ 430 | --with-openssl \ 431 | --with-zlib=${INSTALL_DIR} \ 432 | --with-curl \ 433 | --enable-bcmath \ 434 | --enable-sockets \ 435 | --enable-exif \ 436 | --enable-ftp \ 437 | --with-gettext \ 438 | --with-pear \ 439 | --enable-mbstring \ 440 | --enable-soap \ 441 | --with-pdo-mysql=shared,mysqlnd \ 442 | --enable-pcntl \ 443 | --with-zip \ 444 | --with-pdo-pgsql=shared,${INSTALL_DIR} \ 445 | --enable-intl=shared 446 | 447 | RUN make -j $(nproc) 448 | 449 | # Override PEAR URL Since It Is Down 450 | 451 | RUN set -xe; \ 452 | make install PEAR_INSTALLER_URL='https://github.com/pear/pearweb_phars/raw/master/install-pear-nozlib.phar'; \ 453 | { find ${INSTALL_DIR}/bin ${INSTALL_DIR}/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ 454 | make clean; \ 455 | cp php.ini-production ${INSTALL_DIR}/etc/php/php.ini 456 | 457 | # Build Redis (https://pecl.php.net/package/redis/) 458 | 459 | ARG redis 460 | ENV VERSION_REDIS=${redis} 461 | 462 | RUN pecl install -f redis-${VERSION_REDIS} 463 | 464 | # Strip All Unneeded Symbols 465 | 466 | RUN find ${INSTALL_DIR} -type f -name "*.so*" -o -name "*.a" -exec strip --strip-unneeded {} \; 467 | RUN find ${INSTALL_DIR} -type f -executable -exec sh -c "file -i '{}' | grep -q 'x-executable; charset=binary'" \; -print|xargs strip --strip-all 468 | 469 | # Symlink All Binaries / Libaries 470 | 471 | RUN mkdir -p /opt/bin 472 | RUN mkdir -p /opt/lib 473 | RUN mkdir -p /opt/lib/curl 474 | 475 | RUN cp /opt/vapor/bin/* /opt/bin 476 | RUN cp /opt/vapor/sbin/* /opt/bin 477 | RUN cp /opt/vapor/lib/php/extensions/no-debug-non-zts-20230831/* /opt/bin 478 | 479 | RUN cp /opt/vapor/lib/* /opt/lib || true 480 | RUN cp /opt/vapor/lib/libcurl* /opt/lib/curl || true 481 | 482 | RUN cp "${INSTALL_DIR}/ssl/cert.pem" /opt/lib/curl/cert.pem 483 | RUN cp /opt/vapor/lib64/* /opt/lib || true 484 | 485 | RUN ls /opt/bin 486 | RUN /opt/bin/php -i | grep curl 487 | 488 | # Copy Everything To The Base Container 489 | 490 | FROM amazonlinux:2 491 | 492 | ENV INSTALL_DIR="/opt/vapor" 493 | 494 | ENV PATH="/opt/bin:${PATH}" \ 495 | LD_LIBRARY_PATH="${INSTALL_DIR}/lib64:${INSTALL_DIR}/lib" 496 | 497 | RUN mkdir -p /opt 498 | 499 | WORKDIR /opt 500 | 501 | COPY --from=php_builder /opt /opt 502 | RUN LD_LIBRARY_PATH= yum -y install zip 503 | -------------------------------------------------------------------------------- /php83al2/runtime/bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | while true 4 | do 5 | /opt/bin/php /opt/bootstrap.php 6 | done 7 | -------------------------------------------------------------------------------- /php83al2/runtime/bootstrap.php: -------------------------------------------------------------------------------- 1 | #!/opt/bin/php 2 | $value){ 9 | $buildArguments .= "--build-arg $key=$value "; 10 | } 11 | 12 | print $buildArguments; 13 | -------------------------------------------------------------------------------- /php84al2-arm/php.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=linux/arm64 vapor/runtime/compiler:latest as php_builder 2 | 3 | SHELL ["/bin/bash", "-c"] 4 | 5 | ENV BUILD_DIR="/tmp/build" 6 | ENV INSTALL_DIR="/opt/vapor" 7 | 8 | # Configure Default Compiler Variables 9 | 10 | ENV PKG_CONFIG_PATH="${INSTALL_DIR}/lib64/pkgconfig:${INSTALL_DIR}/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig" \ 11 | PKG_CONFIG="/usr/bin/pkg-config" \ 12 | PATH="${INSTALL_DIR}/bin:${PATH}" 13 | 14 | ENV LD_LIBRARY_PATH="${INSTALL_DIR}/lib64:${INSTALL_DIR}/lib" 15 | 16 | # Create All The Necessary Build Directories 17 | 18 | RUN mkdir -p ${BUILD_DIR} \ 19 | ${INSTALL_DIR}/bin \ 20 | ${INSTALL_DIR}/doc \ 21 | ${INSTALL_DIR}/etc/php \ 22 | ${INSTALL_DIR}/etc/php/conf.d \ 23 | ${INSTALL_DIR}/include \ 24 | ${INSTALL_DIR}/lib \ 25 | ${INSTALL_DIR}/lib64 \ 26 | ${INSTALL_DIR}/libexec \ 27 | ${INSTALL_DIR}/sbin \ 28 | ${INSTALL_DIR}/share 29 | 30 | 31 | # Build ZLIB (https://github.com/madler/zlib/releases) 32 | 33 | ARG zlib 34 | ENV VERSION_ZLIB=${zlib} 35 | ENV ZLIB_BUILD_DIR=${BUILD_DIR}/zlib 36 | 37 | RUN set -xe; \ 38 | mkdir -p ${ZLIB_BUILD_DIR}; \ 39 | curl -Ls https://github.com/madler/zlib/releases/download/v${VERSION_ZLIB}/zlib-${VERSION_ZLIB}.tar.xz \ 40 | | tar xJC ${ZLIB_BUILD_DIR} --strip-components=1 41 | 42 | WORKDIR ${ZLIB_BUILD_DIR}/ 43 | 44 | RUN set -xe; \ 45 | make distclean \ 46 | && CFLAGS="" \ 47 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 48 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 49 | ./configure \ 50 | --prefix=${INSTALL_DIR} 51 | 52 | RUN set -xe; \ 53 | make install \ 54 | && rm ${INSTALL_DIR}/lib/libz.a 55 | 56 | # Build OpenSSL (https://github.com/openssl/openssl/releases) 57 | 58 | ARG openssl 59 | ENV VERSION_OPENSSL=${openssl} 60 | ENV OPENSSL_BUILD_DIR=${BUILD_DIR}/openssl 61 | ENV CA_BUNDLE_SOURCE="https://curl.se/ca/cacert.pem" 62 | ENV CA_BUNDLE="${INSTALL_DIR}/ssl/cert.pem" 63 | 64 | RUN set -xe; \ 65 | mkdir -p ${OPENSSL_BUILD_DIR}; \ 66 | curl -Ls https://github.com/openssl/openssl/archive/openssl-${VERSION_OPENSSL}.tar.gz \ 67 | | tar xzC ${OPENSSL_BUILD_DIR} --strip-components=1 68 | 69 | WORKDIR ${OPENSSL_BUILD_DIR}/ 70 | 71 | RUN set -xe; \ 72 | CFLAGS="" \ 73 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 74 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 75 | ./config \ 76 | --prefix=${INSTALL_DIR} \ 77 | --openssldir=${INSTALL_DIR}/ssl \ 78 | --release \ 79 | enable-tls1_3 \ 80 | no-tests \ 81 | shared \ 82 | zlib 83 | 84 | RUN set -xe; \ 85 | make install \ 86 | && curl -L -k -o ${CA_BUNDLE} ${CA_BUNDLE_SOURCE} 87 | 88 | # Build LibXML2 (https://gitlab.gnome.org/GNOME/libxml2/-/releases) 89 | 90 | ARG libxml2 91 | ENV VERSION_XML2=${libxml2} 92 | ENV XML2_BUILD_DIR=${BUILD_DIR}/xml2 93 | 94 | RUN set -xe; \ 95 | mkdir -p ${XML2_BUILD_DIR}; \ 96 | curl -Ls https://download.gnome.org/sources/libxml2/${VERSION_XML2%.*}/libxml2-${VERSION_XML2}.tar.xz \ 97 | | tar xJC ${XML2_BUILD_DIR} --strip-components=1 98 | 99 | WORKDIR ${XML2_BUILD_DIR}/ 100 | 101 | RUN set -xe; \ 102 | CFLAGS="" \ 103 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 104 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 105 | ./configure \ 106 | --prefix=${INSTALL_DIR} \ 107 | --with-sysroot=${INSTALL_DIR} \ 108 | --enable-shared \ 109 | --disable-static \ 110 | --with-html \ 111 | --with-history \ 112 | --enable-ipv6=no \ 113 | --with-icu \ 114 | --with-zlib=${INSTALL_DIR} \ 115 | --without-python 116 | 117 | RUN set -xe; \ 118 | make install \ 119 | && cp xml2-config ${INSTALL_DIR}/bin/xml2-config 120 | 121 | # Build LibSSH2 (https://github.com/libssh2/libssh2/releases/) 122 | 123 | ARG libssh2 124 | ENV VERSION_LIBSSH2=${libssh2} 125 | ENV LIBSSH2_BUILD_DIR=${BUILD_DIR}/libssh2 126 | 127 | RUN set -xe; \ 128 | mkdir -p ${LIBSSH2_BUILD_DIR}/bin; \ 129 | curl -Ls https://github.com/libssh2/libssh2/releases/download/libssh2-${VERSION_LIBSSH2}/libssh2-${VERSION_LIBSSH2}.tar.gz \ 130 | | tar xzC ${LIBSSH2_BUILD_DIR} --strip-components=1 131 | 132 | WORKDIR ${LIBSSH2_BUILD_DIR}/bin/ 133 | 134 | RUN set -xe; \ 135 | CFLAGS="" \ 136 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 137 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 138 | cmake .. \ 139 | -DBUILD_SHARED_LIBS=ON \ 140 | -DCRYPTO_BACKEND=OpenSSL \ 141 | -DENABLE_ZLIB_COMPRESSION=ON \ 142 | -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ 143 | -DCMAKE_BUILD_TYPE=RELEASE 144 | 145 | RUN set -xe; \ 146 | cmake --build . --target install 147 | 148 | # Build nghttp2 (https://github.com/nghttp2/nghttp2/releases/) 149 | 150 | ARG nghttp2 151 | ENV VERSION_NGHTTP2=${nghttp2} 152 | ENV NGHTTP2_BUILD_DIR=${BUILD_DIR}/nghttp2 153 | 154 | RUN set -xe; \ 155 | mkdir -p ${NGHTTP2_BUILD_DIR}/bin; \ 156 | curl -Ls https://github.com/nghttp2/nghttp2/releases/download/v${VERSION_NGHTTP2}/nghttp2-${VERSION_NGHTTP2}.tar.gz \ 157 | | tar xzC ${NGHTTP2_BUILD_DIR} --strip-components=1 158 | 159 | WORKDIR ${NGHTTP2_BUILD_DIR}/ 160 | 161 | RUN set -xe; \ 162 | CFLAGS="" \ 163 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 164 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 165 | ./configure --enable-lib-only --prefix=${INSTALL_DIR} && \ 166 | make -j $(nproc) && \ 167 | make install 168 | 169 | # Build Curl (https://github.com/curl/curl/releases/) 170 | 171 | ARG curl 172 | ENV VERSION_CURL=${curl} 173 | ENV CURL_BUILD_DIR=${BUILD_DIR}/curl 174 | 175 | RUN set -xe; \ 176 | mkdir -p ${CURL_BUILD_DIR}/bin; \ 177 | curl -Ls https://github.com/curl/curl/archive/curl-${VERSION_CURL//./_}.tar.gz \ 178 | | tar xzC ${CURL_BUILD_DIR} --strip-components=1 179 | 180 | WORKDIR ${CURL_BUILD_DIR}/ 181 | 182 | RUN set -xe; \ 183 | ./buildconf \ 184 | && CFLAGS="" \ 185 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 186 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 187 | ./configure \ 188 | --prefix=${INSTALL_DIR} \ 189 | --with-ca-bundle=${CA_BUNDLE} \ 190 | --enable-shared \ 191 | --disable-static \ 192 | --enable-optimize \ 193 | --disable-warnings \ 194 | --disable-dependency-tracking \ 195 | --with-zlib \ 196 | --enable-http \ 197 | --enable-ftp \ 198 | --enable-file \ 199 | --enable-ldaps \ 200 | --enable-proxy \ 201 | --enable-tftp \ 202 | --enable-ipv6 \ 203 | --enable-openssl-auto-load-config \ 204 | --enable-cookies \ 205 | --with-gnu-ld \ 206 | --with-ssl \ 207 | --with-libssh2 \ 208 | --with-nghttp2 \ 209 | --without-libpsl 210 | 211 | RUN set -xe; \ 212 | make install 213 | 214 | # Build Libzip (https://github.com/nih-at/libzip/releases) 215 | 216 | ARG libzip 217 | ENV VERSION_ZIP=${libzip} 218 | ENV ZIP_BUILD_DIR=${BUILD_DIR}/zip 219 | 220 | RUN set -xe; \ 221 | mkdir -p ${ZIP_BUILD_DIR}/bin/; \ 222 | # Download and upack the source code 223 | curl -Ls https://github.com/nih-at/libzip/releases/download/v${VERSION_ZIP}/libzip-${VERSION_ZIP}.tar.gz \ 224 | | tar xzC ${ZIP_BUILD_DIR} --strip-components=1 225 | 226 | # Move into the unpackaged code directory 227 | WORKDIR ${ZIP_BUILD_DIR}/bin/ 228 | 229 | # Configure the build 230 | RUN set -xe; \ 231 | CFLAGS="" \ 232 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 233 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 234 | cmake .. \ 235 | -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ 236 | -DCMAKE_BUILD_TYPE=RELEASE 237 | 238 | RUN set -xe; \ 239 | cmake --build . --target install 240 | 241 | # Build Libsodium (https://github.com/jedisct1/libsodium/releases) 242 | 243 | ARG libsodium 244 | ENV VERSION_LIBSODIUM=${libsodium} 245 | ENV LIBSODIUM_BUILD_DIR=${BUILD_DIR}/libsodium 246 | 247 | RUN set -xe; \ 248 | mkdir -p ${LIBSODIUM_BUILD_DIR}; \ 249 | curl -Ls https://github.com/jedisct1/libsodium/archive/${VERSION_LIBSODIUM}-RELEASE.tar.gz \ 250 | | tar xzC ${LIBSODIUM_BUILD_DIR} --strip-components=1 251 | 252 | WORKDIR ${LIBSODIUM_BUILD_DIR}/ 253 | 254 | RUN set -xe; \ 255 | CFLAGS="" \ 256 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 257 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 258 | ./autogen.sh \ 259 | && ./configure --prefix=${INSTALL_DIR} 260 | 261 | RUN set -xe; \ 262 | make install 263 | 264 | # Build Postgres (https://github.com/postgres/postgres/releases/) 265 | 266 | ARG postgres 267 | ENV VERSION_POSTGRES=${postgres} 268 | ENV POSTGRES_BUILD_DIR=${BUILD_DIR}/postgres 269 | 270 | RUN set -xe; \ 271 | mkdir -p ${POSTGRES_BUILD_DIR}/bin; \ 272 | curl -Ls https://github.com/postgres/postgres/archive/REL_${VERSION_POSTGRES//./_}.tar.gz \ 273 | | tar xzC ${POSTGRES_BUILD_DIR} --strip-components=1 274 | 275 | WORKDIR ${POSTGRES_BUILD_DIR}/ 276 | 277 | RUN set -xe; \ 278 | CFLAGS="" \ 279 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 280 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 281 | ./configure --prefix=${INSTALL_DIR} --with-openssl --without-readline 282 | 283 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/interfaces/libpq && make && make install 284 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/bin/pg_config && make && make install 285 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/backend && make generated-headers 286 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/include && make install 287 | 288 | # Build libjpeg 289 | 290 | ARG libjpeg 291 | ENV VERSION_LIBJPEG=${libjpeg} 292 | ENV LIBJPEG_BUILD_DIR=${BUILD_DIR}/libjpeg 293 | 294 | RUN set -xe; \ 295 | mkdir -p ${LIBJPEG_BUILD_DIR}/bin; \ 296 | curl -Ls http://www.ijg.org/files/jpegsrc.${VERSION_LIBJPEG}.tar.gz \ 297 | | tar xzC ${LIBJPEG_BUILD_DIR} --strip-components=1 298 | 299 | WORKDIR ${LIBJPEG_BUILD_DIR}/ 300 | 301 | RUN set -xe; \ 302 | CFLAGS="" \ 303 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 304 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 305 | ./configure \ 306 | --prefix=${INSTALL_DIR} \ 307 | --enable-shared \ 308 | --disable-static 309 | 310 | RUN set -xe; \ 311 | make install 312 | 313 | # Build libpng 314 | 315 | ARG libpng 316 | ENV VERSION_LIBPNG=${libpng} 317 | ENV LIBPNG_BUILD_DIR=${BUILD_DIR}/libpng 318 | 319 | RUN set -xe; \ 320 | mkdir -p ${LIBPNG_BUILD_DIR}/bin; \ 321 | curl -Ls https://download.sourceforge.net/libpng/libpng-${VERSION_LIBPNG}.tar.gz \ 322 | | tar xzC ${LIBPNG_BUILD_DIR} --strip-components=1 323 | 324 | WORKDIR ${LIBPNG_BUILD_DIR}/ 325 | 326 | RUN set -xe; \ 327 | CFLAGS="" \ 328 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 329 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 330 | ./configure \ 331 | --prefix=${INSTALL_DIR} \ 332 | --enable-shared \ 333 | --disable-static 334 | 335 | RUN set -xe; \ 336 | make install 337 | 338 | # Build Oniguruma 339 | 340 | ARG oniguruma 341 | ENV VERSION_ONIGURUMA=${oniguruma} 342 | ENV LIBONIG_BUILD_DIR=${BUILD_DIR}/libonig 343 | 344 | RUN set -xe \ 345 | && mkdir -p ${LIBONIG_BUILD_DIR}/bin \ 346 | && curl -Ls https://github.com/kkos/oniguruma/releases/download/v${VERSION_ONIGURUMA}/onig-${VERSION_ONIGURUMA}.tar.gz \ 347 | | tar xzC ${LIBONIG_BUILD_DIR} --strip-components=1 348 | 349 | WORKDIR ${LIBONIG_BUILD_DIR}/ 350 | 351 | RUN set -xe; \ 352 | CFLAGS="" \ 353 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 354 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 355 | && ./configure \ 356 | --prefix=${INSTALL_DIR} \ 357 | --enable-shared \ 358 | --disable-static 359 | 360 | RUN set -xe; \ 361 | make install 362 | 363 | # Build SQLite 364 | 365 | ARG sqlite 366 | ENV VERSION_SQLITE=${sqlite} 367 | ENV SQLITE_BUILD_DIR=${BUILD_DIR}/libsqlite3 368 | 369 | RUN LD_LIBRARY_PATH= yum install -y tcl 370 | 371 | RUN set -xe; \ 372 | mkdir -p ${SQLITE_BUILD_DIR}; \ 373 | curl -Ls https://github.com/sqlite/sqlite/archive/refs/tags/version-${VERSION_SQLITE}.tar.gz \ 374 | | tar xzC ${SQLITE_BUILD_DIR} --strip-components=1 375 | 376 | WORKDIR ${SQLITE_BUILD_DIR}/ 377 | 378 | RUN ./configure --prefix=${INSTALL_DIR} 379 | 380 | RUN make && make install 381 | 382 | # Build PHP 383 | 384 | ARG php 385 | ENV VERSION_PHP=${php} 386 | ENV PHP_BUILD_DIR=${BUILD_DIR}/php 387 | 388 | RUN set -xe; \ 389 | mkdir -p ${PHP_BUILD_DIR}; \ 390 | curl -Ls https://php.net/distributions/php-${VERSION_PHP}.tar.gz \ 391 | | tar xzC ${PHP_BUILD_DIR} --strip-components=1 392 | 393 | # Configure The PHP Build 394 | 395 | WORKDIR ${PHP_BUILD_DIR}/ 396 | 397 | RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel ImageMagick-devel 398 | 399 | RUN cp -a /usr/lib64/libgpg-error.so* ${INSTALL_DIR}/lib64/ 400 | RUN cp -a /usr/lib64/libtinfo.so* ${INSTALL_DIR}/lib64/ 401 | RUN cp -a /usr/lib64/libgcrypt.so* ${INSTALL_DIR}/lib64/ 402 | RUN cp -a /usr/lib64/libreadline.so?* ${INSTALL_DIR}/lib64/ 403 | RUN cp -a /usr/lib64/libasprintf.so* ${INSTALL_DIR}/lib64/ 404 | RUN cp -a /usr/lib64/libgettextpo.so* ${INSTALL_DIR}/lib64/ 405 | RUN cp -a /usr/lib64/preloadable_libintl.so* ${INSTALL_DIR}/lib64/ 406 | RUN cp -a /usr/lib64/lib*xslt*.so* ${INSTALL_DIR}/lib64/ 407 | 408 | RUN set -xe \ 409 | && ./buildconf --force \ 410 | && CFLAGS="-fstack-protector-strong -fpic -fpie -Os -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \ 411 | CPPFLAGS="-fstack-protector-strong -fpic -fpie -Os -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \ 412 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib -Wl,-O1 -Wl,--strip-all -Wl,--hash-style=both -pie" \ 413 | ./configure \ 414 | --prefix=${INSTALL_DIR} \ 415 | --enable-option-checking=fatal \ 416 | --with-config-file-path=${INSTALL_DIR}/etc/php \ 417 | --with-config-file-scan-dir=${INSTALL_DIR}/etc/php/conf.d:/var/task/php/conf.d \ 418 | --enable-fpm \ 419 | --disable-cgi \ 420 | --enable-cli \ 421 | --with-jpeg=${INSTALL_DIR} \ 422 | --with-xsl=${INSTALL_DIR} \ 423 | --enable-gd \ 424 | --disable-phpdbg \ 425 | # --disable-phpdbg-webhelper \ 426 | --with-sodium \ 427 | --with-readline \ 428 | --with-openssl \ 429 | --with-zlib=${INSTALL_DIR} \ 430 | --with-curl \ 431 | --enable-bcmath \ 432 | --enable-sockets \ 433 | --enable-exif \ 434 | --enable-ftp \ 435 | --with-gettext \ 436 | --with-pear \ 437 | --enable-mbstring \ 438 | --enable-soap \ 439 | --with-pdo-mysql=shared,mysqlnd \ 440 | --enable-pcntl \ 441 | --with-zip \ 442 | --with-pdo-pgsql=shared,${INSTALL_DIR} \ 443 | --enable-intl=shared 444 | 445 | RUN make -j $(nproc) 446 | 447 | # Override PEAR URL Since It Is Down 448 | 449 | RUN set -xe; \ 450 | make install PEAR_INSTALLER_URL='https://github.com/pear/pearweb_phars/raw/master/install-pear-nozlib.phar'; \ 451 | { find ${INSTALL_DIR}/bin ${INSTALL_DIR}/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ 452 | make clean; \ 453 | cp php.ini-production ${INSTALL_DIR}/etc/php/php.ini 454 | 455 | # Build Redis (https://pecl.php.net/package/redis/) 456 | 457 | ARG redis 458 | ENV VERSION_REDIS=${redis} 459 | 460 | RUN pecl install -f redis-${VERSION_REDIS} 461 | 462 | # Strip All Unneeded Symbols 463 | 464 | RUN find ${INSTALL_DIR} -type f -name "*.so*" -o -name "*.a" -exec strip --strip-unneeded {} \; 465 | RUN find ${INSTALL_DIR} -type f -executable -exec sh -c "file -i '{}' | grep -q 'x-executable; charset=binary'" \; -print|xargs strip --strip-all 466 | 467 | # Symlink All Binaries / Libaries 468 | 469 | RUN mkdir -p /opt/bin 470 | RUN mkdir -p /opt/lib 471 | RUN mkdir -p /opt/lib/curl 472 | 473 | RUN cp /opt/vapor/bin/* /opt/bin 474 | RUN cp /opt/vapor/sbin/* /opt/bin 475 | RUN cp /opt/vapor/lib/php/extensions/no-debug-non-zts-20240924/* /opt/bin 476 | 477 | RUN cp /opt/vapor/lib/* /opt/lib || true 478 | RUN cp /opt/vapor/lib/libcurl* /opt/lib/curl || true 479 | 480 | RUN cp "${INSTALL_DIR}/ssl/cert.pem" /opt/lib/curl/cert.pem 481 | RUN cp /opt/vapor/lib64/* /opt/lib || true 482 | 483 | RUN ls /opt/bin 484 | RUN /opt/bin/php -i | grep curl 485 | 486 | # Copy Everything To The Base Container 487 | 488 | FROM --platform=linux/arm64 amazonlinux:2 489 | 490 | ENV INSTALL_DIR="/opt/vapor" 491 | 492 | ENV PATH="/opt/bin:${PATH}" \ 493 | LD_LIBRARY_PATH="${INSTALL_DIR}/lib64:${INSTALL_DIR}/lib" 494 | 495 | RUN mkdir -p /opt 496 | 497 | WORKDIR /opt 498 | 499 | COPY --from=php_builder /opt /opt 500 | RUN LD_LIBRARY_PATH= yum -y install zip 501 | -------------------------------------------------------------------------------- /php84al2-arm/runtime/bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | while true 4 | do 5 | /opt/bin/php /opt/bootstrap.php 6 | done 7 | -------------------------------------------------------------------------------- /php84al2-arm/runtime/bootstrap.php: -------------------------------------------------------------------------------- 1 | #!/opt/bin/php 2 | $value){ 9 | $buildArguments .= "--build-arg $key=$value "; 10 | } 11 | 12 | print $buildArguments; 13 | -------------------------------------------------------------------------------- /php84al2/php.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=linux/amd64 vapor/runtime/compiler:latest as php_builder 2 | 3 | SHELL ["/bin/bash", "-c"] 4 | 5 | ENV BUILD_DIR="/tmp/build" 6 | ENV INSTALL_DIR="/opt/vapor" 7 | 8 | # Configure Default Compiler Variables 9 | 10 | ENV PKG_CONFIG_PATH="${INSTALL_DIR}/lib64/pkgconfig:${INSTALL_DIR}/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig" \ 11 | PKG_CONFIG="/usr/bin/pkg-config" \ 12 | PATH="${INSTALL_DIR}/bin:${PATH}" 13 | 14 | ENV LD_LIBRARY_PATH="${INSTALL_DIR}/lib64:${INSTALL_DIR}/lib" 15 | 16 | # Create All The Necessary Build Directories 17 | 18 | RUN mkdir -p ${BUILD_DIR} \ 19 | ${INSTALL_DIR}/bin \ 20 | ${INSTALL_DIR}/doc \ 21 | ${INSTALL_DIR}/etc/php \ 22 | ${INSTALL_DIR}/etc/php/conf.d \ 23 | ${INSTALL_DIR}/include \ 24 | ${INSTALL_DIR}/lib \ 25 | ${INSTALL_DIR}/lib64 \ 26 | ${INSTALL_DIR}/libexec \ 27 | ${INSTALL_DIR}/sbin \ 28 | ${INSTALL_DIR}/share 29 | 30 | 31 | # Build ZLIB (https://github.com/madler/zlib/releases) 32 | 33 | ARG zlib 34 | ENV VERSION_ZLIB=${zlib} 35 | ENV ZLIB_BUILD_DIR=${BUILD_DIR}/zlib 36 | 37 | RUN set -xe; \ 38 | mkdir -p ${ZLIB_BUILD_DIR}; \ 39 | curl -Ls https://github.com/madler/zlib/releases/download/v${VERSION_ZLIB}/zlib-${VERSION_ZLIB}.tar.xz \ 40 | | tar xJC ${ZLIB_BUILD_DIR} --strip-components=1 41 | 42 | WORKDIR ${ZLIB_BUILD_DIR}/ 43 | 44 | RUN set -xe; \ 45 | make distclean \ 46 | && CFLAGS="" \ 47 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 48 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 49 | ./configure \ 50 | --prefix=${INSTALL_DIR} \ 51 | --64 52 | 53 | RUN set -xe; \ 54 | make install \ 55 | && rm ${INSTALL_DIR}/lib/libz.a 56 | 57 | # Build OpenSSL (https://github.com/openssl/openssl/releases) 58 | 59 | ARG openssl 60 | ENV VERSION_OPENSSL=${openssl} 61 | ENV OPENSSL_BUILD_DIR=${BUILD_DIR}/openssl 62 | ENV CA_BUNDLE_SOURCE="https://curl.se/ca/cacert.pem" 63 | ENV CA_BUNDLE="${INSTALL_DIR}/ssl/cert.pem" 64 | 65 | RUN set -xe; \ 66 | mkdir -p ${OPENSSL_BUILD_DIR}; \ 67 | curl -Ls https://github.com/openssl/openssl/archive/openssl-${VERSION_OPENSSL}.tar.gz \ 68 | | tar xzC ${OPENSSL_BUILD_DIR} --strip-components=1 69 | 70 | WORKDIR ${OPENSSL_BUILD_DIR}/ 71 | 72 | RUN set -xe; \ 73 | CFLAGS="" \ 74 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 75 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 76 | ./config \ 77 | --prefix=${INSTALL_DIR} \ 78 | --openssldir=${INSTALL_DIR}/ssl \ 79 | --release \ 80 | enable-tls1_3 \ 81 | no-tests \ 82 | shared \ 83 | zlib 84 | 85 | RUN set -xe; \ 86 | make install \ 87 | && curl -L -k -o ${CA_BUNDLE} ${CA_BUNDLE_SOURCE} 88 | 89 | # Build LibXML2 (https://gitlab.gnome.org/GNOME/libxml2/-/releases) 90 | 91 | ARG libxml2 92 | ENV VERSION_XML2=${libxml2} 93 | ENV XML2_BUILD_DIR=${BUILD_DIR}/xml2 94 | 95 | RUN set -xe; \ 96 | mkdir -p ${XML2_BUILD_DIR}; \ 97 | curl -Ls https://download.gnome.org/sources/libxml2/${VERSION_XML2%.*}/libxml2-${VERSION_XML2}.tar.xz \ 98 | | tar xJC ${XML2_BUILD_DIR} --strip-components=1 99 | 100 | WORKDIR ${XML2_BUILD_DIR}/ 101 | 102 | RUN set -xe; \ 103 | CFLAGS="" \ 104 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 105 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 106 | ./configure \ 107 | --prefix=${INSTALL_DIR} \ 108 | --with-sysroot=${INSTALL_DIR} \ 109 | --enable-shared \ 110 | --disable-static \ 111 | --with-html \ 112 | --with-history \ 113 | --enable-ipv6=no \ 114 | --with-icu \ 115 | --with-zlib=${INSTALL_DIR} \ 116 | --without-python 117 | 118 | RUN set -xe; \ 119 | make install \ 120 | && cp xml2-config ${INSTALL_DIR}/bin/xml2-config 121 | 122 | # Build LibSSH2 (https://github.com/libssh2/libssh2/releases/) 123 | 124 | ARG libssh2 125 | ENV VERSION_LIBSSH2=${libssh2} 126 | ENV LIBSSH2_BUILD_DIR=${BUILD_DIR}/libssh2 127 | 128 | RUN set -xe; \ 129 | mkdir -p ${LIBSSH2_BUILD_DIR}/bin; \ 130 | curl -Ls https://github.com/libssh2/libssh2/releases/download/libssh2-${VERSION_LIBSSH2}/libssh2-${VERSION_LIBSSH2}.tar.gz \ 131 | | tar xzC ${LIBSSH2_BUILD_DIR} --strip-components=1 132 | 133 | WORKDIR ${LIBSSH2_BUILD_DIR}/bin/ 134 | 135 | RUN set -xe; \ 136 | CFLAGS="" \ 137 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 138 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 139 | cmake .. \ 140 | -DBUILD_SHARED_LIBS=ON \ 141 | -DCRYPTO_BACKEND=OpenSSL \ 142 | -DENABLE_ZLIB_COMPRESSION=ON \ 143 | -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ 144 | -DCMAKE_BUILD_TYPE=RELEASE 145 | 146 | RUN set -xe; \ 147 | cmake --build . --target install 148 | 149 | # Build nghttp2 (https://github.com/nghttp2/nghttp2/releases/) 150 | 151 | ARG nghttp2 152 | ENV VERSION_NGHTTP2=${nghttp2} 153 | ENV NGHTTP2_BUILD_DIR=${BUILD_DIR}/nghttp2 154 | 155 | RUN set -xe; \ 156 | mkdir -p ${NGHTTP2_BUILD_DIR}/bin; \ 157 | curl -Ls https://github.com/nghttp2/nghttp2/releases/download/v${VERSION_NGHTTP2}/nghttp2-${VERSION_NGHTTP2}.tar.gz \ 158 | | tar xzC ${NGHTTP2_BUILD_DIR} --strip-components=1 159 | 160 | WORKDIR ${NGHTTP2_BUILD_DIR}/ 161 | 162 | RUN set -xe; \ 163 | CFLAGS="" \ 164 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 165 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 166 | ./configure --enable-lib-only --prefix=${INSTALL_DIR} && \ 167 | make -j $(nproc) && \ 168 | make install 169 | 170 | # Build Curl (https://github.com/curl/curl/releases/) 171 | 172 | ARG curl 173 | ENV VERSION_CURL=${curl} 174 | ENV CURL_BUILD_DIR=${BUILD_DIR}/curl 175 | 176 | RUN set -xe; \ 177 | mkdir -p ${CURL_BUILD_DIR}/bin; \ 178 | curl -Ls https://github.com/curl/curl/archive/curl-${VERSION_CURL//./_}.tar.gz \ 179 | | tar xzC ${CURL_BUILD_DIR} --strip-components=1 180 | 181 | WORKDIR ${CURL_BUILD_DIR}/ 182 | 183 | RUN set -xe; \ 184 | ./buildconf \ 185 | && CFLAGS="" \ 186 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 187 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 188 | ./configure \ 189 | --prefix=${INSTALL_DIR} \ 190 | --with-ca-bundle=${CA_BUNDLE} \ 191 | --enable-shared \ 192 | --disable-static \ 193 | --enable-optimize \ 194 | --disable-warnings \ 195 | --disable-dependency-tracking \ 196 | --with-zlib \ 197 | --enable-http \ 198 | --enable-ftp \ 199 | --enable-file \ 200 | --enable-ldaps \ 201 | --enable-proxy \ 202 | --enable-tftp \ 203 | --enable-ipv6 \ 204 | --enable-openssl-auto-load-config \ 205 | --enable-cookies \ 206 | --with-gnu-ld \ 207 | --with-ssl \ 208 | --with-libssh2 \ 209 | --with-nghttp2 \ 210 | --without-libpsl 211 | 212 | RUN set -xe; \ 213 | make install 214 | 215 | # Build Libzip (https://github.com/nih-at/libzip/releases) 216 | 217 | ARG libzip 218 | ENV VERSION_ZIP=${libzip} 219 | ENV ZIP_BUILD_DIR=${BUILD_DIR}/zip 220 | 221 | RUN set -xe; \ 222 | mkdir -p ${ZIP_BUILD_DIR}/bin/; \ 223 | # Download and upack the source code 224 | curl -Ls https://github.com/nih-at/libzip/releases/download/v${VERSION_ZIP}/libzip-${VERSION_ZIP}.tar.gz \ 225 | | tar xzC ${ZIP_BUILD_DIR} --strip-components=1 226 | 227 | # Move into the unpackaged code directory 228 | WORKDIR ${ZIP_BUILD_DIR}/bin/ 229 | 230 | # Configure the build 231 | RUN set -xe; \ 232 | CFLAGS="" \ 233 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 234 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 235 | cmake .. \ 236 | -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ 237 | -DCMAKE_BUILD_TYPE=RELEASE 238 | 239 | RUN set -xe; \ 240 | cmake --build . --target install 241 | 242 | # Build Libsodium (https://github.com/jedisct1/libsodium/releases) 243 | 244 | ARG libsodium 245 | ENV VERSION_LIBSODIUM=${libsodium} 246 | ENV LIBSODIUM_BUILD_DIR=${BUILD_DIR}/libsodium 247 | 248 | RUN set -xe; \ 249 | mkdir -p ${LIBSODIUM_BUILD_DIR}; \ 250 | curl -Ls https://github.com/jedisct1/libsodium/archive/${VERSION_LIBSODIUM}-RELEASE.tar.gz \ 251 | | tar xzC ${LIBSODIUM_BUILD_DIR} --strip-components=1 252 | 253 | WORKDIR ${LIBSODIUM_BUILD_DIR}/ 254 | 255 | RUN set -xe; \ 256 | CFLAGS="" \ 257 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 258 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 259 | ./autogen.sh \ 260 | && ./configure --prefix=${INSTALL_DIR} 261 | 262 | RUN set -xe; \ 263 | make install 264 | 265 | # Build Postgres (https://github.com/postgres/postgres/releases/) 266 | 267 | ARG postgres 268 | ENV VERSION_POSTGRES=${postgres} 269 | ENV POSTGRES_BUILD_DIR=${BUILD_DIR}/postgres 270 | 271 | RUN set -xe; \ 272 | mkdir -p ${POSTGRES_BUILD_DIR}/bin; \ 273 | curl -Ls https://github.com/postgres/postgres/archive/REL_${VERSION_POSTGRES//./_}.tar.gz \ 274 | | tar xzC ${POSTGRES_BUILD_DIR} --strip-components=1 275 | 276 | WORKDIR ${POSTGRES_BUILD_DIR}/ 277 | 278 | RUN set -xe; \ 279 | CFLAGS="" \ 280 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 281 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 282 | ./configure --prefix=${INSTALL_DIR} --with-openssl --without-readline 283 | 284 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/interfaces/libpq && make && make install 285 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/bin/pg_config && make && make install 286 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/backend && make generated-headers 287 | RUN set -xe; cd ${POSTGRES_BUILD_DIR}/src/include && make install 288 | 289 | # Build libjpeg 290 | 291 | ARG libjpeg 292 | ENV VERSION_LIBJPEG=${libjpeg} 293 | ENV LIBJPEG_BUILD_DIR=${BUILD_DIR}/libjpeg 294 | 295 | RUN set -xe; \ 296 | mkdir -p ${LIBJPEG_BUILD_DIR}/bin; \ 297 | curl -Ls http://www.ijg.org/files/jpegsrc.${VERSION_LIBJPEG}.tar.gz \ 298 | | tar xzC ${LIBJPEG_BUILD_DIR} --strip-components=1 299 | 300 | WORKDIR ${LIBJPEG_BUILD_DIR}/ 301 | 302 | RUN set -xe; \ 303 | CFLAGS="" \ 304 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 305 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 306 | ./configure \ 307 | --prefix=${INSTALL_DIR} \ 308 | --enable-shared \ 309 | --disable-static 310 | 311 | RUN set -xe; \ 312 | make install 313 | 314 | # Build libpng 315 | 316 | ARG libpng 317 | ENV VERSION_LIBPNG=${libpng} 318 | ENV LIBPNG_BUILD_DIR=${BUILD_DIR}/libpng 319 | 320 | RUN set -xe; \ 321 | mkdir -p ${LIBPNG_BUILD_DIR}/bin; \ 322 | curl -Ls https://download.sourceforge.net/libpng/libpng-${VERSION_LIBPNG}.tar.gz \ 323 | | tar xzC ${LIBPNG_BUILD_DIR} --strip-components=1 324 | 325 | WORKDIR ${LIBPNG_BUILD_DIR}/ 326 | 327 | RUN set -xe; \ 328 | CFLAGS="" \ 329 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 330 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 331 | ./configure \ 332 | --prefix=${INSTALL_DIR} \ 333 | --enable-shared \ 334 | --disable-static 335 | 336 | RUN set -xe; \ 337 | make install 338 | 339 | # Build Oniguruma 340 | 341 | ARG oniguruma 342 | ENV VERSION_ONIGURUMA=${oniguruma} 343 | ENV LIBONIG_BUILD_DIR=${BUILD_DIR}/libonig 344 | 345 | RUN set -xe \ 346 | && mkdir -p ${LIBONIG_BUILD_DIR}/bin \ 347 | && curl -Ls https://github.com/kkos/oniguruma/releases/download/v${VERSION_ONIGURUMA}/onig-${VERSION_ONIGURUMA}.tar.gz \ 348 | | tar xzC ${LIBONIG_BUILD_DIR} --strip-components=1 349 | 350 | WORKDIR ${LIBONIG_BUILD_DIR}/ 351 | 352 | RUN set -xe; \ 353 | CFLAGS="" \ 354 | CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \ 355 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \ 356 | && ./configure \ 357 | --prefix=${INSTALL_DIR} \ 358 | --enable-shared \ 359 | --disable-static 360 | 361 | RUN set -xe; \ 362 | make install 363 | 364 | # Build SQLite 365 | 366 | ARG sqlite 367 | ENV VERSION_SQLITE=${sqlite} 368 | ENV SQLITE_BUILD_DIR=${BUILD_DIR}/libsqlite3 369 | 370 | RUN LD_LIBRARY_PATH= yum install -y tcl 371 | 372 | RUN set -xe; \ 373 | mkdir -p ${SQLITE_BUILD_DIR}; \ 374 | curl -Ls https://github.com/sqlite/sqlite/archive/refs/tags/version-${VERSION_SQLITE}.tar.gz \ 375 | | tar xzC ${SQLITE_BUILD_DIR} --strip-components=1 376 | 377 | WORKDIR ${SQLITE_BUILD_DIR}/ 378 | 379 | RUN ./configure --prefix=${INSTALL_DIR} 380 | 381 | RUN make && make install 382 | 383 | # Build PHP 384 | 385 | ARG php 386 | ENV VERSION_PHP=${php} 387 | ENV PHP_BUILD_DIR=${BUILD_DIR}/php 388 | 389 | RUN set -xe; \ 390 | mkdir -p ${PHP_BUILD_DIR}; \ 391 | curl -Ls https://php.net/distributions/php-${VERSION_PHP}.tar.gz \ 392 | | tar xzC ${PHP_BUILD_DIR} --strip-components=1 393 | 394 | # Configure The PHP Build 395 | 396 | WORKDIR ${PHP_BUILD_DIR}/ 397 | 398 | RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel ImageMagick-devel 399 | 400 | RUN cp -a /usr/lib64/libgpg-error.so* ${INSTALL_DIR}/lib64/ 401 | RUN cp -a /usr/lib64/libtinfo.so* ${INSTALL_DIR}/lib64/ 402 | RUN cp -a /usr/lib64/libgcrypt.so* ${INSTALL_DIR}/lib64/ 403 | RUN cp -a /usr/lib64/libreadline.so?* ${INSTALL_DIR}/lib64/ 404 | RUN cp -a /usr/lib64/libasprintf.so* ${INSTALL_DIR}/lib64/ 405 | RUN cp -a /usr/lib64/libgettextpo.so* ${INSTALL_DIR}/lib64/ 406 | RUN cp -a /usr/lib64/preloadable_libintl.so* ${INSTALL_DIR}/lib64/ 407 | RUN cp -a /usr/lib64/lib*xslt*.so* ${INSTALL_DIR}/lib64/ 408 | 409 | RUN set -xe \ 410 | && ./buildconf --force \ 411 | && CFLAGS="-fstack-protector-strong -fpic -fpie -Os -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \ 412 | CPPFLAGS="-fstack-protector-strong -fpic -fpie -Os -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \ 413 | LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib -Wl,-O1 -Wl,--strip-all -Wl,--hash-style=both -pie" \ 414 | ./configure \ 415 | --build=x86_64-pc-linux-gnu \ 416 | --prefix=${INSTALL_DIR} \ 417 | --enable-option-checking=fatal \ 418 | --with-config-file-path=${INSTALL_DIR}/etc/php \ 419 | --with-config-file-scan-dir=${INSTALL_DIR}/etc/php/conf.d:/var/task/php/conf.d \ 420 | --enable-fpm \ 421 | --disable-cgi \ 422 | --enable-cli \ 423 | --with-jpeg=${INSTALL_DIR} \ 424 | --with-xsl=${INSTALL_DIR} \ 425 | --enable-gd \ 426 | --disable-phpdbg \ 427 | # --disable-phpdbg-webhelper \ 428 | --with-sodium \ 429 | --with-readline \ 430 | --with-openssl \ 431 | --with-zlib=${INSTALL_DIR} \ 432 | --with-curl \ 433 | --enable-bcmath \ 434 | --enable-sockets \ 435 | --enable-exif \ 436 | --enable-ftp \ 437 | --with-gettext \ 438 | --with-pear \ 439 | --enable-mbstring \ 440 | --enable-soap \ 441 | --with-pdo-mysql=shared,mysqlnd \ 442 | --enable-pcntl \ 443 | --with-zip \ 444 | --with-pdo-pgsql=shared,${INSTALL_DIR} \ 445 | --enable-intl=shared 446 | 447 | RUN make -j $(nproc) 448 | 449 | # Override PEAR URL Since It Is Down 450 | 451 | RUN set -xe; \ 452 | make install PEAR_INSTALLER_URL='https://github.com/pear/pearweb_phars/raw/master/install-pear-nozlib.phar'; \ 453 | { find ${INSTALL_DIR}/bin ${INSTALL_DIR}/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ 454 | make clean; \ 455 | cp php.ini-production ${INSTALL_DIR}/etc/php/php.ini 456 | 457 | # Build Redis (https://pecl.php.net/package/redis/) 458 | 459 | ARG redis 460 | ENV VERSION_REDIS=${redis} 461 | 462 | RUN pecl install -f redis-${VERSION_REDIS} 463 | 464 | # Strip All Unneeded Symbols 465 | 466 | RUN find ${INSTALL_DIR} -type f -name "*.so*" -o -name "*.a" -exec strip --strip-unneeded {} \; 467 | RUN find ${INSTALL_DIR} -type f -executable -exec sh -c "file -i '{}' | grep -q 'x-executable; charset=binary'" \; -print|xargs strip --strip-all 468 | 469 | # Symlink All Binaries / Libaries 470 | 471 | RUN mkdir -p /opt/bin 472 | RUN mkdir -p /opt/lib 473 | RUN mkdir -p /opt/lib/curl 474 | 475 | RUN cp /opt/vapor/bin/* /opt/bin 476 | RUN cp /opt/vapor/sbin/* /opt/bin 477 | RUN cp /opt/vapor/lib/php/extensions/no-debug-non-zts-20240924/* /opt/bin 478 | 479 | RUN cp /opt/vapor/lib/* /opt/lib || true 480 | RUN cp /opt/vapor/lib/libcurl* /opt/lib/curl || true 481 | 482 | RUN cp "${INSTALL_DIR}/ssl/cert.pem" /opt/lib/curl/cert.pem 483 | RUN cp /opt/vapor/lib64/* /opt/lib || true 484 | 485 | RUN ls /opt/bin 486 | RUN /opt/bin/php -i | grep curl 487 | 488 | # Copy Everything To The Base Container 489 | 490 | FROM amazonlinux:2 491 | 492 | ENV INSTALL_DIR="/opt/vapor" 493 | 494 | ENV PATH="/opt/bin:${PATH}" \ 495 | LD_LIBRARY_PATH="${INSTALL_DIR}/lib64:${INSTALL_DIR}/lib" 496 | 497 | RUN mkdir -p /opt 498 | 499 | WORKDIR /opt 500 | 501 | COPY --from=php_builder /opt /opt 502 | RUN LD_LIBRARY_PATH= yum -y install zip 503 | -------------------------------------------------------------------------------- /php84al2/runtime/bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | while true 4 | do 5 | /opt/bin/php /opt/bootstrap.php 6 | done 7 | -------------------------------------------------------------------------------- /php84al2/runtime/bootstrap.php: -------------------------------------------------------------------------------- 1 | #!/opt/bin/php 2 | safeLoad(); 9 | 10 | $layers = [ 11 | // Amazon Linux 2: 12 | 'php-81al2' => 'Laravel Vapor PHP 8.1 for Amazon Linux 2', 13 | 'php-82al2' => 'Laravel Vapor PHP 8.2 for Amazon Linux 2', 14 | 'php-82al2-arm' => 'Laravel Vapor PHP 8.2 for Amazon Linux 2 ARM', 15 | 'php-83al2' => 'Laravel Vapor PHP 8.3 for Amazon Linux 2', 16 | 'php-83al2-arm' => 'Laravel Vapor PHP 8.3 for Amazon Linux 2 ARM', 17 | 'php-84al2' => 'Laravel Vapor PHP 8.4 for Amazon Linux 2', 18 | 'php-84al2-arm' => 'Laravel Vapor PHP 8.4 for Amazon Linux 2 ARM', 19 | ]; 20 | 21 | $regions = [ 22 | 'us-east-1' => 'US East (N. Virginia) (us-east-1)', 23 | 'us-east-2' => 'US East (Ohio) (us-east-2)', 24 | 'us-west-1' => 'US West (N. California) (us-west-1)', 25 | 'us-west-2' => 'US West (Oregon) (us-west-2)', 26 | 'ap-east-1' => 'Asia Pacific (Hong Kong) (ap-east-1)', 27 | 'ap-south-1' => 'Asia Pacific (Mumbai) (ap-south-1)', 28 | 'ap-northeast-3' => 'Asia Pacific (Osaka) (ap-northeast-3)', 29 | 'ap-northeast-2' => 'Asia Pacific (Seoul) (ap-northeast-2)', 30 | 'ap-southeast-1' => 'Asia Pacific (Singapore) (ap-southeast-1)', 31 | 'ap-southeast-2' => 'Asia Pacific (Sydney) (ap-southeast-2)', 32 | 'ap-southeast-3' => 'Asia Pacific (Jakarta) (ap-southeast-3)', 33 | 'ap-northeast-1' => 'Asia Pacific (Tokyo) (ap-northeast-1)', 34 | 'af-south-1' => 'Africa (Cape Town) (af-south-1)', 35 | 'ca-central-1' => 'Canada (Central) (ca-central-1)', 36 | // 'cn-north-1' => 'China (Beijing) (cn-north-1)', 37 | // 'cn-northwest-1' => 'China (Ningxia) (cn-northwest-1)', 38 | 'eu-central-1' => 'EU (Frankfurt) (eu-central-1)', 39 | 'eu-west-1' => 'EU (Ireland) (eu-west-1)', 40 | 'eu-west-2' => 'EU (London) (eu-west-2)', 41 | 'eu-west-3' => 'EU (Paris) (eu-west-3)', 42 | 'eu-north-1' => 'EU (Stockholm) (eu-north-1)', 43 | 'eu-south-1' => 'EU (Milan) (eu-south-1)', 44 | 'me-south-1' => 'Middle East (Bahrain) (me-south-1)', 45 | 'sa-east-1' => 'South America (São Paulo) (sa-east-1)', 46 | ]; 47 | 48 | foreach (array_keys($regions) as $region) { 49 | $layersToPublish = isset($argv[1]) ? [$argv[1] => $layers[$argv[1]]] : $layers; 50 | 51 | foreach ($layersToPublish as $layer => $description) { 52 | $lambda = new LambdaClient([ 53 | 'region' => $region, 54 | 'version' => 'latest', 55 | 'credentials' => [ 56 | 'key' => $_SERVER['AWS_ACCESS_KEY_ID'], 57 | 'secret' => $_SERVER['AWS_SECRET_ACCESS_KEY'], 58 | 'token' => $_SERVER['AWS_SESSION_TOKEN'] ?? null, 59 | ], 60 | ]); 61 | 62 | $publishResponse = $lambda->publishLayerVersion([ 63 | 'LayerName' => 'vapor-'.$layer, 64 | 'Description' => $description, 65 | 'Content' => [ 66 | 'ZipFile' => file_get_contents(__DIR__."/export/{$layer}.zip"), 67 | ], 68 | ]); 69 | 70 | $lambda->addLayerVersionPermission([ 71 | 'Action' => 'lambda:GetLayerVersion', 72 | 'LayerName' => 'vapor-'.$layer, 73 | 'Principal' => '*', 74 | 'StatementId' => (string) time(), 75 | 'VersionNumber' => (string) $publishResponse['Version'], 76 | ]); 77 | 78 | echo '['.$region.']: '.$publishResponse['LayerVersionArn'].PHP_EOL; 79 | } 80 | } 81 | --------------------------------------------------------------------------------