php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78900 Won't install anymore to /user/includes/php, needs to install to /usr/local/php
Submitted: 2019-12-03 10:09 UTC Modified: 2019-12-09 11:04 UTC
From: bugs dot php dot net at mammals dot se Assigned:
Status: Closed Package: *Directory/Filesystem functions
PHP Version: Irrelevant OS: Mac OS 10.13.6
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bugs dot php dot net at mammals dot se
New email:
PHP Version: OS:

 

 [2019-12-03 10:09 UTC] bugs dot php dot net at mammals dot se
Description:
------------
Apple has decided to protect a lot of directories in Mac OS, starting with version 10.13.X so even superusers (sudo command) and/or root can't touch a lot of directories. This means everything must be installed in those directories that a regular user or a sudo user has access to. I.e /user/local, not /usr/inclides/php/ext/ 

Se here: About System Integrity Protection on your Mac

OS X El Capitan and later includes security technology that helps protect your Mac from malicious software.

https://support.apple.com/en-gb/HT204899


The build process for imagick starts like this:

sudo pecl install imagick
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading imagick-3.4.4.tgz ...


And ends like this:

Build process completed successfully
Installing '/usr/include/php/ext/imagick/php_imagick_shared.h'
ERROR: failed to mkdir /usr/include/php/ext/imagick

Because /usr/includes is not somehting an installer/root/sudo has access to write to anymore. There is no way to for instance chown on thoose folder, create a folder elsewhere and copy it to that folder etc. Because of the protection. 

One could turn SIPS off, https://www.howtogeek.com/230424/how-to-disable-system-integrity-protection-on-a-mac-and-why-you-shouldnt/ but a way better solution is to get the installer of Imagick to install in the correct place, /usr/local where PHP already resides?




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-12-03 10:43 UTC] derick@php.net
-Status: Open +Status: Feedback
 [2019-12-03 10:43 UTC] derick@php.net
If you say that php already is in /usr/local/php, then there should be a "pecl" executable in that directory too. Are you sure you're using that one for installing the extension?

If you are then it is possible that the pecl tool has picked up an old configuration (~/.pearrc) which still thinks the extensions should live in another path. You can use "pecl config-show" to tell you where it thinks extensions should be installed too (ext_dir).
 [2019-12-09 11:04 UTC] bugs dot php dot net at mammals dot se
-Status: Feedback +Status: Closed
 [2019-12-09 11:04 UTC] bugs dot php dot net at mammals dot se
Thank you very much Derick!

Yes, the pecl (and pear) are here: /usr/local/php5/bin/pecl

Yes, I had an old version of .pearrc in my home folder. Renamed it and a new one was created with this contents:

> #PEAR_Config 0.9
> a:1:{s:10:"__channels";a:3:{s:12:"pecl.php.net";a:0:{}s:5:"__uri";a:0:
> {}s:11:"doc.php.net";a:0:{}}}

Tried again and added the path to the "other" pecl in the install command, like this: 

> $ sudo /usr/local/php5/bin/pecl install imagick

Then the install process ends with this instead:

> Build process completed successfully
> Installing '/usr/local/php5/include/php/ext/imagick/php_imagick_shared.h'
> Installing '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718/imagick.so'
> install ok: channel://pecl.php.net/imagick-3.4.4
> configuration option "php_ini" is not set to php.ini location
> You should add "extension=imagick.so" to php.ini

That did the trick. Now php-info command shows that Imagick is installed.

Might be interesting:
----------------------------

Using the command pecl config-show it gives this reply to some things:

> PEAR configuration file        cfg_dir          /Users/taz_1999/pear/cfg

That is an empty folder, no hidden files either.

And this:

> PHP extension directory        ext_dir          /usr/lib/php/extensions/no-debug-non-zts-20160303

That is, it is pointing to the wrong directory (it should read php5, otherwise ok).

> User Configuration File        Filename         /Users/(My username)/.pearrc
> System Configuration File      Filename         /private/etc/pear.conf


Using the complete path to the pecl-file, like this: /usr/local/php5/bin/pecl config-show

I get this instead: 

> PEAR configuration file        cfg_dir          /usr/local/php5/lib/php/cfg

That folder (/cfg) does not exist.

> PHP extension directory        ext_dir          /usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718

This is correct.

> User Configuration File        Filename         /Users/(my username)/.pearrc
> System Configuration File      Filename         /usr/local/php5/etc/pear.conf

This file, pear.conf, contains correct info and uses this path for most things /usr/local/php5.


Thanks again! Appreciate it! 

Ola Andersson
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 03:01:29 2024 UTC