Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Composer
  3. Composer/Xdebug-Handler

Composer/Xdebug-Handler

MITPHP3.0.5

Restarts CLI processes without loading the Xdebug extension to improve performance.

GitHubGitHub
2.6k stars33 forks0 contributors

What is Composer/Xdebug-Handler?

Composer Xdebug Handler is a PHP library that automatically restarts command-line interface (CLI) processes without loading the Xdebug extension, unless it's explicitly disabled. It solves the performance overhead of Xdebug during routine tasks like dependency management by transparently restarting processes in an Xdebug-free environment. Originally part of Composer, it is now a standalone tool for seamless integration into PHP CLI applications.

Target Audience

PHP developers working with command-line tools or scripts that need to avoid Xdebug's performance impact during non-debugging operations, such as running Composer, PHPUnit, or other CLI-based utilities. It is particularly useful for tool maintainers who want to ensure their applications run efficiently without requiring users to manually disable Xdebug.

Value Proposition

Developers choose this library because it automatically handles the restart process transparently, eliminating the need for manual configuration or user intervention. Its unique selling point is the ability to keep Xdebug available for debugging while avoiding its slowdown in everyday CLI tasks, with extensible design for custom restart logic and support for persistent settings across sub-processes.

Overview

Restart a CLI process without loading the xdebug extension.

Use Cases

Best For

  • Automatically disabling Xdebug in PHP CLI tools like Composer to speed up dependency installation and updates.
  • Building PHP command-line applications that need to run efficiently without Xdebug overhead during normal operation.
  • Managing PHP sub-processes in scripts where Xdebug should be excluded to maintain performance.
  • Extending restart logic for custom ini file modifications, such as adjusting settings like phar.readonly.
  • Integrating Xdebug handling into development workflows where debugging is needed intermittently but performance is critical for routine tasks.
  • Providing seamless Xdebug-free environments in CI/CD pipelines for faster build and test execution.

Not Ideal For

  • Web applications requiring Xdebug management in HTTP request contexts, as it's designed solely for CLI processes.
  • Projects where Xdebug must remain loaded at all times for continuous debugging, making automatic restarts counterproductive.
  • Environments with strict security policies that restrict process spawning or modification of ini files.
  • Development setups using alternative debuggers like Zend Debugger or DBG, since it only targets Xdebug.

Pros & Cons

Pros

Automatic Performance Optimization

Transparently restarts CLI processes without Xdebug to avoid slowdowns, using environment variables like MYAPP_ALLOW_XDEBUG for control, as shown in the Basic Usage section.

Extensible Restart Logic

Offers protected methods like requiresRestart() and restart() for custom modifications, such as adjusting ini settings like phar.readonly, demonstrated in the Extending the library example.

Comprehensive Helper Methods

Provides static utilities like getAllIniFiles() and getRestartSettings() to access original configurations in restarted processes, detailed in the Helper methods section.

Robust Signal Handling

Includes built-in support for asynchronous signals (e.g., SIGINT) and Windows control events, ensuring clean process management as described in the Signal handling subsection.

Cons

Command-Line Extension Limitations

Extensions specified via command-line arguments are not loaded in restarted processes, a admitted limitation in the README that can break tools relying on them.

Advanced Configuration Complexity

Extending the library for custom logic requires overriding protected methods and careful parent calls, increasing development overhead compared to simpler solutions.

Restart Failure Risks

Restarts can fail if temporary ini files cannot be created, necessitating troubleshooting with XDEBUG_HANDLER_DEBUG, as shown in the logging examples, which adds uncertainty.

Frequently Asked Questions

Quick Stats

Stars2,566
Forks33
Contributors0
Open Issues0
Last commit22 days ago
CreatedSince 2017

Tags

#composer#performance-optimization#xdebug#restart#php#development-tools#debugging#cli-tools#process-management#performance

Built With

P
PHP

Included in

Composer904
Auto-fetched 4 hours ago

Related Projects

OctoLinker Browser ExtensionOctoLinker Browser Extension

OctoLinker — Links together, what belongs together

Stars5,385
Forks284
Last commit2 years ago
Composer-UnusedComposer-Unused

Show unused composer dependencies by scanning your code

Stars1,684
Forks57
Last commit2 months ago
StudioStudio

A workbench for developing Composer packages.

Stars1,137
Forks74
Last commit2 years ago
Composer-NormalizeComposer-Normalize

🎵 Provides a composer plugin for normalizing composer.json.

Stars1,116
Forks36
Last commit4 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub