Install grpc extension on Mac OS Big Sur - macos

For 2 days now, I am trying to install grpc for php on my Mac mini server
Mac OS Big Sur 11.2.1
Built-in Apache
I have tried it on php 7.3 and 7.4 installed with homebrew
I have installed grpc pecl grpc install after a bunch of attempt I have finally compile and installed it with pecl.
extensions are placed in the good repertory. But I encounter signing issue.
php -m show grpc in the list but not php_info()
PHP Warning: PHP Startup: Unable to load dynamic library 'grpc.so' (tried: /usr/local/lib/php/pecl/20190902/grpc.so (dlopen(/usr/local/lib/php/pecl/20190902/grpc.so, 9): no suitable image found. Did find:\n\t/usr/local/lib/php/pecl/20190902/grpc.so: code signature in (/usr/local/lib/php/pecl/20190902/grpc.so) not valid for use in process using Library Validation: mapping process is a platform binary, but mapped file is not\n\t/usr/local/lib/php/pecl/20190902/grpc.so: stat() failed with errno=1), /usr/local/lib/php/pecl/20190902/grpc.so.so (dlopen(/usr/local/lib/php/pecl/20190902/grpc.so.so, 9): image not found)) in Unknown on line 0
I have disabled SIP. Still same issue.
I have codesigned the extension with my apple developper ID. codesign -f -s "Mac Developer: MY_DEV_ID" /usr/local/lib/php/pecl/20190902/grpc.so
same issue
I have xattr /usr/local/lib/php/pecl/20190902/grpc.so
then sudo xattr -d com.apple.quarantine /usr/local/lib/php/pecl/20190902/grpc.so
I also tried with gatekeeper disabled.
And still the same problem. Is there someone that sucssefully installed grpc on the Mac with Big Sur, who would have an idea on what is going wrong ?

I experienced the same thing, I have tried several times to install it and I just solved the problem.
In my case when running
sudo pecl grpc install
there was an error in the installation process with error information like
ERROR: failed to mkdir /usr/local/Cellar/php#7.4/7.4.15/pecl/20190902
see in the picture:
running pecl grpc install
The problem is that the installation process can't create a new directory for /usr/local/Cellar/php#7.4/7.4.15/pecl/20190902, so I tried to create that directory first by running the command:
mkdir /usr/local/Cellar/php#7.4/7.4.15/pecl/
Then run the installation process again and and it worked!

1. See Cellar/php/... directory:
for me:
for you:
ls -la /usr/local/Cellar/php/YOUR_PHP_VERSION/
2. See the directory "pecl" which is a link:
3. Check the link:
ls -la /usr/local/lib/php/pecl
if:
No such file or directory
execute:
mkdir -p /usr/local/lib/php/pecl
sudo chmod 777 /usr/local/lib/php/pecl/
4. Reinstall extension:
pecl install grpc

Related

How do I build the Firebird database extension (ext-interbase) for PHP on a MacOS M1 Monterey?

