-
Notifications
You must be signed in to change notification settings - Fork 204
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
Header File missing while installing in Mac Catalina 10.15.6 #1159
Comments
This appears to be a common problem (beyond any one extension) due to filesystem changes in MacOS Catalina. The following pages may provide some solutions (and both link off to duplicate issues reported against other PHP extensions):
Alternatively, you can opt to install a newer version of PHP with Homebrew and then install the extension using the |
I have already seen these posts. |
If you feel this is a problem with the extension installer, the appropriate place to report that issue would be through bugs.php.net and list "PECL" as the "affected package". I'm not sure that going that route will reach a positive outcome, though. Individual PHP extensions (e.g. this driver, Xdebug, and other PECL packages) are not in a position to address this issue as there is no "installer" within the package to speak of (apart from a Makefile). The root cause of this issue is Apple removing a standard include path for its bundled version of PHP's headers. The apparent solution to that requires modifying the Reading a bit further, the corresponding blog post from the Stack Overflow author suggests that this approach might still pose a problem. They refer to Xdebug in the blog post, but this point likely applies to any extension compiled as an
Their conclusion points to using Homebrew (or an equivalent approach) to get a separate version of PHP installed.
According to this r/php thread, Apple has actually started deprecating its bundled interpreters (e.g. PHP, Python, Ruby) and has plans to remove them in future OS versions. I expect the reasons for doing so may overlap with other changes Apple has made re: include paths and restricting the loading of non-system binaries (as a security measure). I do not use MacOS, but most developers I've spoken with do advise using Homebrew to provision a reliable and up-to-date PHP environment on MacOS. I'm afraid I can't provide any more assistance here beyond directing you to the external resources above. |
Thanks a lot for the detail explanation. It helped me a lot to understand the problem. |
While there are multiple versions of php on the system, the important part is which one is being loaded through the path. Running
This makes sure that any binaries installed using homebrew take precedence over the system-provided ones. |
To add on to what @alcaeus mentioned above, you'll also want to make sure the correct version of |
I have installed PHP with Homebrew. Then I have updated my apache httpd |
Double-check that the
I assume you followed the instructions on https://formulae.brew.sh/formula/php (between the package dependencies and analytics) for configuring Apache with PHP. That page mentions a command to display the path to the https://stackoverflow.com/a/60297362/162228 may provide additional guidance.
If you're using Homebrew, there should be absolutely no reason to interact with configuration files for the MacOS-bundled version of PHP. The two environments are entirely separate. I realize you were likely trying to explore all possible options, but it seemed important to point that out. |
Thanks @jmikola @alcaeus for initial guidance. My OS version: Catalina 10.15.7
|
Bug Report
running: phpize
grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Environment
MacOS Catalina v-10.15.6
PHP Version 7.3.11
Test Script
sudo pecl install mongodb
Expected and Actual Behavior
Driver not installed.
error:
Debug Log
Probable Root Cause:
Apple has deprecated having a /usr/include distinct from the SDK
The text was updated successfully, but these errors were encountered: