The requested PHP extension ext-soap * is missing from your system when updating composer in Yii2
Stefan Bogdanescu
Founder & Senior Architect · 2026-06-29
The Missing Piece: Resolving PHP Extension Errors in Composer Dependencies (A Yii2/Composer Deep Dive)
When working with modern PHP frameworks like Yii2, managing dependencies via Composer is central to the development workflow. However, sometimes, the dependency resolution process runs into unexpected roadblocks related to the underlying PHP environment itself—specifically missing extensions. A common frustration arises when a package requires an extension (like ext-soap), but Composer fails to recognize it, even if you have manually enabled it in your main php.ini file.
This post dives deep into why this happens and provides a robust, developer-focused strategy to resolve these frustrating dependency conflicts.
Understanding the Dependency Conflict
The error message you encountered is highly specific:
googleads/googleads-php-lib 27.1.0 requires ext-soap * -> the requested PHP extension soap is missing from your system.
This situation highlights a critical distinction: PHP extensions must be correctly loaded and accessible to the specific environment executing the command. Simply editing php.ini might not be enough if the CLI (Command Line Interface) or Composer process is using a different configuration file, or if the extension compilation failed during PHP installation.
When Composer runs dependency checks, it relies on the PHP interpreter running in the CLI mode to determine what features are available for the requested packages to function correctly. If ext-soap isn't visible to that specific execution context, the dependency check fails immediately.
Step-by-Step Troubleshooting Guide
Before jumping to complex fixes, let’s systematically verify the environment. As a senior developer, I always recommend isolating the issue by checking the CLI environment directly.
1. Verify PHP Configuration Loading
First, confirm that the configuration you edited in php.ini is actually being loaded when running commands from the terminal.
Run the following command in your terminal:
php --ini
This command tells you exactly which configuration files (including Loaded Configuration File) and extension directories PHP is currently using for CLI operations. If the path listed here points to a different php.ini than the one you edited, that is your primary source of the problem.
2. Reconfirm Extension Installation and Compilation
If the php --ini output looks correct, the issue might be with the extension itself being installed or compiled correctly for your specific PHP version.
- Check the status: Use the
php -mcommand to list all loaded modules. Ifsoapis missing from this list, it confirms that the module is not active in the current session. - Reinstall/Recompile: If you are using a local stack like XAMPP or WAMP, sometimes simply restarting the entire service and ensuring you used the correct installation method (e.g., compiling from source) can resolve lingering issues. For robust setups, ensure your PHP installation aligns with best practices; for instance, consistent dependency management is key, much like how modern frameworks encourage standardized tooling, similar to principles discussed at laravelcompany.com.
3. The Composer Environment Fix (The Quick Solution)
If you are certain the extension is enabled but Composer still refuses it, sometimes forcing a clean environment resolves the issue:
- Clear Caches: Run
composer clear-cache. - Re-run Update: Execute your update command again:
composer update.
This forces Composer to re-evaluate the system state and potentially pick up freshly loaded extension information.
Conclusion: Building Robust PHP Environments
Dependency errors involving missing extensions are rarely about the package itself; they are almost always about an environmental mismatch between the application's requirements and the execution environment. By moving beyond simply editing php.ini and instead using tools like php --ini to diagnose exactly which configuration is active, you gain control over your development environment.
Remember, maintaining a clean, consistent, and correctly configured PHP setup is the foundation for stable application development, whether you are building a complex system or working within the ecosystem popularized by frameworks like Yii2. Always treat your PHP installation as a critical piece of infrastructure that needs rigorous verification before diving into dependency management.