<!-- 
RSS generated by JIRA (5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9) at Wed May 22 13:08:22 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.couchbase.com/issues/si/jira.issueviews:issue-xml/PCBC-112/PCBC-112.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Couchbase</title>
    <link>http://www.couchbase.com/issues</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.4</version>
        <build-number>845</build-number>
        <build-date>26-12-2012</build-date>
    </build-info>

<item>
            <title>[PCBC-112] &quot;undefined symbol: php_json_decode in Unknown on line 0&quot; when load couchbase.so library</title>
                <link>http://www.couchbase.com/issues/browse/PCBC-112</link>
                <project id="10049" key="PCBC">Couchbase PHP client library</project>
                        <description>Affects Versions:&lt;br/&gt;
1.0.6-1&lt;br/&gt;
1.1.0dp9-1&lt;br/&gt;
&lt;br/&gt;
Here are steps to reproduce error in version 1.0.6-1, (version 1.1.0dp9-1 is similar):&lt;br/&gt;
1. create file /etc/yum.repos.d/couchbase.repo&lt;br/&gt;
&lt;br/&gt;
[couchbase]&lt;br/&gt;
name = Couchbase package repository&lt;br/&gt;
# baseurl = &lt;a href=&quot;http://packages.couchbase.com/rpm/6.2/x86_64&quot;&gt;http://packages.couchbase.com/rpm/6.2/x86_64&lt;/a&gt;&lt;br/&gt;
baseurl = &lt;a href=&quot;http://packages.couchbase.com/preview/rpm/5.5/x86_64&quot;&gt;http://packages.couchbase.com/preview/rpm/5.5/x86_64&lt;/a&gt;&lt;br/&gt;
gpgcheck=0&lt;br/&gt;
&lt;br/&gt;
2. yum install libcouchbase1&lt;br/&gt;
&lt;br/&gt;
3.&lt;br/&gt;
# wget &lt;a href=&quot;http://packages.couchbase.com/clients/php/php-ext-couchbase-1.0.5-centos62-x86_64.tar.gz&quot;&gt;http://packages.couchbase.com/clients/php/php-ext-couchbase-1.0.5-centos62-x86_64.tar.gz&lt;/a&gt;&lt;br/&gt;
# tar xzf php-ext-couchbase-1.0.5-centos62-x86_64.tar.gz&lt;br/&gt;
# cp php-ext-couchbase/couchbase.so /usr/lib64/php/modules/&lt;br/&gt;
&lt;br/&gt;
4. add the following line to /etc/php.d/json.ini:&lt;br/&gt;
extension=couchbase.so&lt;br/&gt;
&lt;br/&gt;
5. # service php-fpm restart&lt;br/&gt;
Stopping php-fpm:                                          [  OK  ]&lt;br/&gt;
Starting php-fpm: [10-Sep-2012 17:42:45] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library &amp;#39;/usr/lib64/php/modules/couchbase.so&amp;#39; - /usr/lib64/php/modules/couchbase.so: undefined symbol: php_json_decode in Unknown on line 0&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[  OK  ]&lt;br/&gt;
&lt;br/&gt;
</description>
                <environment>centos 6.3 x86_64&lt;br/&gt;
