Bug #78900 [Fbk->Csd]: Won't install anymore to /user/includes/php, needs to install to /usr/local/php
| From: | bugs dot php dot net at mammals dot se | Date: | Mon, 09 Dec 2019 11:04:59 +0000 |
| Subject: | Bug #78900 [Fbk->Csd]: Won't install anymore to /user/includes/php, needs to install to /usr/local/php | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-224166@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78900&edit=1
ID: 78900
User updated by: bugs dot php dot net at mammals dot se
Reported by: bugs dot php dot net at mammals dot se
Summary: Won't install anymore to /user/includes/php, needs
to install to /usr/local/php
-Status: Feedback
+Status: Closed
Type: Bug
Package: *Directory/Filesystem functions
Operating System: Mac OS 10.13.6
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[2019-12-03 10:43:55] 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-03 10:09:40] 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?
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78900&edit=1