Trying to get php/imagick working on my mac running OS 10.15.3 (Catalina) using brew.
I installed Php (7.4.3)
I installed imagemagic ( 7.0.9-23)
Then when I pecl install imagick
I get:
545 $ pecl install imagick
downloading imagick-3.4.4.tgz ...
Starting to download imagick-3.4.4.tgz (253,434 bytes)
.....................................................done: 253,434 bytes
ERROR: failed to write /usr/local/pear/docs/imagick/examples/.tmppolygon.php:
copy(/usr/local/pear/docs/imagick/examples/.tmppolygon.php): failed to open stream: Permission denied
The folder exists and is empty and has permissions
drwxrwxr-x 6 root admin 192B Aug 29 08:46 /usr/local/pear/docs/imagick/examples
Frustrating that the installation fails because an example file won't load. The message sounds like it can't read the source but I'm not sure. Anyone have any ideas?
Got it to work by running sudo pecl install instead of just pecl. That got partway, and then encountered missing readline lib which produced a error message about version number. That is fixed by brew upgrade awk. Looks like it all succeeded.
Related
I installed homebrew 3.0.0 on my M1 MBA.
However, every session including iterm2 terminal and tmux shows this error message:
/Users/jinrae/.zprofile:1: no such file or directory: opt/homebrew/bin/brew
In my case, it does not harm functionality at least in my usage pattern.
Anyhow, how can I get rid of this message?
I got this error because I installed brew on the Rosetta version of terminal to install packages, that are not yet M1 compatible.
To get rid of this message i opened my .zprofile with nano .zprofile.
The first line was
eval "$(/opt/homebrew/bin/brew shellenv)"
And i simply put a # before this line to comment it out and the message was gone.
To #sedavidw, /opt/homebrew/bin contains .keepme without contents:
/Users/jinrae/.zprofile:1: no such file or directory: opt/homebrew/bin/brew
➜ bin pwd
/opt/homebrew/bin
➜ bin la
total 0
-rw-r--r-- 1 jinrae admin 0B Feb 9 11:04 .keepme
EDIT: I read an article saying that homebrew is installed in /opt/homebrew/bin in M1 Mac whereas it is installed in /usr/local in Intel Mac. I'm trying to reinstall homebrew for M1 Mac now.
EDIT2: I solved the problem. It was due to for what homebrew is installed. As I heard, homebrew is installed in /usr/local for Intel Mac and /opt/homebrew/bin for M1 Mac.
I reinstalled homebrew with
/bin/bash -c "$(curl -fsSL https://gist.githubusercontent.com/nrubin29/bea5aa83e8dfa91370fe83b62dad6dfa/raw/48f48f7fef21abb308e129a80b3214c2538fc611/homebrew_m1.sh)"
which is slightly different from that in the official site (at least to me).
Anyhow, newly installed homebrew is located in /opt/homebrew/bin and the problem has been solved.
If you are using an Intel Mac, as mentioned above, Homebrew gets installed on /usr/local. Therefore, modify your .zprofile file (located in users/<username>) to use the correct path. Here is content of .zprofile:
eval "$(/usr/local/Homebrew/bin/brew shellenv)"
I have the M1 Mac and it was installed in /opt/homebrew/...
I opened /Users/~username~/.zprofile and it had two lines.
First line was:
eval "$opt/homebrew/bin/brew shellenv"
Second like was:
eval "$(/opt/homebrew/bin/brew shellenv)"
I just commented out the first line which doesn't actually have the </opt/> in the address. It's asking for a $opt, and then the address. So commenting out that line removed the location error and just read the correct line. So it doesn't show the error anymore when opening the terminal.
To Fix Type
nano .zprofile
then delete all of the stuff
then do ⌃X
then press return
I would like to run a GMT file wrote in tcsh environment. When I'm running it, I have the following error message :
dyld: Library not loaded: /opt/local/lib/libhdf5.100.dylib
Referenced from: /opt/local/lib/gmt4/bin/gmtset
Reason: image not found
I went to /opt/local/lib path, and indeed, libhdf5.103.dylib is installing, and not libhdf5.100.dylib. I did not find a way to reinstall libhdf5.100.dylib using port or brew.
The later doesn't work :
sudo port install libhdf5-100
sudo port install libhdf5.100
sudo port install libhdf5.100.dylib
I already try:
brew reinstall osgeo-gdal --build-from-source
But, this doesn't work. I have the following issue:
Warning: You are using macOS 10.11.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience while you are running this old version.
qt: macOS Sierra or newer is required.
Error: An unsatisfied requirement failed this build.
Do you have any ideas?
Thank you.
Looks like gdal needs to be rebuilt with the current hdf5. You can try:
sudo port uninstall gdal && sudo port install -s gdal
This will build gdal from source and link against the installed HDF5 library.
I'm on OSX High Sierra and trying to install php56-imagick via brew install php56-imagick. This results in:
Error: No available formula with the name "php56-imagick"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
I tried this as read on the internet brew tap Homebrew/homebrew-php but it returns: Error: homebrew/php was deprecated. This tap is now empty as all its formulae were migrated..
Where can I find the formula to install this package?
Thanks,
Kim
php56-imagick and other PHP extensions used to be available in the Homebrew/php tap, but they have been deprecated. The standard way to install PHP extension is to use pecl, for example:
pecl install imagick
Installing Extensions for Specific Version of PHP
The formula php56-imagick assumes you need the extension for PHP 5.6. Add PHP 5.6's installation directory into your PATH so that you are using the correct version of pecl.
$ PATH=/usr/local/opt/php#5.6/bin:/usr/local/opt/php#5.6/sbin:$PATH pecl install imagick
downloading imagick-3.4.3.tgz ...
Starting to download imagick-3.4.3.tgz (245,410 bytes)
...................................................done: 245,410 bytes
19 source files, building
running: phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
...
...
...
Build process completed successfully
Installing '/usr/local/Cellar/php#5.6/5.6.35_1/include/php/ext/imagick/php_imagick_shared.h'
Installing '/usr/local/Cellar/php#5.6/5.6.35_1/pecl/20131226/imagick.so'
install ok: channel://pecl.php.net/imagick-3.4.3
Extension imagick enabled in php.ini
Extension Installation Error
During my extension installation process, I encountered this error
ERROR: failed to mkdir /usr/local/Cellar/php#7.1/7.1.16_1/pecl/20160303
Which is due to the missing /usr/local/lib/php/pecl directory. This might be because I have been using PHP 5.x before the release of PHP 7, hence the newer installation does not create the directory. In any case, creating the directory solved this problem
mkdir /usr/local/lib/php/pecl
Compiled Extension Directory
Note that every version of PHP (installed via Homebrew) is located at /usr/local/lib/php/pecl
$ ls -ld /usr/local/Cellar/php#5.6/5.6.35_1/pecl
lrwxr-xr-x 1 hanxue admin 23 Apr 25 2018 /usr/local/Cellar/php#5.6/5.6.35_1/pecl -> /usr/local/lib/php/pecl
Each PHP version will have their own extension directory
$ ls /usr/local/lib/php/pecl/20131226/
imagick.so
php.ini Extension Configuration
pecl helpfully add the line
extension="imagick.so"
to the top of php.ini, but `extension_dir is unset. Set it to the correct value
extension_dir = "/usr/local/lib/php/pecl/20131226"
Finally, remember to reload or restart your web server!
Trying to install imagemagick ( to be used w PaperClip gem) on my mac ( Yosemite 10.10.5) raising error with 'libtool' what happen with it ?
$ brew update
$ brew install imagemagick
==> Installing dependencies for imagemagick: libtool, jpeg, libpng, libti
==> Installing imagemagick dependency: libtool
==> Downloading https://homebrew.bintray.com/bottles/libtool-2.4.6.yosemite.bott
curl: (4) A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision.
Error: Failed to download resource "libtool"
Download failed: https://homebrew.bintray.com/bottles/libtool-2.4.6.yosemite.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading http://ftpmirror.gnu.org/libtool/libtool-2.4.6.tar.xz
curl: (4) A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision.
Trying a mirror...
==> Downloading https://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.xz
curl: (4) A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision.
Error: Failed to download resource "libtool"
Download failed: https://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.xz
Had the same error and https://github.com/Homebrew/homebrew/issues/43154 fixed it for me. You will need to remove SSL_CERT_DIR variable from .bash_profile or .bashrc and you might also need to run unset SSL_CERT_DIR
In my case, the homebrew-directory (~/Library/Caches/Homebrew) had root as owner. So executing
sudo chown -R {myUserName}:staff Homebrew
fixed this issue and Homebrew worked again as expected.
When running imagemagick under MAMP I get the error message:
command output :"dyld: Library not loaded: /opt/local/lib/libfreetype.6.dylib
Referenced from: /Applications/MAMP/bin/ImageMagick/ImageMagick-6.7.9/bin/convert
Reason: Incompatible library version: convert requires version 16.0.0 or later, but libfreetype.6.dylib provides version 15.0.0"
I have searched everywhere I can think of but can't find a solution to this. One posting I saw suggested commenting out the DYLD_LIBRARY_PATH in envvars but this did not make any difference.
Figured it out. I ran:
$ locate libfreetype.6.dylib
and discovered that there are multiple version of that dylib including a version in /opt/local/lib where macports installs imagemagick. I copied that version to the location in MAMP where it was installed and it solved the issue.
$ cp /opt/local/lib/libfreetype.6.dylib /Applications/MAMP/Library/lib/
Make sure you make a backup of the MAMP version before copying over it just in case something goes wrong.
I had the same issue. For me works this:
sudo port selfupdate
sudo port install ImageMagick
sudo pecl update-channels
sudo pecl install imagick
Then I run
find . -name "imagick.so"
and use the given path in MAMP php.ini.
In the end I commented out the DYLD_LIBRARY_PATH lines in /Applications/MAMP/Library/bin/envvars