blackfireio / php-sdk

The Blackfire PHP SDK
https://blackfire.io
MIT License
150 stars 22 forks source link

Blackfire PHP extension won't start on Mac #17

Closed kix closed 8 years ago

kix commented 8 years ago

Installed on a built-from-source PHP 5.6, trying $ php --ri blackfire:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so' - dlopen(/usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so, 9): Symbol not found: _compiler_globals
  Referenced from: /usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so
  Expected in: flat namespace
 in /usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so' - dlopen(/usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so, 9): Symbol not found: _compiler_globals
  Referenced from: /usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so
  Expected in: flat namespace
 in /usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so in Unknown on line 0

My ext-blackfire.ini:

[blackfire]
extension="/usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so"
blackfire.agent_socket = unix:///usr/local/var/run/blackfire-agent.sock
blackfire.agent_timeout = 0.25
;blackfire.log_level = 3
;blackfire.log_file = /tmp/blackfire.log
;blackfire.server_id =
;blackfire.server_token =

Output of $ brew reinstall blackfire-php56 -v:

==> Reinstalling blackfireio/blackfire/blackfire-php56
==> Downloading http://packages.blackfire.io/homebrew/blackfire-php_1.11.1-darwin_amd64-php56.tar.gz
Already downloaded: /Users/kix/Library/Caches/Homebrew/blackfire-php56-1.11.1.tar.gz
==> Verifying blackfire-php56-1.11.1.tar.gz checksum
tar xvzf /Users/kix/Library/Caches/Homebrew/blackfire-php56-1.11.1.tar.gz
x ./
x ./.scripts/
x ./blackfire.so
==> Cleaning
==> Finishing up
==> Caveats
To finish installing blackfire for PHP 5.6:

* /usr/local/etc/php/5.6/conf.d/ext-blackfire.ini was created,
  do not forget to remove it upon extension removal.

* Validate installation via one of the following methods:

  Using PHP from a webserver:

  - Restart your webserver or PHP-fpm.
  - Write a PHP page that calls "phpinfo();"
  - Load it in a browser and look for the info on the "blackfire" module.
  - If you see it, you have been successful!

  Using PHP from the command line:

  - Run php --ri blackfire
  - If the "blackfire" configuration is displayed, you have been successful!
==> Summary
🍺  /usr/local/Cellar/blackfire-php56/1.11.1: 2 files, 309.0K, built in 2 seconds
lyrixx commented 8 years ago

Hello @kix

Could you paste the output of php -v and php -m Thanks.

kix commented 8 years ago

@lyrixx, sure! $ php -v:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so' - dlopen(/usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so, 9): Symbol not found: _compiler_globals
  Referenced from: /usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so
  Expected in: flat namespace
 in /usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so' - dlopen(/usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so, 9): Symbol not found: _compiler_globals
  Referenced from: /usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so
  Expected in: flat namespace
 in /usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so in Unknown on line 0
PHP 5.6.24 (cli) (built: Jul 27 2016 19:03:12)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
    with Xdebug v2.3.3, Copyright (c) 2002-2015, by Derick Rethans

php -m:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so' - dlopen(/usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so, 9): Symbol not found: _compiler_globals
  Referenced from: /usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so
  Expected in: flat namespace
 in /usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so' - dlopen(/usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so, 9): Symbol not found: _compiler_globals
  Referenced from: /usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so
  Expected in: flat namespace
 in /usr/local/Cellar/blackfire-php56/1.11.1/blackfire.so in Unknown on line 0
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
intl
json
ldap
libxml
mbstring
mhash
mysql
mysqli
mysqlnd
odbc
openssl
pcntl
pcre
PDO
pdo_mysql
PDO_ODBC
pdo_sqlite
Phar
posix
pthreads
readline
redis
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
v8js
wddx
xdebug
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Xdebug
Zend OPcache
romainneutron commented 8 years ago

Dear @kix , how have you installed the blackfire extension?

It seems you're using a ZTS extension with a non-ZTS PHP, or opposite.

kix commented 8 years ago

@romainneutron: trying blackfire from Homebrew against PHP 5.6 --with-thread-safety, let's see where this leads me. Also, inspecting brew options blackfire-php56, I don't see a way to choose whether I want a thread safe or non-safe extension, so there's no way to know which version I have installed.

romainneutron commented 8 years ago

I now understand the issue. The Homebrew formula does not detect thread safety correctly. Please brew uninstall --force blackfire-php56 and install the appropriate extension manually using the "Manual" tab at this page https://blackfire.io/docs/up-and-running/installation#installation-instructions

romainneutron commented 8 years ago

My bad @kix, I forgot this : you can use blackfire homebrew tap to install. Forget the manual install, just:

brew uninstall --force blackfire-php56
brew install  blackfire-php56-zts
kix commented 8 years ago

@romainneutron, thanks, the last suggestion worked as a charm!

f3l1x commented 6 years ago

I've had some problem, using PHP 7.2. Solved by installing blackfire NON-ZTS.

d8vjork commented 2 years ago

PHP 8.1 having the same problem here.

I don't have PHP with thread safety, but still have this problem, tried thousand things but no luck

romainneutron commented 2 years ago

Please contact support@blackfire.io in case you're encountering issues