-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Silent crash when initializing a PDO connection to PostgreSQL #174
Comments
Works for me:
pgsql 16 in a docker container, not homebrew |
Thanks @mfn |
@tristanjahier if you run tinker with the |
I get this output in gray:
and nothing else. If the PostgreSQL server is offline, I simply get a normal error when constructing the PDO instance:
|
if you disable process forking (i.e. add |
Turning this feature off makes things work again. 🙂👍🏻 Thank you a lot! I had no problem on my previous computer (with the same PsySH config). The PCNTL extension is enabled. What does it tell? Do I miss a library? |
you have reached a fork in the road. you can dig in, to figure out why it's failing, or you can take the win and walk away :P if it works with process forking off, and doesn't work with it on, it's probably not a missing library. in the past issues like this have been due to bugs in php extensions, linked libraries, or PHP bindings to libraries. the next step is probably to come up with the smallest piece of code that can reproduce it. i'd guess it's probably something like:
|
Thank you for your detailed answer @bobthecow! Unfortunately, I think that playing with process forks is a bit out of my skill set. :( However, if I ever come to spend time on this problem again, I will open an issue or a PR on PsySH's repository. |
Tinker Version
2.9.0
Laravel Version
10.48.9
PHP Version
8.3.7
Database Driver & Version
PostgreSQL 16 for macOS 14 (homebrew)
Description
I am having troubles since months when trying to access my PostgreSQL database from
tinker
(Laravel). The interactive shell crashes silently (no standard output, exit status code is 0) when I run this code:I also tried the same code with PHP's native interactive shell,
php -a
, and it runs fine.When working with a MySQL database, it is fine.
MacOS Sonoma 14.4.1
PHP 8.3.*
PostgreSQL 16
I am lost as I do not know how to debug this without any error output. :/
Steps To Reproduce
Start
php artisan tinker
and run this code with a correctly set up PostgreSQL database and valid credentials:The text was updated successfully, but these errors were encountered: