Bug (ZS13): Studio invoked Debugger fails to load curl.so

General discussion on Zend Studio
Post Reply
marketacumen
Posts: 19
Joined: Thu Jul 15, 2010 9:03 pm

Bug (ZS13): Studio invoked Debugger fails to load curl.so

Post by marketacumen » Thu Oct 29, 2015 11:21 pm

I am on Mac OS X El Capitan running Zend Studio 13.

Trying to debug a command-line tool which uses curl, this failed in ZS12 and now the upgraded ZS13:

Running code it appears to load SOAP extension fine but curl_init is not defined and doesn't work.

I added this code to my PHP for debugging:

Code: Select all

		if (!function_exists('curl_init')) {
			echo "php_ini_loaded_file=" . php_ini_loaded_file() . "\n";
			if (!extension_loaded('curl')) {
				dl('curl.so');
				if (!extension_loaded('curl')) {
					die('Extension not loaded "curl"');
				}
			}
		}
In this case:

Code: Select all

php_ini_loaded_file=/var/folders/f3/d7f6t5bd6x55n9k7gl__shdw0000z_/T/php-ini/session592068784081735535.tmp/php.ini
Which contains

Code: Select all

zend_extension="/Applications/Zend Studio.app/Contents/Eclipse/plugins/com.zend.php.debug.debugger.php56.macosx_13.0.0.v20150925-1108/resources/php56/ZendDebugger.so"
extension_dir="/Applications/Zend Studio.app/Contents/Eclipse/plugins/com.zend.php.debug.debugger.php56.macosx_13.0.0.v20150925-1108/resources/php56/ext"
extension=bcmath.so
extension=bz2.so
extension=calendar.so
extension=ctype.so
extension=curl.so
extension=exif.so
extension=fileinfo.so
extension=ftp.so
extension=gd.so
extension=gettext.so
extension=ldap.so
extension=mbstring.so
extension=mcrypt.so
extension=memcache.so
extension=mssql.so
extension=mysql.so
extension=mysqli.so
extension=pcntl.so
extension=pgsql.so
extension=posix.so
extension=shmop.so
extension=soap.so
extension=sockets.so
extension=sysvmsg.so
extension=sysvsem.so
extension=sysvshm.so
extension=tidy.so
extension=tokenizer.so
extension=wddx.so
extension=xmlrpc.so
extension=xsl.so
extension=zip.so
;extension=imagick.so
extension=phar.so
memory_limit="256M"
date.timezone="America/New_York"
include_path=".:/Users/kent/ma/zesk"
[Date]
date.timezone = UTC
openssl.cafile="/Applications/Zend Studio.app/Contents/Eclipse/plugins/com.zend.php.debug.debugger.php56.macosx_13.0.0.v20150925-1108/resources/php56/ca-bundle.crt"
The error I get, regardless of the PHP executable I choose is:

Code: Select all

Debug Warning: /path/to/my/app/code/user.inc line 314 - dl(): Unable to load dynamic library '/Applications/Zend Studio.app/Contents/Eclipse/plugins/com.zend.php.debug.debugger.php56.macosx_13.0.0.v20150925-1108/resources/php56/ext/curl.so' - dlopen(/Applications/Zend Studio.app/Contents/Eclipse/plugins/com.zend.php.debug.debugger.php56.macosx_13.0.0.v20150925-1108/resources/php56/ext/curl.so, 9): Library not loaded: /usr/local/zend/lib/libsasl2.2.dylib
  Referenced from: /Applications/Zend Studio.app/Contents/Eclipse/plugins/com.zend.php.debug.debugger.php56.macosx_13.0.0.v20150925-1108/resources/php56/ext/curl.so
  Reason: image not found
When I run:

Code: Select all

"/Applications/Zend Studio.app/Contents/Eclipse/plugins/com.zend.php.debug.debugger.php56.macosx_13.0.0.v20150925-1108/resources/php56/php" -c /var/folders/f3/d7f6t5bd6x55n9k7gl__shdw0000z_/T/php-ini/session592068784081735535.tmp/php.ini -a
However, it appears to load it correctly.

Code: Select all

Warning: PHP Startup: Unable to load dynamic library '/usr/local/zend/lib/php_extensions/mcrypt.so' - dlopen(/usr/local/zend/lib/php_extensions/mcrypt.so, 9): Library not loaded: /usr/lib/libltdl.7.dylib
  Referenced from: /usr/local/zend/lib/php_extensions/mcrypt.so
  Reason: image not found in Unknown on line 0
