Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Aws Crt Php Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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.

Implementation Patterns

  • Silent dependency: You’ll almost never interact with CRT directly. When using 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.
  • Explicit CRT usage (rare): Only consider direct usage for advanced IoT/messaging integrations (e.g., building a custom MQTT client via 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.
  • Performance-sensitive workloads: CRT shines in scenarios with heavy concurrent requests (e.g., S3 batch operations, Kinesis streams). Enable it transparently by ensuring your AWS SDK uses CRT-enabled builds (Aws\Handler\GuzzleV6\GuzzleHandlerAws\Handler\CrtV1\CrtV1Handler). No code changes required—just use the default SDK client factories.

Gotchas and Tips

  • PECL vs. Composer conflict: Installing 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).
  • OpenSSL version mismatch (Unix): CRT bundles 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.
  • Windows builds are fragile: If nmake fails, ensure:
    (1) You’re in the Visual Studio Developer Command Prompt (not PowerShell/CMD),
    (2) php-config points to the exact PHP build used by Laravel (check php -i | grep extension_dir),
    (3) php-win.ini includes the full path to php_awscrt.dll (e.g., extension="C:\php\ext\php_awscrt.dll").
    Re-run .\dev-scripts\run_tests.bat <php-path> to validate.
  • Debugging native crashes: Use 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.
  • Version drift: CRT is tightly coupled to the AWS SDK version. Always upgrade them together (composer update aws/aws-sdk-php aws/aws-crt-php). Check compatibility via AWS SDK’s CRT support table.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport