Skip to content
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

Relies on system php (/usr/bin/php) which is removed in macOS Monterey #1

Open
molomby opened this issue Mar 2, 2022 · 0 comments
Open

Comments

@molomby
Copy link

molomby commented Mar 2, 2022

This script uses the standard php shebang, #!/usr/bin/php, but macOS Monterey removes PHP, taking /usr/bin/php with it. This causes bcrypt-hash to fail with the error:

/usr/local/bin/bcrypt-hash: bad interpreter: /usr/bin/php: no such file or directory

I've tried working around it by installing php via brew (brew install php) but this puts it at /usr/local/bin/php so doesn't resolve the error. Further, Apple's system integrity protection prevents changes to the /usr/bin dir so I can't easily fix this with a symlink. Eg. ln -s /usr/local/bin/php /usr/bin/php returns the error:

ln: /usr/bin/php: Operation not permitted

SIP can be turned off but it's generally not recommended.

By manually editing /usr/local/bin/bcrypt-hash and updating the shebang to the correct path (ie. #!/usr/local/bin/php) I have been able to get the script to run. However the php version installed by brew is currently 8.1.3, miles ahead of the version that came previously with macOS (7.3.24 I think?), resulting in a bunch of depreciation warnings:

Deprecated: preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated
Deprecated: Return type of Docopt\Response::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable
Deprecated: Return type of Docopt\Response::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool
Deprecated: Return type of Docopt\Response::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed
Deprecated: Return type of Docopt\Response::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void
Deprecated: Return type of Docopt\Response::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant