php 7.3.8 zip extension missing From macOS 10.15 Catalina
Any idea where to find and install? It wasn’t installed during installation of macOS 10.15 Catalina.
Thanks in advance. David
You can make a difference in the Apple Support Community!
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
Any idea where to find and install? It wasn’t installed during installation of macOS 10.15 Catalina.
Thanks in advance. David
OK. Here is how you do this. The instructions haven’t changed, in principle, from what I posted in Setting up a local web server on macOS 10… - Apple Community. There, I just link to this site that describes the basic procedure. As you might expect, there are a few more complications than there were in 2011 with OS X Lion. Here is what you do:
CFLAGS="-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/php/main -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/php/Zend -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/php/TSRM -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/php" ./configure --with-zlib-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr --with-php-config=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/bin/php-config
(Don't worry about the colours, that's just the forums formatting.)
(Forum software is a beast. Scroll right.)
Easy, peasy!
OK. Here is how you do this. The instructions haven’t changed, in principle, from what I posted in Setting up a local web server on macOS 10… - Apple Community. There, I just link to this site that describes the basic procedure. As you might expect, there are a few more complications than there were in 2011 with OS X Lion. Here is what you do:
CFLAGS="-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/php/main -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/php/Zend -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/php/TSRM -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/php" ./configure --with-zlib-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr --with-php-config=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/bin/php-config
(Don't worry about the colours, that's just the forums formatting.)
(Forum software is a beast. Scroll right.)
Easy, peasy!
i have this same problem.
the directory /usr/ is read only this causes the error.
looking for a solution
https://stackoverflow.com/questions/58127168/php-7-3-8-zip-extension-on-macos-catalina-10-15
but it didn't work with me
Issue is the zip extension is not part of the native macOS 10.15 installation. Apache, MySQL and most PHP works just fine. Issue only occurs when the zip extension is required. The guide isn't helpful in this instance. I'd like to avoid installing a second version of PHP and then dealing with conflicts from having two installations.
Yes, I do need the php zip extension. I am using phpspreadsheet to create excel spreadsheets. That php add-on requires the zip extension in order to create xlsx files. The second installation would be a workaround for the missing extension in the php NOT installed as part of the macOS 10.15 Catalina installation.
There are several others who have this same issue and have so far been unsuccessful in adding just that extension.
This sounds like a PHP/phpspreadsheet issue and not an Apple issue. The process and requirements are detailed here: https://phpspreadsheet.readthedocs.io/en/latest/
I never used this but I don't think PHP Extensions is referring to .zip. I think it is referring to compiled libraries.
No it is not a PHP/phpspreadsheet issue. Phpspreadsheet requires the php extension. There is a PHP zip extension and it is part of native php binaries. It just isn't installed when installing Catalina. It should be.
I haven’t tried this, but you should be able to create an /etc/php.ini file (see the default version) and specify an extensions_dir. The default is “./“ so that might mean the location of the php file. I don’t know. You should be able to change it to something and install your own extensions in that location.
This almost got me working, but PHP throws an unsigned code error:
PHP Warning: PHP Startup: Unable to load dynamic library 'zip' (tried: /usr/local/lib/php/extensions/zip (dlopen(/usr/local/lib/php/extensions/zip, 0x0009): dlopen(): file not found: /usr/local/lib/php/extensions/zip), /usr/local/lib/php/extensions/zip.so (dlopen(/usr/local/lib/php/extensions/zip.so, 0x0009): code signature in (/usr/local/lib/php/extensions/zip.so) not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.)) in Unknown on line 0
In case it helps someone, here's the step-by-step I've used to this point:
https://superuser.com/questions/1499342/how-to-get-zip-extension-working-in-php-in-macos-10-15-1
If anyone has any suggestions for resolving the unsigned code issue, I'd appreciate hearing them. Note that in my case, Homebrew isn't really a good option; we're using some self-signed certificates, and I haven't been able to convince the Homebrew PHP install to accept them.
You are trying to run PHP on the command line. That’s a totally different environment. You might need to sign it there for all I know. I’ve already blown away my VM and I have no intention of re-building it. My instructions work and load the zip module when running PHP from Apache. If you need to sign the zip library, then sign it.
No offense intended. Just trying to flesh this information out a bit for folks that are trying to get PHP working on the command line (most of the discussions I've found about this problem are from people who, like me, are trying to use composer). Combining your instructions with those of a couple of other people seems to come very close to solving the issue, but not quite.
Another user suggested that running make install would sign the extension, even though it would fail to move it into the necessary location:
https://superuser.com/a/1492340/1109520
...but this doesn't appear to be the case. If signing is a simple matter that I can do myself, I'll look into that.
You will need a paid developer account to sign the library so that php will load it. This is not necessary if you are running it via apache. Running PHP and Apache on a Mac is possible for basic web development tasks. If you need more than that, you should be using Linux. You can build the entire stack on a Mac, but I would not recommend it.
Our entire department uses Macs as local development environments for building Drupal websites. We don't host the sites on the Macs (that happens on various AWS environments), but we run local copies of the sites for development purposes. Most of this is done within a *AMP stack (provided in a variety of ways -- Acquia Dev Desktop, MAMP, etc.) -- but some of the work is done using composer, and that requires command-line PHP. Up until 10.15, this hasn't been an issue.
We have the option, of course, of using Homebrew, but that introduces some other nuisances due to self-signed SSL certificates, so we try to avoid it. Still, that's the workaround we're using at present.
I've heard the zip extension will be restored to the system PHP install in 10.15.2, and then everything can go back to normal. Unfortunately, I've only heard this from a single source, so I don't really have any idea if it's true.
The only official word from Apple that I’ve heard is that all scripting languages are getting ripped out. I don’t know if that includes PHP or not.
I attempted to build all of PHP but lost interest when I started getting flashbacks from the good old days of trying to get libiconv to link.
I still wouldn’t recommend attempting that level of development work on a Mac. Maybe use Docker. It looks like you are going to have to build it all yourself anyway.
I had this as well this worked for me https://stackoverflow.com/a/58300437/1170430
You might try following this guide: Install Apache, MySQL, PHP on macOS Catalina 10.15
php 7.3.8 zip extension missing From macOS 10.15 Catalina