{"id":2812,"date":"2012-05-19T16:55:27","date_gmt":"2012-05-19T21:55:27","guid":{"rendered":"http:\/\/icesquare.com\/wordpress\/?p=2812"},"modified":"2014-07-06T18:44:45","modified_gmt":"2014-07-06T23:44:45","slug":"freebsdhow-to-run-pecl-tokyo-tyrant-in-php-5-4","status":"publish","type":"post","link":"https:\/\/icesquare.com\/wordpress\/freebsdhow-to-run-pecl-tokyo-tyrant-in-php-5-4\/","title":{"rendered":"[FreeBSD]How to run PECL Tokyo Tyrant in PHP 5.4"},"content":{"rendered":"<p>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:<\/p>\n<div style=\"margin-bottom:70px;\"><\/div>\n<pre>\r\ncd \/usr\/ports\/databases\/pecl-tokyo_tyrant\r\nsudo make\r\n<\/pre>\n<pre style=\"font-size:0.9em;\">\r\n===>  pecl-tokyo_tyrant-0.6.0 cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 5).\r\n*** Error code 1\r\n\r\nStop in \/usr\/ports\/databases\/pecl-tokyo_tyrant.\r\n<\/pre>\n<pre style=\"font-size:0.9em;\">\r\n\/usr\/ports\/databases\/pecl-tokyo_tyrant\/work\/tokyo_tyrant-0.6.0\/tokyo_tyrant.c:1827: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'php_tokyo_tyrant_class_methods'\r\n\/usr\/ports\/databases\/pecl-tokyo_tyrant\/work\/tokyo_tyrant-0.6.0\/tokyo_tyrant.c:1867: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'php_tokyo_tyrant_table_class_methods'\r\n\/usr\/ports\/databases\/pecl-tokyo_tyrant\/work\/tokyo_tyrant-0.6.0\/tokyo_tyrant.c:1911: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'php_tokyo_tyrant_query_class_methods'\r\n\/usr\/ports\/databases\/pecl-tokyo_tyrant\/work\/tokyo_tyrant-0.6.0\/tokyo_tyrant.c:1936: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'php_tokyo_tyrant_iterator_class_methods'\r\n\/usr\/ports\/databases\/pecl-tokyo_tyrant\/work\/tokyo_tyrant-0.6.0\/tokyo_tyrant.c: In function 'php_tokyo_tyrant_query_object_new':\r\n\/usr\/ports\/databases\/pecl-tokyo_tyrant\/work\/tokyo_tyrant-0.6.0\/tokyo_tyrant.c:2001: error: 'zend_class_entry' has no member named 'default_properties'\r\n\/usr\/ports\/databases\/pecl-tokyo_tyrant\/work\/tokyo_tyrant-0.6.0\/tokyo_tyrant.c: In function 'php_tokyo_tyrant_iterator_object_new':\r\n\/usr\/ports\/databases\/pecl-tokyo_tyrant\/work\/tokyo_tyrant-0.6.0\/tokyo_tyrant.c:2052: error: 'zend_class_entry' has no member named 'default_properties'\r\n\/usr\/ports\/databases\/pecl-tokyo_tyrant\/work\/tokyo_tyrant-0.6.0\/tokyo_tyrant.c: In function 'php_tokyo_tyrant_object_new_ex':\r\n\/usr\/ports\/databases\/pecl-tokyo_tyrant\/work\/tokyo_tyrant-0.6.0\/tokyo_tyrant.c:2090: error: 'zend_class_entry' has no member named 'default_properties'\r\n\/usr\/ports\/databases\/pecl-tokyo_tyrant\/work\/tokyo_tyrant-0.6.0\/tokyo_tyrant.c: In function 'zm_startup_tokyo_tyrant':\r\n\/usr\/ports\/databases\/pecl-tokyo_tyrant\/work\/tokyo_tyrant-0.6.0\/tokyo_tyrant.c:2166: error: 'php_tokyo_tyrant_class_methods' undeclared (first use in this function)\r\n\/usr\/ports\/databases\/pecl-tokyo_tyrant\/work\/tokyo_tyrant-0.6.0\/tokyo_tyrant.c:2166: error: (Each undeclared identifier is reported only once\r\n\/usr\/ports\/databases\/pecl-tokyo_tyrant\/work\/tokyo_tyrant-0.6.0\/tokyo_tyrant.c:2166: error: for each function it appears in.)\r\n\/usr\/ports\/databases\/pecl-tokyo_tyrant\/work\/tokyo_tyrant-0.6.0\/tokyo_tyrant.c:2171: error: 'php_tokyo_tyrant_table_class_methods' undeclared (first use in this function)\r\n\/usr\/ports\/databases\/pecl-tokyo_tyrant\/work\/tokyo_tyrant-0.6.0\/tokyo_tyrant.c:2176: error: 'php_tokyo_tyrant_query_class_methods' undeclared (first use in this function)\r\n\/usr\/ports\/databases\/pecl-tokyo_tyrant\/work\/tokyo_tyrant-0.6.0\/tokyo_tyrant.c:2182: error: 'php_tokyo_tyrant_iterator_class_methods' undeclared (first use in this function)\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\r\n<\/pre>\n<p>Basically, it means that the pecl-tokyo_tyrant is not happy with the new version of PHP 5.4. I&#8217;ve tried several methods, including using pkg_add, compiling from source, copying a working tokyo_tyrant.so etc, unfortunately none of these methods works.<\/p>\n<p>Finally, I found that the maintainer of this package has made a new version available(0.6.2) at github. Here is how I did it:<\/p>\n<p>First, go to <a href=\"https:\/\/github.com\/mkoppanen\/php-tokyo_tyrant\/downloads\" target=\"_blank\">here<\/a> to grab the source code. Make sure that you download the tag.gz version because it has the file attribute available.<\/p>\n<p>Second, let&#8217;s remove the pecl-tokyo_tyrant from your system. You can either do it in the port or pkg_delete:<\/p>\n<p>From port:<\/p>\n<pre>\r\ncd \/usr\/ports\/databases\/pecl-tokyo_tyrant\r\nsudo make deinstall\r\n<\/pre>\n<p>Or using pkg_delete:<\/p>\n<pre>\r\nsudo pkg_delete pecl-tokyo_tyrant-0.6.0\r\n<\/pre>\n<p>Now, extract the files and compile it from source:<\/p>\n<pre>\r\ntar -zxvf mkoppanen-php-tokyo_tyrant-0.6.0-2-gb0d7e0c.tar.gz\r\ncd mkoppanen-php-tokyo_tyrant-b0d7e0c\r\nsudo phpize\r\nsudo .\/configure\r\nsudo make\r\nsudo make install\r\n<\/pre>\n<p>and don&#8217;t forget to include the .so file in your configuration:<\/p>\n<pre>\r\nsudo nano \/usr\/local\/etc\/php\/extensions.ini\r\n<\/pre>\n<p>Add the following (if not available) to the end of the file:<\/p>\n<pre>\r\nextension=tokyo_tyrant.so\r\n<\/pre>\n<p>Finally, let&#8217;s restart the Apache:<\/p>\n<pre>\r\nsudo apachectl stop\r\nsudo apachectl start\r\n<\/pre>\n<p>That&#8217;s it! Have fun with Tokyo Tyrant with PHP 5.4.<\/p>\n<p>&#8211;Derrick<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 <a class=\"more-link\" href=\"https:\/\/icesquare.com\/wordpress\/freebsdhow-to-run-pecl-tokyo-tyrant-in-php-5-4\/\">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,7,10,144,6,69],"tags":[171,172,27,123],"class_list":["post-2812","post","type-post","status-publish","format-standard","hentry","category-computer-problems-computer-help-pc-support","category-freebsd","category-php","category-sever-problem","category-technology","category-troubleshooting-technology","tag-freebsd","tag-php","tag-tokyo-cabinet","tag-tokyo-tyrant"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p1sqzr-Jm","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1489,"url":"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\/","url_meta":{"origin":2812,"position":0},"title":"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","author":"Derrick","date":"August 23, 2011","format":false,"excerpt":"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\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":"\/wordpress\/wp-content\/uploads\/2011\/08\/tokyocabinet.png","width":350,"height":200},"classes":[]},{"id":2792,"url":"https:\/\/icesquare.com\/wordpress\/phpfreebsd-the-databasesphp5-sqlite-port-has-been-deleted-removed-from-core-php-aborting-update\/","url_meta":{"origin":2812,"position":1},"title":"[PHP\/FreeBSD]===>>> The databases\/php5-sqlite port has been deleted: Removed from core php ===>>> Aborting update","author":"Derrick","date":"May 17, 2012","format":false,"excerpt":"[ad#adbrite] When PHP 5.4 was available few months ago, I was hesitated to upgrade my FreeBSD box to upgrade to 5.4, because it comes with lots of big changes, including removing LOTS of old stuffs that were available in 5.3 or earlier versions. Today PHP 5.4.3 becomes available in FreeBSD\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":2812,"position":2},"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":31,"url":"https:\/\/icesquare.com\/wordpress\/installing-apache-php-mysql-and-memcached-on-freebsd\/","url_meta":{"origin":2812,"position":3},"title":"Installing Apache, PHP, MySQL and MemCached on FreeBSD","author":"Derrick","date":"May 19, 2009","format":false,"excerpt":"This is my note on how to to install Apache, PHP, MySQL and MemCached on a FreeBSD 7 Box. 1. MySQL Go to the mysql52-server port directory by typing the command: cd \/usr\/ports\/databases\/mysql51-server Build the port by typing: make BUILD_OPTIMIZED=yes BUILD_STATIC=yes Using these two options will speed up the execution\u2026","rel":"","context":"In &quot;FreeBSD&quot;","block_context":{"text":"FreeBSD","link":"https:\/\/icesquare.com\/wordpress\/category\/sever-problem\/freebsd\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2502,"url":"https:\/\/icesquare.com\/wordpress\/freebsdproblem-to-update-php-port\/","url_meta":{"origin":2812,"position":4},"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":3514,"url":"https:\/\/icesquare.com\/wordpress\/freebsdphp-does-not-work-after-upgrading-apache-to-2-2-27\/","url_meta":{"origin":2812,"position":5},"title":"[FreeBSD]PHP does not work after upgrading Apache to 2.2.27","author":"Derrick","date":"April 11, 2014","format":false,"excerpt":"I upgraded the Apache to 2.2.27 on my FreeBSD box via portmaster. The upgrade went very smooth. After the upgrade, I found that Apache no longer rendered the PHP page correctly. In the other words, it displayed the source code of the PHP files instead of executing the code. Before\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\/2812","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=2812"}],"version-history":[{"count":20,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/2812\/revisions"}],"predecessor-version":[{"id":3669,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/2812\/revisions\/3669"}],"wp:attachment":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/media?parent=2812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/categories?post=2812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/tags?post=2812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}