Installing PHP PEAR and PECL extensions on MAMP for Mac OS X Update: Configure command work for me when I chose this option:./configure –without-iconv Otherwise I am getting the error: ‚zendconfig.h‘ file not found —- Original article MAMP is an easy to install set of tools for that provides a great local development environment for. Mar 06, 2014 Fortunately, OS X ships with PECL and PEAR, although they are not enabled by default. Rather, Apple has provided a PHAR file for setting it all up. Issue the below commands in a Terminal window. Cd /usr/lib/php sudo php install-pear-nozlib.phar. Now we need to add PEAR to the include path and specify the directory where extensions should be installed. Installing PHP and PECL Extensions on MacOS. Wed, Apr 3, 2019 9:47 PM. 0 Install PHP with Homebrew brew install php Fixing broken directories.
Just run e.g.: /Applications/MAMP/bin/php/php7.1.1/bin/pecl install mongo. Assuming thats the full path to the pecl command part of your MAMP installation. You might need to replace /php7.1.1/ with your current and active MAMP php version. This is because the wrong PECL is compiling the script (a PECL for a different version of PHP). This has caught be out before and hopefully it won't catch you now! I have come across times when sudo is needed when installing PECL extensions. You should have PEAR already set up if you followed through the previous section.
I’ve been running WordPress on MAMP for a couple of years now, but I encountered some issues when I needed to work with Laravel on my local. A basic Laravel setup is fine on MAMP, but my particular project dealt with foreign currencies, which required the International Extension for PHP, INTL for short. Here are the steps for enabling INTL for MAMP on OSX.
Caterpillar 330cl parts manual. Note that at the time of installation, I was running OSX 10.9.2, and version 3.0.5 of MAMP with PHP 5.5.10. This also assumes that your $PATH variable is set to MAMP’s PHP.
1. Download ICU libraries and install to root
2. Install autoconf
Or if you have Brew installed…
Installing Php Pear And Pecl Extensions On Mamp For Mac Windows 10
3. Create a symbolic link between MAMP and the directory containing your XCode php development headers.
Without this, I encountered some odd errors with incorrect paths in MAMP: “fatal error: ‘php.h’ file not found”
4. Install the PHP INTL extension with PECL
5. Add extension=intl.so
under the listed extensions in the PHP.ini file
If you’re using MAMP Pro, this is as easy as going to File -> Edit Template -> PHP -> PHP 5.5.10 php.ini. Otherwise, you will find this in Applications/MAMP/bin/php/php5.5.10/conf/php.ini
6. Restart MAMP and Terminal
That’s it, your changes should now be reflected. Hopefully this helps someone else out there!
Special thanks to the following for helping me figure out the steps above:
Angry samoans unboxed set zip. I’m working on a project with a number of developers over Git and the existing codebase uses PECL YAML PHP extension (v1.0.1).
I have tried a number of steps to install the PECL YAML extension on my MAMP server and to no joy!
I am assuming the other developers are on Linux.
![For For](https://i.pinimg.com/736x/33/e0/47/33e04704db8a643fb75973510ecc83cc--the-top-for-the.jpg)
First couple of attempts at install revealed this error in my php_error_log:
“[16-Jul-2011 11:29:13] PHP Warning: PHP Startup: Unable to load dynamic library ‘/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/yaml.so’ – dlopen(/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/yaml.so, 9): no suitable image found. Did find:
/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/yaml.so: mach-o, but wrong architecture in Unknown on line 0”
/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/yaml.so: mach-o, but wrong architecture in Unknown on line 0”
After a large amount of time googling I realised that I wasn’t alone and it’s because my extension that I compiled using “./pecl i yaml” was a 64 bit version
“file yaml.so”:
yaml.so: Mach-O 64-bit bundle x86_64
yaml.so: Mach-O 64-bit bundle x86_64
However, comparing this to working extensions on my MAMP setup i.e. “file xdebug.so”:
xdebug.so: Mach-O universal binary with 2 architectures
xdebug.so (for architecture ppc): Mach-O bundle ppc
xdebug.so (for architecture i386): Mach-O bundle i386
xdebug.so (for architecture ppc): Mach-O bundle ppc
xdebug.so (for architecture i386): Mach-O bundle i386
So I discovered a number of blogs that helped me to identify the exact problem.
Can’t run 64 bit extensions on 32 bit MAMP server – makes sense.
My install process is:
- download PECL YAML source
- extract tar and cd into module source
- phpize inside module directory
- run .configure using a command from blogs:“CFLAGS=’-O3 -fno-common -arch i386 -arch x86_64 -g -Os’ LDFLAGS=’-O3 -arch i386 -arch x86_64′ CXXFLAGS=’-O3 -fno-common -arch i386 -arch x86_64 -g -Os’ ./configure –-disable-dependancy-tracking –-disable-shared -enable-static”
- make
- copy created module from modules/yaml.so to MAMP:“sudo cp modules/yaml.so /Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/.”
The above solution seems to have worked for everyone but me.
My error log now reports this:
[16-Jul-2011 11:09:25] PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) ‘yaml.so’ in Unknown on line 0
I’ve spent a good couple of hours on this now and need your help.
All I’m actually trying to do is parse YAML in PHP.
I have 2 options:
Installing Php Pear And Pecl Extensions On Mamp For Mac Torrent
- Fix it and breath a sign of relief
- Use a PHP YAML parsing class instead and avoid this extension in the future
The issue with option 2 is that the codebase will change due to my inability to install an extension.
Any advice or a solution would be greatly appreciated.
Cheers
How to&Answers:
If you have Homebrew installed then you can do:
Otherwise install the latest libyaml.
You can build for both 32 & 64 bit Intel by setting
CFFLAGS
and LDFLAGS
to -arch i386 -arch x86_64
.Then, install PEAR/PECL (you can also follow the instructions here)
By default it’ll install in
~/pear/
directory. Now runThen, take care of the so file.
This nice article will demonstrate how you can install MAMP stack manually.
Answer:
Well, it’s not a real solution to your problem. But if you only want to parse YAML I would suggest to use the Symfony YAML class, it’s a great easy to use class for parsing YAML. Speed is okay and error messages are quite clear.
Yes, it will change the codebase, but that isn’t a bad thing. I think it’s a plus when you can avoid using a PECL extension like this, because of the issues you now experience and if you ever need to switch to another servers you will be glad you don’t have to check/install 25 PECL extensions (and their correct versions).
So my suggestion, switch to a YAML class. It will make life easier! ?
Answer:
Installing Php Pear And Pecl Extensions On Mamp For Mac Pro
Not all C code is portable. It’s possible that the pecl extension has portability issues as it was probably intended to be run on linux.
If you’re feeling bold, you could find out what the error is, fix it and submit the fix to the extension authors.
If not, then using a pure PHP solution might be the way to go.
Also, if you just run the code on your Mac as a dev environment, then you may not require it to work if: 1) production is linux or 2) the feature is not core to the functionality
However, in my experience, I find it’s best to have your dev environments the same operating system and distro as your production box. I’d use VirtualBox to run linux in a VM, then map the files over SAMBA or NFS.
Hope that helps…
Answer:
Installing Php Pear And Pecl Extensions On Mamp For Mac Os
Based on success overcoming issues surrounding MAMP and other .so modules: [Same type of error]
Step 1: Make sure your version of MAMP is Version 2 because it includes a Universal Binary installer (32-bit & 64-bit)
Step 2: Modify your Make file and eliminate the other compiler versions, similar to:
Tags: phpphp