Skip to content

Troubleshooting

Justin Hileman edited this page Dec 15, 2025 · 11 revisions

πŸ› Troubleshooting

Forking

When possible, PsySH uses forking extensively to recover from fatal runtime errors. This requires the PCNTL extension, which is usually available on most Linux and macOS flavors of PHP.

There have been reports of PHP modules that don't play well with forking. For example, cURL with PKCS #11 crypto and PCRE regex with JIT.

If you run into issues with these or other extensions, you can temporarily disable forking in PsySH via the 'usePcntl' => false configuration option, but you should also file a bug with the offending module to get it resolved.

The mysqli library can lose connections when forking (see #667). Disabling usePcntl should resolve any issues with the mysqli library.

There also seems to be a bit of weirdness with process resources across forks (for example, see #441). If you often use proc_open, disabling forking should make it work as expected.

Code reloading

PsySH supports πŸ”„ automatic code reloading with the right extensions installed. For PHP 8.0+, install uopz. For PHP 7.4 and earlier, install runkit or runkit7.

Without these extensions, you'll need to restart PsySH to pick up changes to existing code.

Debugging a web request

PsySH doesn't (yet?) support debugging Apache or Nginx requests. In order to debug a web request, you need to serve your app using the CLI SAPI built-in web server.

If you're feeling ambitious, open a pull request for providing a web debugging UI or a remote PsySH debugger πŸ™‚

PsySH unexpectedly quit

In Windows (MSYS2) PHP, it may be necessary to increase max_execution_time to prevent PsySH from exiting after 30 seconds (see this comment for more).

Unicode is gibberish on Windows

Yeah πŸ˜•

See #299 for some things to try.

Clone this wiki locally