{"id":1489,"date":"2011-08-23T10:54:58","date_gmt":"2011-08-23T15:54:58","guid":{"rendered":"http:\/\/icesquare.com\/wordpress\/?p=1489"},"modified":"2012-08-14T18:08:40","modified_gmt":"2012-08-14T23:08:40","slug":"php-warning-php-startup-unable-to-load-dynamic-library-usrlocallibphp20090626tokyo_tyrant-so-usrlocallibphp20090626tokyo_tyrant-so-undefined-symbol-ps_globals-in-unknown-on-l","status":"publish","type":"post","link":"https:\/\/icesquare.com\/wordpress\/php-warning-php-startup-unable-to-load-dynamic-library-usrlocallibphp20090626tokyo_tyrant-so-usrlocallibphp20090626tokyo_tyrant-so-undefined-symbol-ps_globals-in-unknown-on-l\/","title":{"rendered":"PHP Warning:  PHP Startup: Unable to load dynamic library &#8216;\/usr\/local\/lib\/php\/20090626\/tokyo_tyrant.so&#8217; &#8211; \/usr\/local\/lib\/php\/20090626\/tokyo_tyrant.so: Undefined symbol &#8220;ps_globals&#8221; in Unknown on line 0"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"110\" data-attachment-id=\"1493\" data-permalink=\"https:\/\/icesquare.com\/wordpress\/php-warning-php-startup-unable-to-load-dynamic-library-usrlocallibphp20090626tokyo_tyrant-so-usrlocallibphp20090626tokyo_tyrant-so-undefined-symbol-ps_globals-in-unknown-on-l\/tokyocabinet\/#main\" data-orig-file=\"https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2011\/08\/tokyocabinet.png\" data-orig-size=\"300,110\" data-comments-opened=\"1\" data-image-title=\"tokyocabinet\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2011\/08\/tokyocabinet.png\" src=\"\/wordpress\/wp-content\/uploads\/2011\/08\/tokyocabinet.png\" alt=\"\" title=\"tokyocabinet\" class=\"alignleft size-thumbnail wp-image-1493\" \/><\/p>\n<p>Every time I upgrade the PHP and related extensions, I always run into the same problem with some PHP-PECL modules. Recently with the new release of PHP 5.3.7, there is no exception for the trouble. So what kind of trouble I have today? The Tokyo Tyrant (The middleman between my program and Tokyo Cabinet).<\/p>\n<pre>\r\n#php -v\r\n\r\nPHP Warning:  PHP Startup: Unable to load dynamic library '\/usr\/local\/lib\/php\/20090626\/tokyo_tyrant.so' - \/usr\/local\/lib\/php\/20090626\/tokyo_tyrant.so: Undefined symbol \"ps_globals\" in Unknown on line 0\r\n<\/pre>\n<p>This problem was caused by a version mis-match. PHP is running at a later version, which the Tokyo Tyrant extension is running at an earlier version. To solve this computer problem, all you need is to re-install the PHP-Tokyo-Tyrant extension, i.e.,<\/p>\n<pre>\r\ncd \/usr\/ports\/databases\/pecl-tokyo_tyrant\r\nsuod make deinstall clean\r\nsudo make install\r\n<\/pre>\n<p>And later, you may or may not get the following error message:<\/p>\n<pre>\r\n...\r\ncc -shared  .libs\/tokyo_tyrant.o .libs\/tokyo_tyrant_funcs.o .libs\/connection.o .libs\/session_funcs.o .libs\/server_pool.o .libs\/failover.o .libs\/session.o  -Wl,--rpath -Wl,\/usr\/local\/lib -Wl,--rpath -Wl,\/usr\/local\/lib -L\/usr\/local\/lib -ltokyotyrant -llua -ltokyocabinet \/usr\/local\/lib\/liblzo2.so -llzma -lbz2 -lz -lrt -lm  -Wl,-soname -Wl,tokyo_tyrant.so -o .\/.libs\/tokyo_tyrant.so\r\n\/usr\/bin\/ld: cannot find -llua\r\n*** Error code 1\r\n\r\nStop in \/usr\/ports\/databases\/pecl-tokyo_tyrant\/work\/tokyo_tyrant-0.6.0.\r\n*** Error code 1\r\n\r\nStop in \/usr\/ports\/databases\/pecl-tokyo_tyrant.\r\n<\/pre>\n<p>The problem is related to Lua. By default, the extension enable the Lua option, which I have a hard time to make it run properly on FreeBSD box. Since my website does not use the Lua with Tokyo Cabinet, I simply disable it:<\/p>\n<pre>\r\nsudo nano \/usr\/ports\/databases\/pecl-tokyo_tyrant\/work\/tokyo_tyrant-0.6.0\/Make\r\n<\/pre>\n<p>Look for the keyword: lua<br \/>\nAnd you will find something like the following:<\/p>\n<pre>\r\nTOKYO_TYRANT_SHARED_LIBADD = -R\/usr\/local\/lib -L\/usr\/local\/lib -R\/usr\/local\/lib -L\/usr\/local\/lib -ltokyotyrant -llua -ltokyocabinet -lbz2 -lz -lrt -lm -ltokyocabinet -llzo2 -llzma -lbz2 -lz -lrt -lm\r\n<\/pre>\n<p>Delete the option: &#8220;-llua&#8221;, i.e.,<\/p>\n<pre>\r\nTOKYO_TYRANT_SHARED_LIBADD = -R\/usr\/local\/lib -L\/usr\/local\/lib -R\/usr\/local\/lib -L\/usr\/local\/lib -ltokyotyrant -ltokyocabinet -lbz2 -lz -lrt -lm -ltokyocabinet -llzo2 -llzma -lbz2 -lz -lrt -lm\r\n<\/pre>\n<p>and re-start the installation:<\/p>\n<pre>\r\ncd \/usr\/ports\/databases\/pecl-tokyo_tyrant\r\nsudo make install clean\r\n<\/pre>\n<p>Now re-run the php, and you may see the following error:<\/p>\n<pre>\r\n#php -v\r\n\r\nPHP Warning:  PHP Startup: Unable to load dynamic library '\/usr\/local\/lib\/php\/20090626\/tokyo_tyrant.so' - \/usr\/local\/lib\/php\/20090626\/tokyo_tyrant.so: Undefined symbol \"ps_globals\" in Unknown on line 0\r\nSegmentation fault: 11\r\n<\/pre>\n<p>That&#8217;s because the Tokyo Tyrant module is placed at a wrong position in the PHP extension file. Edit the file:<\/p>\n<pre>\r\nsudo nano \/usr\/local\/etc\/php\/extensions.ini\r\n<\/pre>\n<p>and move the following code to the END of the file (Yes, order does matter):<\/p>\n<pre>\r\nextension=tokyo_tyrant.so\r\n<\/pre>\n<p>And re-check your php:<\/p>\n<pre>\r\n#php -v\r\n\r\nPHP 5.3.7 with Suhosin-Patch (cli) (built: Aug 23 2011 10:33:12)\r\nCopyright (c) 1997-2011 The PHP Group\r\nZend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies\r\n<\/pre>\n<p>Now everything is all set.<\/p>\n<p>Unfortunately, you pretty much need to do the same thing every time when upgrading your PHP on FreeBSD box.<\/p>\n<p>&#8211;Derrick<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Every time I upgrade the PHP and related extensions, I always run into the same problem with some PHP-PECL modules. Recently with the new release of PHP 5.3.7, there is <a class=\"more-link\" href=\"https:\/\/icesquare.com\/wordpress\/php-warning-php-startup-unable-to-load-dynamic-library-usrlocallibphp20090626tokyo_tyrant-so-usrlocallibphp20090626tokyo_tyrant-so-undefined-symbol-ps_globals-in-unknown-on-l\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[94,144,6,69],"tags":[171,27,123],"class_list":["post-1489","post","type-post","status-publish","format-standard","hentry","category-computer-problems-computer-help-pc-support","category-sever-problem","category-technology","category-troubleshooting-technology","tag-freebsd","tag-tokyo-cabinet","tag-tokyo-tyrant"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p1sqzr-o1","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2502,"url":"https:\/\/icesquare.com\/wordpress\/freebsdproblem-to-update-php-port\/","url_meta":{"origin":1489,"position":0},"title":"[FreeBSD]Problem to update PHP port","author":"Derrick","date":"January 12, 2012","format":false,"excerpt":"A new version of PHP (5.3.9) was available in FreeBSD today. Since it contained a lot of security fixes and enhancements, I decided to give it a try. After testing the new PHP in couple test servers, I think it is ready to upgrade the PHP on the production server.\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":603,"url":"https:\/\/icesquare.com\/wordpress\/weird-php-error-after-freebsd-port-upgrade\/","url_meta":{"origin":1489,"position":1},"title":"Weird PHP Error after FreeBSD port upgrade (PHP Warning:  PHP Startup: Unable to load dynamic library)","author":"Derrick","date":"April 6, 2010","format":false,"excerpt":"Today I upgraded the port on my FreeBSD box using portmaster tools: portmaster -Dai After that, I found that the PHP gave the following weird error: php -v PHP Warning: PHP Startup: Unable to load dynamic library '\/usr\/local\/lib\/php\/20060613\/memcached.so' - \/usr\/local\/lib\/php\/20060613\/memcached.so: Undefined symbol \" php_session_create_id\" in Unknown on line 0 PHP\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3596,"url":"https:\/\/icesquare.com\/wordpress\/shared-object-libsqlite3-so-8-not-found\/","url_meta":{"origin":1489,"position":2},"title":"Shared object &#8220;libsqlite3.so.8&#8221; not found","author":"Derrick","date":"July 1, 2014","format":false,"excerpt":"I noticed some weird thing on my server today. When I ran some PHP code, I got the following error: PHP Warning: PHP Startup: Unable to load dynamic library '\/usr\/local\/lib\/php\/20121212-zts\/pdo_sqlite.so' - Shared object \"libsqliteo_sqlite.so\" in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library '\/usr\/local\/lib\/php\/20121212-zts\/pdo_sqlite.so' - Shared\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2777,"url":"https:\/\/icesquare.com\/wordpress\/solvedproblem-to-update-openldap-in-freebsd\/","url_meta":{"origin":1489,"position":3},"title":"[Solved]Problem to Update OpenLDAP in FreeBSD","author":"Derrick","date":"April 29, 2012","format":false,"excerpt":"Recently, I found the following error message when updating my FreeBSD system regarding to the OpenLDAP: ===> Installing for openldap-client-2.4.31 ===> Generating temporary packing list ===> Checking if net\/openldap24-client already installed ===> Creating users and\/or groups. Using existing group `ldap'. Creating user `ldap' with uid `389'. pw: user 'ldap' already\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2812,"url":"https:\/\/icesquare.com\/wordpress\/freebsdhow-to-run-pecl-tokyo-tyrant-in-php-5-4\/","url_meta":{"origin":1489,"position":4},"title":"[FreeBSD]How to run PECL Tokyo Tyrant in PHP 5.4","author":"Derrick","date":"May 19, 2012","format":false,"excerpt":"After upgrading to PHP 5.4.3 (which is the first version of PHP 5.4 available in the FreeBSD port), I found that the pecl-tokyo_tyrant could not be compiled. Here is the error messages: cd \/usr\/ports\/databases\/pecl-tokyo_tyrant sudo make ===> pecl-tokyo_tyrant-0.6.0 cannot install: doesn't work with PHP version : 5 (Doesn't support PHP\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3925,"url":"https:\/\/icesquare.com\/wordpress\/freebsdupgrade-php-5-5-to-5-6\/","url_meta":{"origin":1489,"position":5},"title":"[FreeBSD]Upgrade PHP 5.5 to 5.6","author":"Derrick","date":"February 20, 2015","format":false,"excerpt":"It is not easy to upgrade PHP 5.5 to 5.6 in FreeBSD. Without proper preparation, the upgrade process may drive you nut. Before you decide to get your hands wet, here are what I recommend you to do: Back up your files Test your website in a PHP 5.6 environment\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/1489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1489"}],"version-history":[{"count":14,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/1489\/revisions"}],"predecessor-version":[{"id":2871,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/1489\/revisions\/2871"}],"wp:attachment":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}