PHPackages                             spatie/global-ray - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. spatie/global-ray

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

spatie/global-ray
=================

Enable Ray in all PHP files on your system

1.2.4(3mo ago)21863.0k↓13.6%10[1 PRs](https://github.com/spatie/global-ray/pulls)1MITPHPPHP ^7.4|^8.0CI passing

Since Feb 23Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/spatie/global-ray)[ Packagist](https://packagist.org/packages/spatie/global-ray)[ Docs](https://github.com/spatie/global-ray)[ GitHub Sponsors](https://github.com/spatie)[ RSS](/packages/spatie-global-ray/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (33)Used By (1)

spatie/global-ray - Send debug output from all PHP files to Ray
===============================================================

[](#spatieglobal-ray---send-debug-output-from-all-php-files-to-ray)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1e6cedae58df24f8572ad2984ef525b055e6b39e851959d418caedc93d284c23/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f676c6f62616c2d7261792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/global-ray)[![Tests](https://github.com/spatie/global-ray/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/spatie/global-ray/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/fe888e806270e0f9280e5ba2334add5c6b046f3e819e35499445a2bbd016f6be/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f676c6f62616c2d7261792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/global-ray)

This package can be installed **globally** to send debug output from **any** PHP app to [Ray](https://myray.app), the desktop debugging app from [Spatie](https://spatie.be/).

[![](https://camo.githubusercontent.com/5eaec29492566f6161405237aec38fb4662abe14fe693fde5c20c0865fb65db2/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f676c6f62616c2d7261792e6a70673f743d31373639363130303835)](https://spatie.be/github-ad-click/global-ray)

Ray is a desktop debugging app that keeps the instant feedback you get from console.log() and dump() but lets you use the same debugging syntax across Laravel, PHP, JavaScript and more frameworks and languages.

- Send anything you want to Ray, including HTML, arrays, queries, and Markdown files.
- View and interact with output your AI sends to Ray using our MCP server.
- Measure performance and pause execution in PHP.
- Beautifully designed themes to match your style.

Download our free trial and send up to 20 messages each session. Enjoying Ray? Buy a license to unlock the app and get full access.

Support us
----------

[](#support-us)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

Installation
------------

[](#installation)

You can install the global Ray via composer:

```
composer global require spatie/global-ray
global-ray install
```

When running `global-ray install`, we'll add a line in your `php.ini` to automatically load the functions provided by this package.

Usage
-----

[](#usage)

You can use `ray()` with [all supported methods](https://myray.app/docs/php/vanilla-php/reference) in any PHP file.

The `rd()`, `dump()` and `dd()` functions will also be available in any PHP project or script.

Using framework specific functionality
--------------------------------------

[](#using-framework-specific-functionality)

Using Laravel, WordPress, Yii, or another supported PHP framework or CMS? [Install the dedicated integration](https://myray.app/docs/getting-started/integrations) for better integration and framework-specific features. If one of those packages is detected, it will be used instead of global-ray.

How to uninstall
----------------

[](#how-to-uninstall)

To uninstall you must first issue this command:

```
global-ray uninstall
```

This will remove the line in `php.ini` that automatically loads `ray()` and related functions.

After that, you can uninstall the package itself using

```
composer global remove spatie/global-ray
```

Troubleshooting
---------------

[](#troubleshooting)

If all your PHP scripts suddenly terminate very early with a strange error after you upgrade PHP or switch to a different version, the global-ray might be the cause.

As mentioned before, during install we slightly modify your `php.ini`. To manually uninstall global ray, remove the script named `global-ray-loader.php` in the `auto_prepend_file` directive in `php.ini`.

You find the location of your `php.ini` by executing this command:

```
php --ini
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Steve Bauman](https://github.com/stevebauman)
- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance81

Actively maintained with recent releases

Popularity49

Moderate usage in the ecosystem

Community24

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~53 days

Recently: every ~87 days

Total

28

Last Release

98d ago

Major Versions

0.12.0 → 1.0.02022-03-03

PHP version history (3 changes)0.0.1PHP ^8.0

0.0.2PHP ^7.3|^8.0

0.0.4PHP ^7.4|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![stevebauman](https://avatars.githubusercontent.com/u/6421846?v=4)](https://github.com/stevebauman "stevebauman (170 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (138 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (22 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (15 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (4 commits)")[![jklue](https://avatars.githubusercontent.com/u/5399943?v=4)](https://github.com/jklue "jklue (3 commits)")[![thecaliskan](https://avatars.githubusercontent.com/u/13554944?v=4)](https://github.com/thecaliskan "thecaliskan (3 commits)")[![riasvdv](https://avatars.githubusercontent.com/u/3626559?v=4)](https://github.com/riasvdv "riasvdv (2 commits)")[![wkhayrattee](https://avatars.githubusercontent.com/u/7369626?v=4)](https://github.com/wkhayrattee "wkhayrattee (2 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (2 commits)")[![yoeriboven](https://avatars.githubusercontent.com/u/4047804?v=4)](https://github.com/yoeriboven "yoeriboven (1 commits)")[![jeffreyvr](https://avatars.githubusercontent.com/u/9550079?v=4)](https://github.com/jeffreyvr "jeffreyvr (1 commits)")[![jimirobaer](https://avatars.githubusercontent.com/u/8984769?v=4)](https://github.com/jimirobaer "jimirobaer (1 commits)")[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (1 commits)")[![patinthehat](https://avatars.githubusercontent.com/u/5508707?v=4)](https://github.com/patinthehat "patinthehat (1 commits)")[![roelgonzalez](https://avatars.githubusercontent.com/u/13934159?v=4)](https://github.com/roelgonzalez "roelgonzalez (1 commits)")

---

Tags

debuggingphprayspatieraydebugdebugging

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/spatie-global-ray/health.svg)

```
[![Health](https://phpackages.com/badges/spatie-global-ray/health.svg)](https://phpackages.com/packages/spatie-global-ray)
```

###  Alternatives

[spatie/ray

Debug with Ray to fix problems faster

62242.5M758](/packages/spatie-ray)[spatie/laravel-web-tinker

Artisan Tinker in your browser

1.2k3.8M6](/packages/spatie-laravel-web-tinker)[spatie/wordpress-ray

Debug WordPress apps with ease

799.1k](/packages/spatie-wordpress-ray)[spatie/laravel-artisan-dd

Run dd from your commandline

16387.7k1](/packages/spatie-laravel-artisan-dd)[mmucklo/krumo

KRUMO - version 2.0 of print\_r(); and var\_dump(); (with new updates)

89168.0k6](/packages/mmucklo-krumo)[xrdebug/php

PHP client library for xrDebug

23920.3k2](/packages/xrdebug-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