&lt;br/&gt;
php 5.4 from remi repository ( &lt;a href=&quot;http://blog.famillecollet.com/en&quot;&gt;http://blog.famillecollet.com/en&lt;/a&gt; )&lt;br/&gt;
# rpm -q php-fpm&lt;br/&gt;
php-fpm-5.4.6-1.el6.remi.x86_64&lt;br/&gt;
&lt;br/&gt;
# uname -a&lt;br/&gt;
Linux dhcppc0 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux&lt;br/&gt;
</environment>
            <key id="19652">PCBC-112</key>
            <summary>&quot;undefined symbol: php_json_decode in Unknown on line 0&quot; when load couchbase.so library</summary>
                <type id="1" iconUrl="http://www.couchbase.com/issues/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.couchbase.com/issues/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.couchbase.com/issues/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="4">Incomplete</resolution>
                    <security id="10011">Public</security>
                        <assignee username="-1">Unassigned</assignee>
                                <reporter username="thanhbv">thanhbv</reporter>
                        <labels>
                    </labels>
                <created>Mon, 10 Sep 2012 06:04:25 -0500</created>
                <updated>Fri, 25 Jan 2013 08:07:20 -0600</updated>
                    <resolved>Thu, 29 Nov 2012 17:36:33 -0600</resolved>
                                                            <component>library</component>
                                <votes>0</votes>
                        <watches>2</watches>
                                                    <comments>
                    <comment id="38477" author="ingenthr" created="Tue, 11 Sep 2012 11:09:22 -0500"  >This is not a bug.&lt;br/&gt;
&lt;br/&gt;
This is an issue with the order of the extensions, and it&amp;#39;s mentioned in the installation section on &lt;a href=&quot;http://www.couchbase.com/develop/php/current&quot;&gt;http://www.couchbase.com/develop/php/current&lt;/a&gt;&lt;br/&gt;
&lt;br/&gt;
Solution is to put the extension in a different .ini file.</comment>
                    <comment id="38561" author="thanhbv" created="Wed, 12 Sep 2012 00:07:32 -0500"  >No. I think this is a new bug.&lt;br/&gt;
Have you read carefully the error description above?&lt;br/&gt;
&lt;br/&gt;
The installation document say that:&lt;br/&gt;
&amp;quot;The easiest workaround if you encounter this is to edit the ini file that loads the JSON extension (typically /etc/php.d/json.ini) and add the Couchbase extension after the JSON extension.&amp;quot;&lt;br/&gt;
&lt;br/&gt;
Not &amp;quot; put the extension in a different .ini file&amp;quot;.&lt;br/&gt;
&lt;br/&gt;
OK. I will describe more detail:&lt;br/&gt;
1.&lt;br/&gt;
~2 month ago, in one of my server, running centos 6.2 &amp;amp; php 5.4, couchbase-server 1.8.0, I have install this php extension successfully:&lt;br/&gt;
a. If I add &amp;quot;extension=couchbase.so&amp;quot; in /etc/php.d/couchbase.ini =&amp;gt; error.&lt;br/&gt;
b. If I put &amp;quot;extension=couchbase.so&amp;quot; in /etc/php.d/zzcouchbase.ini, OR add &amp;quot;extension=couchbase.so&amp;quot; to the end of  /etc/php.d/json.ini =&amp;gt; success.&lt;br/&gt;
&lt;br/&gt;
2. Yesterday, In my other server with centos to 6.3, php-5.4.6-1.el6.remi.x86_64 (newer than the php package in my first server), couchbase-server 1.8.1 =&amp;gt; this error (even if I config as in session 1.b above!)&lt;br/&gt;
&lt;br/&gt;
Then, I think you should try the steps above before closing this issue.&lt;br/&gt;
thank you.</comment>
                    <comment id="38562" author="mnunberg" created="Wed, 12 Sep 2012 00:25:56 -0500"  >The problem would be in your PHP configuration.&lt;br/&gt;
&lt;br/&gt;
The json function not found is actually compiled into PHP, and should be present (in Debian&amp;#39;s 5.4 it&amp;#39;s there as part of the binary).&lt;br/&gt;
&lt;br/&gt;
The extension code compiles out references to php_json_* if it&amp;#39;s not defined in PHP&amp;#39;s own header files. If you do a simple search for php_json here &lt;a href=&quot;https://github.com/couchbase/php-ext-couchbase/blob/master/couchbase.c&quot;&gt;https://github.com/couchbase/php-ext-couchbase/blob/master/couchbase.c&lt;/a&gt; you&amp;#39;ll see there isn&amp;#39;t a place where php_json_* is mentioned without #define guards ensuring it doesn&amp;#39;t work on non-JSONified PHPs.&lt;br/&gt;
&lt;br/&gt;
I am not familiar with the specific RPM you&amp;#39;re using.. let me check that out..</comment>
                    <comment id="38563" author="ingenthr" created="Wed, 12 Sep 2012 00:28:53 -0500"  >Typically issues with undefined symbols indicate either an order of loading libraries problem or something like using 32-bit binaries on a 64-bit system.  In this particular case, you&amp;#39;re reporting that it can&amp;#39;t load the symbol for php_json_decode.   Since we don&amp;#39;t ship php_json_decode, it&amp;#39;s either missing from your install, you&amp;#39;re loading in the wrong order or you&amp;#39;re loading the wrong architecture.&lt;br/&gt;
&lt;br/&gt;
My guess is that you may not have the php_json_decode for some reason.  We test this on stock CentOS 6.2 before shipping, and we would have caught a symbol resolution then.&lt;br/&gt;
&lt;br/&gt;
Do you still have this issue with stock PHP from the standard CentOS 6 repository?  If so, we can look into it further.</comment>
                    <comment id="39097" author="thanhbv" created="Sat, 15 Sep 2012 00:08:36 -0500"  >I have just attached file phpinfo.html.&lt;br/&gt;
&lt;br/&gt;
I use PHP 5.4. The stock PHP from the standard CentOS 6 repository  is only 5.3.3&lt;br/&gt;
&lt;br/&gt;
Now, I must use php-pecl-memcached-2.1.0-2.el6.remi.1.x86_64 as a workaround</comment>
                    <comment id="40006" author="thanhbv" created="Fri, 28 Sep 2012 23:41:47 -0500"  >If I build from souce then it work as expected:&lt;br/&gt;
&lt;br/&gt;
$ git clone &lt;a href=&quot;https://github.com/couchbase/php-ext-couchbase.git&quot;&gt;https://github.com/couchbase/php-ext-couchbase.git&lt;/a&gt;&lt;br/&gt;
$ cd php-ext-couchbase&lt;br/&gt;
# yum --enablerepo=remi,remi-test install php-devel&lt;br/&gt;
$ phpize&lt;br/&gt;
$ ./configure&lt;br/&gt;
$ make&lt;br/&gt;
$ make test&lt;br/&gt;
$ make install&lt;br/&gt;
# echo &amp;#39;extension=couchbase.so&amp;#39; &amp;gt; /etc/php.d/zzcouchbase.ini&lt;br/&gt;
# service php-fpm restart</comment>
                    <comment id="42485" author="ingenthr" created="Thu, 25 Oct 2012 12:57:42 -0500"  >This appears to have been a problem with the specific PHP version in use, and we&amp;#39;ve not been able to reproduce it with stock PHP.  We plan to add testing for 5.4 soon.</comment>
                    <comment id="44896" author="ingenthr" created="Tue, 27 Nov 2012 19:50:44 -0600"  >In the end, this is NOT an issue with php 5.4, but rather an issue with some distributions of PHP not including core functionality.  This has been confirmed by the PHP core team.  &lt;br/&gt;
&lt;br/&gt;
To address this, we&amp;#39;re adding some documentation (see &lt;a href=&quot;http://www.couchbase.com/issues/browse/PCBC-141&quot; title=&quot;1.1 dp releases not working on phps which do not export the symbol php_json_encode&quot;&gt;&lt;strike&gt;PCBC-141&lt;/strike&gt;&lt;/a&gt;).  Here&amp;#39;s a summary from the discussion on the documentation (Thanks to Mark Nunberg).&lt;br/&gt;
&lt;br/&gt;
------------&lt;br/&gt;
PHP distributions which have JSON *built in*, (This includes Debian-based distributions, and Windows binary releases), the only thing required is to have a *SINGLE* line&lt;br/&gt;
extension=couchbase.so&lt;br/&gt;
For PHP distributions which have JSON as a *module* (This includes Red Hat EL-based distributions, as noted above), there are two required lines in this very&lt;br/&gt;
extension=json.so&lt;br/&gt;
extension=couchbase.so&lt;br/&gt;
&lt;br/&gt;
[ As a side note, for Windows users, one might need to substitute &amp;#39;couchbase.so&amp;#39; with &amp;#39;couchbase.dll&amp;#39;, or &amp;#39;php_couchbase.dll&amp;#39; (not sure which one) ].&lt;br/&gt;
&lt;br/&gt;
We will refer to these incantations (for the purpose of this discussion thread) as &amp;#39;one-line&amp;#39; and &amp;#39;two-line&amp;#39;&lt;br/&gt;
&lt;br/&gt;
If one places a one-line incantation where the two-line is required, they will get a cryptic message to the effect of:&lt;br/&gt;
&lt;br/&gt;
unable to load couchbase.so: cannot find symbol &amp;#39;php_json_decode&amp;#39;&lt;br/&gt;
(the exact text might be different.. I will try and give an exact quote). At which point the couchbase extension will be unavailable)&lt;br/&gt;
&lt;br/&gt;
If one places the two-line incantation where a one-line is required, they will receive a harmless warning stating:&lt;br/&gt;
&lt;br/&gt;
extension &amp;#39;json&amp;#39; already loaded&lt;br/&gt;
(again, this might not be the exact text)&lt;br/&gt;
--------&lt;br/&gt;
&lt;br/&gt;
</comment>
                    <comment id="45030" author="perry" created="Thu, 29 Nov 2012 14:40:20 -0600"  >So this needs to be reopened right?  because it requires us to build a specific a package for RHEL 5.4?</comment>
                    <comment id="45040" author="ingenthr" created="Thu, 29 Nov 2012 17:06:34 -0600"  >Correct, needs to be reopened.&lt;br/&gt;
&lt;br/&gt;
A workaround for now would be to download the PHP 1.0.6 source, build, test and release.  Source is available from:&lt;br/&gt;
&lt;a href=&quot;https://github.com/couchbase/php-ext-couchbase/archive/1.0.6.tar.gz&quot;&gt;https://github.com/couchbase/php-ext-couchbase/archive/1.0.6.tar.gz&lt;/a&gt;&lt;br/&gt;
&lt;br/&gt;
The included README covers how to build/test.  It does require a php development environment, which is a separate package on RH.  Usually I think it&amp;#39;s php54-devel, but I&amp;#39;d have to check.</comment>
                    <comment id="45041" author="ingenthr" created="Thu, 29 Nov 2012 17:07:12 -0600"  >Though, I should have said, I think in this original bug, there were multiple issues.  I&amp;#39;m going to close this one and open a specific issue for support of PHP 5.4.</comment>
                    <comment id="45043" author="ingenthr" created="Thu, 29 Nov 2012 17:36:33 -0600"  >See tracking of support of PHP 5.4 in &lt;a href=&quot;http://www.couchbase.com/issues/browse/PCBC-151&quot; title=&quot;support PHP 5.4&quot;&gt;&lt;strike&gt;PCBC-151&lt;/strike&gt;&lt;/a&gt;.</comment>
                    <comment id="48613" author="alkavan" created="Fri, 25 Jan 2013 08:06:33 -0600"  >I just had the same issue when install on CentOS 6.3&lt;br/&gt;
the solution thanhbv offered worked although all tested failed !&lt;br/&gt;
i did:&lt;br/&gt;
make install&lt;br/&gt;
mv /etc/php.d/json.ini /etc/php.d/0json.ini&lt;br/&gt;
&lt;br/&gt;
then phpinfo();&lt;br/&gt;
[&lt;a href=&apos;mailto:root@null&apos;&gt;root@null&lt;/a&gt; ~]# php phpinfo.php  | grep couch&lt;br/&gt;
/etc/php.d/couchbase.ini,&lt;br/&gt;
couchbase&lt;br/&gt;
couchbase support =&amp;gt; enabled&lt;br/&gt;
couchbase.compression_factor =&amp;gt; 1.3 =&amp;gt; 1.3&lt;br/&gt;
couchbase.compression_threshold =&amp;gt; 2000 =&amp;gt; 2000&lt;br/&gt;
couchbase.compressor =&amp;gt; none =&amp;gt; none&lt;br/&gt;
couchbase.durability_default_poll_interval =&amp;gt; 100000 =&amp;gt; 100000&lt;br/&gt;
couchbase.durability_default_timeout =&amp;gt; 40000000 =&amp;gt; 40000000&lt;br/&gt;
couchbase.serializer =&amp;gt; php =&amp;gt; php&lt;br/&gt;
couchbase.view_timeout =&amp;gt; 75 =&amp;gt; 75&lt;br/&gt;
OLDPWD =&amp;gt; /root/php-ext-couchbase&lt;br/&gt;
_SERVER[&amp;quot;OLDPWD&amp;quot;] =&amp;gt; /root/php-ext-couchbase&lt;br/&gt;
&lt;br/&gt;
Using the compiled one from the site did not work.</comment>
                </comments>
                    <attachments>
                    <attachment id="15057" name="phpinfo.html" size="70320" author="thanhbv" created="Sat, 15 Sep 2012 00:08:36 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                                                                                                                                                    <customfield id="customfield_10081" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Rank</customfieldname>
                <customfieldvalues>
                    <customfieldvalue>9796</customfieldvalue>
                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10181" key="com.atlassian.jira.ext.charting:timeinstatus">
                <customfieldname>Time In Status</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                </customfields>
    </item>
</channel>
</rss>