Failed loading //usr/local/zend/lib/datacache/php-5.6.x/ZendDataCache.so:  dlopen(//usr/local/zend/lib/datacache/php-5.6.x/ZendDataCache.so, 9): Library not loaded: libZendDevBarLib.so
  Referenced from: //usr/local/zend/lib/datacache/php-5.6.x/ZendDataCache.so
  Reason: image not found
Failed loading //usr/local/zend/lib/jobqueue/php-5.6.x/jobqueue.so:  dlopen(//usr/local/zend/lib/jobqueue/php-5.6.x/jobqueue.so, 9): Library not loaded: libZendDevBarLib.so
  Referenced from: //usr/local/zend/lib/jobqueue/php-5.6.x/jobqueue.so
  Reason: image not found
Failed loading //usr/local/zend/lib/utils/php-5.6.x/ZendUtils.so:  dlopen(//usr/local/zend/lib/utils/php-5.6.x/ZendUtils.so, 9): Library not loaded: libZendDevBarLib.so
  Referenced from: //usr/local/zend/lib/utils/php-5.6.x/ZendUtils.so
  Reason: image not found
Failed loading //usr/local/zend/lib/codetracing/php-5.6.x/CodeTracing.so:  dlopen(//usr/local/zend/lib/codetracing/php-5.6.x/CodeTracing.so, 9): Library not loaded: libZendDevBarLib.so
  Referenced from: //usr/local/zend/lib/codetracing/php-5.6.x/CodeTracing.so
  Reason: image not found
Failed loading //usr/local/zend/lib/statistics/php-5.6.x/ZendStatistics.so:  dlopen(//usr/local/zend/lib/statistics/php-5.6.x/ZendStatistics.so, 9): Library not loaded: libZendDevBarLib.so
  Referenced from: //usr/local/zend/lib/statistics/php-5.6.x/ZendStatistics.so
  Reason: image not found
Failed loading //usr/local/zend/lib/monitor/php-5.6.x/ZendMonitor.so:  dlopen(//usr/local/zend/lib/monitor/php-5.6.x/ZendMonitor.so, 9): Library not loaded: libZendDevBarLib.so
  Referenced from: //usr/local/zend/lib/monitor/php-5.6.x/ZendMonitor.so
  Reason: image not found
Failed loading //usr/local/zend/lib/pagecache/php-5.6.x/ZendPageCache.so:  dlopen(//usr/local/zend/lib/pagecache/php-5.6.x/ZendPageCache.so, 9): Library not loaded: libZendDevBarLib.so
  Referenced from: //usr/local/zend/lib/pagecache/php-5.6.x/ZendPageCache.so
  Reason: image not found
Interactive shell

php > echo function_exists('curl_init');
1
php >
Please help!
No whining.

vini981
Posts: 1
Joined: Mon Nov 02, 2015 6:26 pm

Re: Bug (ZS13): Studio invoked Debugger fails to load curl.s

Post by vini981 » Mon Nov 02, 2015 6:26 pm

sudo ln -s /usr/lib/libsasl2.2.dylib /usr/local/zend/lib/libsasl2.2.dylib

marketacumen
Posts: 19
Joined: Thu Jul 15, 2010 9:03 pm

Re: Bug (ZS13): Studio invoked Debugger fails to load curl.s

Post by marketacumen » Tue Nov 03, 2015 8:53 pm

Thanks, that worked!

Much appreciated.
No whining.

alek76
Posts: 14
Joined: Tue Aug 29, 2017 9:57 pm

Re: Bug (ZS13): Studio invoked Debugger fails to load curl.so

Post by alek76 » Thu Apr 11, 2019 12:17 pm

For anyone having problems with Zend Server and libZendDevBarLib.so like these:

Code: Select all

Failed loading //usr/local/zend/lib/jbridge/php-7.2.x/ZendJbridge.so:  dlopen(//usr/local/zend/lib/jbridge/php-7.2.x/ZendJbridge.so, 9): Library not loaded: libZendDevBarLib.so
  Referenced from: //usr/local/zend/lib/jbridge/php-7.2.x/ZendJbridge.so
  Reason: image not found
