aws/aws-crt-php
AWS Common Runtime (CRT) bindings for PHP. Install the awscrt native extension via PECL or build from source (UNIX/Windows), then require aws/aws-crt-php with Composer. Provides high-performance AWS client primitives backed by CRT libraries.
Start by installing the package via Composer: composer require aws/aws-crt-php. In Laravel, this package is almost always installed automatically as a transitive dependency of aws/aws-sdk-php (especially when using modern SDK versions ≥3.200). Verify installation with php -m | grep awscrt or php --ri awscrt. If missing, check php.ini for extension=awscrt (Unix) or extension=php_awscrt.dll (Windows). For local development, avoid manual PECL installation unless necessary—use Composer exclusively to prevent extension conflicts.
Aws\S3\S3Client, Aws\Iot\MqttClient, or Aws\SigV4\SigV4, the AWS SDK internally delegates low-level I/O, TLS, and signing to CRT. No configuration is needed—it “just works” under the hood.Aws\CRT\Io\SocketOptions or Aws\CRT\HTTP\Request). This typically occurs in high-throughput background jobs (e.g., Laravel queues processing IoT telemetry), but even then, prefer AWS SDK’s higher-level wrappers like Aws\Iot\MqttClient unless profiling proves CRT-level control is necessary.Aws\Handler\GuzzleV6\GuzzleHandler → Aws\Handler\CrtV1\CrtV1Handler). No code changes required—just use the default SDK client factories.pecl install awscrt and composer require aws/aws-crt-php leads to PHP Fatal error: Cannot redeclare class ... or segfaults. Always choose one method—Composer is safer for Laravel deployments (avoids php.ini edits and path mismatches).aws-lc by default, but if PHP links to a different OpenSSL version (e.g., via Homebrew vs. system OpenSSL), you’ll get cryptic crashes (e.g., Segmentation fault: 11 during TLS handshake). Fix by rebuilding CRT from source: USE_OPENSSL=OFF make install.nmake fails, ensure:php-config points to the exact PHP build used by Laravel (check php -i | grep extension_dir),php-win.ini includes the full path to php_awscrt.dll (e.g., extension="C:\php\ext\php_awscrt.dll")..\dev-scripts\run_tests.bat <php-path> to validate.php -dzend_extension=xdebug.so -c /path/to/php.ini (not php artisan ...) to isolate CLI issues. For stack traces, build CRT with CMAKE_BUILD_TYPE=Debug and run under GDB—but remember Xdebug won’t step into CRT internals.composer update aws/aws-sdk-php aws/aws-crt-php). Check compatibility via AWS SDK’s CRT support table.How can I help you explore Laravel packages today?