DEV Community

Recca Tsai
Recca Tsai

Posted on Originally published at recca0120.github.io

Fix macOS PHP NSCFConstantString Fork Error with One Env Var

Originally published at recca0120.github.io

When using Guzzle Client in artisan tinker, macOS throws objc[86150]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. This is caused by the Objective-C runtime's safety check during fork.

Disable the Fork Safety Check

Set an environment variable to skip the check:

export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
Enter fullscreen mode Exit fullscreen mode

Add it to ~/.bashrc or ~/.zshrc so you don't have to set it manually every time.

Top comments (0)