arnaud-lb / php-memory-profiler

Memory profiler for PHP. Helps finding memory leaks in PHP scripts.
MIT License
858 stars 51 forks source link

pecl install fails on MacOS #77

Closed edsrzf closed 2 years ago

edsrzf commented 2 years ago

Description

The following command:

pecl install memprof

Resulted in this output:

...
checking whether to enable memprof support... yes, shared
checking for judy lib... yes, shared
checking for judy files in default path... not found
configure: error: Please reinstall the judy distribution
ERROR: `/private/tmp/pear/temp/memprof/configure --with-php-config=/opt/homebrew/opt/php/bin/php-config' failed

But I expected the command to succeed with no errors.

I've already installed judy with brew install traildb/judy/judy, and it's present under /opt/homebrew/Cellar/judy/1.0.5.

php-memprof Version

3.0.1

PHP Version

PHP 8.1.1

Operating System

macOS 12.0 (Monterey)

arnaud-lb commented 2 years ago

Hi @edsrzf

Currently the pecl package doesn't allow to specify a custom libjudy installation path.

Could you try building the extension manually ?

phpize
./configure --with-judy-dir=/opt/homebrew/Cellar/judy/1.0.5
make
sudo make install
edsrzf commented 2 years ago

Yes, that works. Might it be worth updating the README to mention this? I assume anyone using Homebrew would run into the same problem.

arnaud-lb commented 2 years ago

Definitely, yes

I've changed the README, thank you for your report !