Firebird Extension for PHP on MacOS M1
I have PHP7.4 installed with homebrew and the Xcode command line tools.
I followed the instructions as per the source repository here https://github.com/FirebirdSQL/php-firebird using the following methodology, I have changed the Linux formula to suite the MacOS library locations as per this answer here
Issues compiling firebird driver for PHP-7.4 on macos:
git clone https://github.com/FirebirdSQL/php-firebird.git
cd php-firebird
phpize
CPPFLAGS=-I/Library/Frameworks/Firebird.framework/Headers LDFLAGS=-L/Library/Frameworks/Firebird.framework/Resources/lib ./configure
make
The error I get is
configure: error: libfbclient, libgds or libib_util not found! Check config.log for more information.
In the log file it refers to the following which is the crux of the issue
ld: warning: ignoring file /opt/firebird/lib/libib_util.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
The problem is that the Firebird package for Mac is only built for the 64bit architecture and not the ARM architecture.
Solution
I always seem to struggle building the extension for Firebird on MacOS (Intel or M1) and after a month of leaving the problem I discovered the solution which I leave here for myself all of you who have hit this wall, until ARM is supported on MacOS for Firebird we probably have to run the 64 bit version with 64 bit PHP. The steps below should get you up and running. I came up with 2 solutions, the first most obvious one was to make a docker build.
Docker Solution
docker run -v $(pwd):/app tina4stack/php -ini | grep interbase
Home brew solution
The second solution (more complicated) was to follow these steps, I don't always like to run a docker engine for simple things.
Install latest Firebird for MacOS
First, make sure you have installed the latest Firebird MacOS package, Firebird 3.0 at the time of writing has only one you can install.
The next problem I ran into was home-brew had installed an ARM version of PHP which made the linking to the x86_64 architecture impossible. Kudos to the documentation here https://austencam.com/posts/setting-up-an-m1-mac-for-laravel-development-with-homebrew-php-mysql-valet-and-redis
Install Rosetta
First I installed Rosetta (helps run 64 bit apps on MacOS ARM)
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
Install Home-brew for 64bit architecture
Next I removed homebrew and reinstalled it with the arch -x86_64 bit flag
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Install PHP7.4
Then installed a fresh php#7.4
arch -x86_64 brew install php#7.4
Compile the extension
git clone https://github.com/FirebirdSQL/php-firebird.git
cd php-firebird
phpize
CFLAGS='-arch x86_64' CPPFLAGS=-I/Library/Frameworks/Firebird.framework/Headers LDFLAGS=-L/Library/Frameworks/Firebird.framework/Resources/lib ./configure
make
sudo make install
Tying it all together
I added the following to my php.ini file
extension=interbase
If you don't know where to edit your ini file, run the following command:
php -ini | grep php.ini
When I ran php -ini | grep interpose I got errors about not finding the firebird libraries. In the end I copied the libraries to the PHP bin and lib folders
cp /Library/Frameworks/Firebird.framework/Resources/lib/* /usr/local/Cellar/php#7.4/7.4.25/lib
cp /Library/Frameworks/Firebird.framework/Resources/lib/* /usr/local/Cellar/php#7.4/7.4.25/bin
I'm sure someone could comment on making the above a bit neater but I was happy to find that the ini command returns now as expected.
php -ini | grep interbase
interbase
Let me know if you hit issues I didn't find, there were some other things I tried for the Firebird library resolution but I'm not sure they worked.
Installing modules with PECL
As an addition the the above solution, easily install other PHP modules using the following command
arch -x86_64 pecl install <module>
Example
arch -x86_64 pecl install openswoole

How to install php-redis extension on mac os 10.13?

For a few days I'm trying to install php-redis extension.
Try use brew and getting this...
$ brew install php71-redis
Error: No available formula with the name "php71-redis"
==> 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.
Trying to install with PECL and getting this...
$ sudo pecl install redis
downloading redis-4.1.0.tgz ...
Starting to download redis-4.1.0.tgz (220,774 bytes)
..............................................done: 220,774 bytes
25 source files, building
running: phpize
Configuring for:
PHP Api Version: 20160303
Zend Module Api No: 20160303
Zend Extension Api No: 320160303
************
************
checking whether to enable igbinary serializer support... yes
checking whether to enable lzf compression... yes
checking use system liblzf... no
checking for igbinary includes... configure: error: Cannot find igbinary.h
ERROR: `/private/tmp/pear/install/redis/configure --with-php-config=/usr/bin/php-config --enable-redis-igbinary=нуы --enable-redis-lzf=yes' failed
and finally trying to install igbinary.h ....
$ sudo pecl install igbinary
downloading igbinary-2.0.7.tgz ...
Starting to download igbinary-2.0.7.tgz (73,523 bytes)
************
************
Build process completed successfully
Installing '/usr/include/php/ext/igbinary/igbinary.h'
ERROR: failed to mkdir /usr/include/php/ext/igbinary
I just did this on Mac OS 10.13 (I'm still using High Sierra).
With homebrew php7.2 and up, pecl is now installed by default alongside the php binaries.
To see this for yourself type which pecl.
Steps to install
Check your version of redis, then find a suitable version of the extension here.
If unfamiliar with pecl, type pecl to see the options.
Issue pecl install redis 5.0.2. (or your version). Enter no to each question asked if you're not sure.
If that succeeds check the new file it created at: /usr/local/lib/php/pecl/20180731/redis.so
The install will have added extension="redis.so" to top of your php ini.
Check that by opening the file /usr/local/etc/php/7.3/php.ini.
(assuming you're on 7.3 there)
brew services restart php.
php -i | grep Redis
Redis Support => enabled
Redis Version => 5.0.2
Did this in September 2019 and it works for me.
For this, try to disable the csrutil on OSx (Mac):
Reboot your Mac
When the Mac starts, typo Command + R until you get into recovery mode
In the recovery mode, go to utilities and select terminal
in the terminal type csrutil disable
Reboot your mac and redo the redis install by pecl
Should work.

Firefox 45.0.2 installation on Debian

I'm not able to install Firefox 45.0.2 on my Debian system. I have downloaded the .tar file and followed the steps. While checking the version, I'm getting the below error. I'm not able to launch Firefox with
firefox -v
Error: bash: /usr/bin/firefox: cannot execute binary file: Exec format error
I was able to install and use other Firefox versions without any issues.
try this
sudo apt-get install firefox=45.0.2+build1-0ubuntu1

Cannot install Logentries Mac Agent on OS X Yosemite

I tried to install Logentries (Mac Agent) as instructed by the website itself. I followed the steps as instructed.
curl -O https://raw.githubusercontent.com/logentries/le/master/install/mac/install.sh
I downloaded the install.sh script and ran sudo ./install.sh. But that didn't work so I tried sudo sh install.sh.
When I do sudo le then I get same error message as marked in pic above.
I googled but didn't find the solution.
Thank you in advance.
Here is composer.json content
it's missing the formats directory.
sudo pip install formats
should resolve your issue here, then sudo sh install.sh
#user5384112 is correct, the error is being caused by a missing dependancy.
I have a PR to fix this for the Mac installer which should go live shortly.
You can install directly with by downloading with curl or download and install it. You should first look for missing dependencies before installing anything. You should have looked carefully in the documentation and error messages. The error clearly suggests you should have formats. for that do following
sudo pip install formats

wkhtmltopdf on Fedora 14

Did anybody ever installed wkhtmltopdf on Fedora 14?
On http://code.google.com/p/wkhtmltopdf/wiki/compilation there is a step by step for Debian. In the comments, there is also something similar to CentOS.
Till now I have installed:
Development Tools
openssl-devel libXrender-devel libXext-devel libXft-devel
QT (qt.x86_64 qt-devel.x86_64 qt-webkit.x86_64)
git
And I have also downloaded wkhtmltopdf from git:
git clone git://github.com/antialize/wkhtmltopdf.git wkhtmltopdf
However, the last steps are driving me crazy. Here's where So I need some help:
Compiling and installing wkhtmltopdf Now all you need to do is compile and install wkhtmltopdf
make && make install
Here's the wkhtmltopdf folder:
NEW UPDATE:
After running cd wkhtmltopdf && qmake-qt4 && make as normal user, here's what I got:
Then, I searched again for some qt packages I should have and ended with this group:
qt-webkit-devel.x86_64 php-qt-devel.x86_64 qt-x11.x86_64 qtnx.x86_64
Then, again, I ran qmake-qt4 && make and this time it passed with no errors.
Finally, I ran sudo make install and it also passed with no errors.
However, when I ran wkhtmltopdf -h it returns:
wkhtmltopdf: error while loading shared libraries: libwkhtmltox.so.0: cannot open shared object file: No such file or directory
So, I decided to go all way compiling QT, following exactly the instructions. At the end, I got the same error:
$ wkhtmltopdf -h
wkhtmltopdf: error while loading shared libraries: libwkhtmltox.so.0: cannot open shared object file: No such file or directory
Any help would be great.
Thanks!
wkhtmltopdf want libwkhtmltox.so.0 lib. But search it into /lib64 directory.
You can :
cd /lib64
ln -s /lib/libwkhtmltox.so.0 libwkhtmltox.so.0
wkhtmltopdf -h
is ok after that.
(sorry for my english...)
You missed the part where you have to run qmake.
cd /lib64
ln -s /lib/libwkhtmltox.so.0 libwkhtmltox.so.0
This also worked on CentOS release 6.2 (Final)
The error :
wkhtmltopdf: error while loading shared libraries: libwkhtmltox.so.0: cannot open shared object file: No such file or directory
can also be caused by the miss of Xorg, then you can install it for example on Debian :
apt-get install xorg

Resources