Apparently the Homebrew Package Manager decided to nuke support for PHP extensions. Regardless of my opinions or feelings about this decision, it’s necessary to figure out a way to get PHP and its extensions to work again WITHOUT USING MACPORTS. I have some standards. Show The good news is that you can still install a base PHP 7.1 via Homebrew: #Uninstall the old Homebrew PHP 7.1 Next, you’ll want to make sure your Mac is using this php homebrew version: echo 'export PATH="/usr/local/opt//bin:$PATH"' >> ~/.zshrc
Make sure to use the appropriate .rc file: zshrc for z-shell, bashrc for bash, etc. I am obviously using z-shell. Now if you run /usr/local/opt//bin/php Good. Now we have a shiny new PHP 7.1 with pecl available. Next is to start installing extensions. I need to install the PHP memcache extension. Whereas I used to do pecl install memcached Cool! I should be able to start up my PHP server and have the memcache extension available, right? It might work for you, which is awesome. Sadly, I was met with: [exec] Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar//7.1.16_1/lib/php/20160303/memcached.so' - dlopen(/usr/local/Cellar//7.1.16_1/lib/php/20160303/memcached.so, 9): image not found in Unknown on line 0 Balls. What is happening? After some digging, I learned that even though I uninstalled homebrew’s old php71 and replaced it with (the post-nuke version), that didn’t remove the old brew uninstall And there we go. It finally works again on my machine. So if your approach to PHP 7.1 on Mac like “Homebrew for base PHP, pecl for all my extensions” you should be good to go, as long as you remove remnants of the previous Homebrew PHP 7.1. This is probably the way it always should have worked. And the Homebrew team is right. But doesn’t it feel so much better to whine and kick and scream about a change, even if it’s for the better? DISCLAIMER: I have no idea if this is the best way to do this. But it works on my machine. And that’s all I really care about. Asked 9 years, 5 months ago Viewed 6k times
I need to install php-xml. I am using OS X. Cant find out how to install this extension.
hakre 187k48 gold badges419 silver badges802 bronze badges asked Apr 8, 2013 at 10:52
0 Are you sure, you're doing it right? the dom extensions usually is compiled by default. It looks like you run into namespacing issues. Try
instead of just DomDocument() and it should hopefully run. answered Apr 8, 2013 at 11:08
3 Submit a Pull Request Report a Bug Table of Contents
This section contains notes and hints specific to installing PHP on macOS. PHP is bundled with macOS since macOS X (10.0.0) prior to macOS Monterey (12.0.0). Compiling is similar to the Unix installation guide. +add a note User Contributed NotesThere are no user contributed notes for this page. Can you install PHP on Mac?PHP is bundled with macOS since macOS X (10.0. 0) prior to macOS Monterey (12.0. 0). Compiling is similar to the Unix installation guide.
How do I enable PHP extensions on Mac?HowTo: Installing ffmpeg-php extension for MAMP (Mac). First of all point your php and phpize to your MAMP environment. ... . Install ffmpeg (required by PHP ffmpeg.so extension) ... . Install ImageMagick (required by PHP ffmpeg.so extension) ... . If you want to install Imagick manually. ... . Configure your php.ini. ... . Restart your Apache.. How do I know if PHPYou can use the command line switch -m to php to see what modules are installed. $ php -m | head [PHP Modules] bz2 calendar ctype curl date dbase dom exif fileinfo ... You could also use php -i to get phpinfo(); output via the command line which would include this info as well.
Where is PHP installed Mac?Set the php. ini location or use the default A typical default location on macOS is /usr/local/php/php.
|