Failed loading //usr/local/zend/lib/jobqueue/php-7.2.x/jobqueue.so:  dlopen(//usr/local/zend/lib/jobqueue/php-7.2.x/jobqueue.so, 9): Library not loaded: libZendDevBarLib.so
  Referenced from: //usr/local/zend/lib/jobqueue/php-7.2.x/jobqueue.so
  Reason: image not found
Failed loading //usr/local/zend/lib/utils/php-7.2.x/ZendUtils.so:  dlopen(//usr/local/zend/lib/utils/php-7.2.x/ZendUtils.so, 9): Library not loaded: libZendDevBarLib.so
  Referenced from: //usr/local/zend/lib/utils/php-7.2.x/ZendUtils.so
  Reason: image not found
Failed loading //usr/local/zend/lib/codetracing/php-7.2.x/CodeTracing.so:  dlopen(//usr/local/zend/lib/codetracing/php-7.2.x/CodeTracing.so, 9): Library not loaded: libmariadb.2.dylib
  Referenced from: //usr/local/zend/lib/codetracing/php-7.2.x/CodeTracing.so
  Reason: image not found
Failed loading //usr/local/zend/lib/statistics/php-7.2.x/ZendStatistics.so:  dlopen(//usr/local/zend/lib/statistics/php-7.2.x/ZendStatistics.so, 9): Library not loaded: libZendDevBarLib.so
  Referenced from: //usr/local/zend/lib/statistics/php-7.2.x/ZendStatistics.so
  Reason: image not found
Failed loading //usr/local/zend/lib/monitor/php-7.2.x/ZendMonitor.so:  dlopen(//usr/local/zend/lib/monitor/php-7.2.x/ZendMonitor.so, 9): Library not loaded: libZendDevBarLib.so
  Referenced from: //usr/local/zend/lib/monitor/php-7.2.x/ZendMonitor.so
  Reason: image not found
Failed loading //usr/local/zend/lib/pagecache/php-7.2.x/ZendPageCache.so:  dlopen(//usr/local/zend/lib/pagecache/php-7.2.x/ZendPageCache.so, 9): Library not loaded: libZendDevBarLib.so
  Referenced from: //usr/local/zend/lib/pagecache/php-7.2.x/ZendPageCache.so
  Reason: image not found

The solution is to go into each one of the directories where those .so files are and then create a sym link to the libZendDevBarLib.so in there. Here is what I did which fixed it

Code: Select all

iMacs-iMac:lib root# cd /usr/local/zend/lib/jbridge/php-7.2.x/
iMacs-iMac:php-7.2.x root# ln -s /usr/local/zend/lib/libZendDevBarLib.so .
iMacs-iMac:php-7.2.x root# cd /usr/local/zend/lib/jobqueue/php-7.2.x/
iMacs-iMac:php-7.2.x root# ln -s /usr/local/zend/lib/libZendDevBarLib.so .
iMacs-iMac:php-7.2.x root# cd /usr/local/zend/lib/utils/php-7.2.x/
iMacs-iMac:php-7.2.x root# ln -s /usr/local/zend/lib/libZendDevBarLib.so .
iMacs-iMac:php-7.2.x root# cd /usr/local/zend/lib/codetracing/php-7.2.x/
iMacs-iMac:php-7.2.x root# ln -s /usr/local/zend/lib/libZendDevBarLib.so .
iMacs-iMac:php-7.2.x root# cd /usr/local/zend/lib/statistics/php-7.2.x
iMacs-iMac:php-7.2.x root# ln -s /usr/local/zend/lib/libZendDevBarLib.so .
iMacs-iMac:php-7.2.x root# cd /usr/local/zend/lib/monitor/
iMacs-iMac:monitor root# ln -s /usr/local/zend/lib/libZendDevBarLib.so .
iMacs-iMac:monitor root# cd /usr/local/zend/lib/pagecache/php-7.2.x/
iMacs-iMac:php-7.2.x root# ln -s /usr/local/zend/lib/libZendDevBarLib.so .
iMacs-iMac:php-7.2.x root# cd /usr/local/zend/lib/monitor/php-7.2.x/
iMacs-iMac:php-7.2.x root# ln -s /usr/local/zend/lib/libZendDevBarLib.so .
This worked with Zend Server 2018 on MacOS Mojave. Do make sure that "/usr/local/zend/lib/libZendDevBarLib.so" exists before running those.

Post Reply