<!-- 
RSS generated by JIRA (5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9) at Tue Jun 18 19:28:51 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-141/PCBC-141.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-141] 1.1 dp releases not working on phps which do not export the symbol php_json_encode</title>
                <link>http://www.couchbase.com/issues/browse/PCBC-141</link>
                <project id="10049" key="PCBC">Couchbase PHP client library</project>
                        <description>This affects all php binaries which do not have the symbol &amp;quot;php_json_encode&amp;quot;. This includes EL5 and EL6 based linux distributions&lt;br/&gt;
&lt;br/&gt;
The library cannot load because the symbol is not found. Disabling using this symbol also means preventing views from functioning (as well as JSON serialization).&lt;br/&gt;
&lt;br/&gt;
I&amp;#39;d like to note that this is not our bug and not our fault. We are probably not the only extension relying on php_json* functions, and package creators (specifically redhat) should expose this symbol.&lt;br/&gt;
&lt;br/&gt;
Additionally, our configure script checks to see if the PHP_JSON_* constants are defined (and if not, compiles out the relevant code from views - this would make views not work, but not prevent the library from loading).&lt;br/&gt;
&lt;br/&gt;
In any event, we should find a way to work around this, as this bug has been seen quite a bit.&lt;br/&gt;
&lt;br/&gt;
One possible solution would be to call the php-level json encoding function. It may incur a  bit of overhead from calling into php, but the function itself is more likely to be there.</description>
                <environment></environment>
            <key id="20611">PCBC-141</key>
            <summary>1.1 dp releases not working on phps which do not export the symbol php_json_encode</summary>
                <type id="1" iconUrl="http://www.couchbase.com/issues/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.couchbase.com/issues/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.couchbase.com/issues/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="3">Duplicate</resolution>
                    <security id="10011">Public</security>
                        <assignee username="ingenthr">Matt Ingenthron</assignee>
                                <reporter username="mnunberg">Mark Nunberg</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Nov 2012 17:55:57 -0600</created>
                <updated>Fri, 10 May 2013 02:43:07 -0500</updated>
                    <resolved>Fri, 10 May 2013 02:43:07 -0500</resolved>
                            <version>1.1.0-dp5</version>
                                <fixVersion>1.1.0</fixVersion>
                                <component>library</component>
                                <votes>0</votes>
                        <watches>2</watches>
                                                    <comments>
                    <comment id="43517" author="mnunberg" created="Wed, 7 Nov 2012 17:56:34 -0600"  >Currently the only workaround is to compile your own php</comment>
                    <comment id="43518" author="ingenthr" created="Wed, 7 Nov 2012 18:01:36 -0600"  >One other solution that I&amp;#39;d be okay with is to simply uplevel our minimum version of CentOS/RHEL.  Unless there&amp;#39;s significant pushback, I really don&amp;#39;t see any reason to keep people living with ancient code for longer and longer periods of time.  &lt;br/&gt;
&lt;br/&gt;
Dissenting opinions accepted, but at some point you have to say &amp;quot;we don&amp;#39;t support that because it&amp;#39;s broken&amp;quot;, right?&lt;br/&gt;
&lt;br/&gt;
Do you think it&amp;#39;s likely that some minimum 5.x EL is fixed enough?  Or there&amp;#39;s some patchlevel that is fixed enough?&lt;br/&gt;
&lt;br/&gt;
If on the other hand, it&amp;#39;s just conscious decision to not expose that symbol and it&amp;#39;s only supported through PHP land, then calling up there as a workaround seems okay by me.  </comment>
                    <comment id="43519" author="ingenthr" created="Wed, 7 Nov 2012 18:02:43 -0600"  >Assigning this to the subject matter expert for now.  Will hopefully pick it back up soon.</comment>
                    <comment id="43520" author="ingenthr" created="Wed, 7 Nov 2012 18:04:57 -0600"  >One other question, I don&amp;#39;t think so, but is this possibly related to need to put the ini for loading the extension after the php_json as an extension?&lt;br/&gt;
&lt;br/&gt;
Another possible workaround is that if the license is permissive enough, we could just suck in the parts we need?  Possible API/ABI issues here I guess, but hard to say.</comment>
                    <comment id="43521" author="ingenthr" created="Wed, 7 Nov 2012 18:10:18 -0600"  >Duh, I see you proactively addressed the &amp;quot;which release&amp;quot; in the original description.  Thanks for that.</comment>
                    <comment id="43522" author="mnunberg" created="Wed, 7 Nov 2012 18:11:56 -0600"  >I&amp;#39;ve explored that possibility. The problem is that on rhel and centos don&amp;#39;t export that symbol. EPEL actually contains a json.so (php-pecl-json), but much to our my chagrin, it does not export that symbol either.&lt;br/&gt;
&lt;br/&gt;
I was thinking about sticking the significant bits inside our own code.. it&amp;#39;d probably be easier to just call the php level function though..&lt;br/&gt;
&lt;br/&gt;
This does seem to be a conscious decision by redhat - as this happens in CentOS 6.3 (EL6) as well. So this is obviously not fixed anywhere.</comment>
                    <comment id="43736" author="mnunberg" created="Sat, 10 Nov 2012 01:37:16 -0600"  >&lt;a href=&quot;http://review.couchbase.org/#/c/22425/&quot;&gt;http://review.couchbase.org/#/c/22425/&lt;/a&gt;</comment>
                    <comment id="43747" author="mnunberg" created="Sat, 10 Nov 2012 16:06:51 -0600"  >The problem is a bit more intricate it seems :)&lt;br/&gt;
&lt;br/&gt;
Apparently some of the json.so modules I&amp;#39;ve seen *do* export the php_json_* functions. HOWEVER, apparently php loads these modules with a line similar to dlopen(mod, RTLD_LOCAL..) making their symbols unavailable for other modules to use.&lt;br/&gt;
&lt;br/&gt;
A more complex workaround:&lt;br/&gt;
&lt;br/&gt;
static void (*_json_encode)(smart_str*, zval*, int TSRMLS_DC) = NULL;&lt;br/&gt;
static void (*_json_decode)(zval*, char*, int, zend_bool, long TSRMLS_DC) = NULL;&lt;br/&gt;
&lt;br/&gt;
static void _init_json_symbols(void)&lt;br/&gt;
{&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;zend_module_entry *m_ent;&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;int ret;&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (_json_encode) {&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;return;&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt;
&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ret = zend_hash_find(&amp;amp;module_registry, &amp;quot;json&amp;quot;, sizeof(&amp;quot;json&amp;quot;), (void**)&amp;amp;m_ent);&lt;br/&gt;
&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (ret == FAILURE) {&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;fprintf(stderr, &amp;quot;Couldn&amp;#39;t load extension..\n&amp;quot;);&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;abort();&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt;
&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_json_encode = DL_FETCH_SYMBOL(m_ent-&amp;gt;handle, &amp;quot;php_json_encode&amp;quot;);&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_json_decode = DL_FETCH_SYMBOL(m_ent-&amp;gt;handle, &amp;quot;php_json_decode&amp;quot;);&lt;br/&gt;
&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (_json_encode == NULL || _json_decode == NULL) {&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;fprintf(stderr, &amp;quot;Coudln&amp;#39;t find JSON handles!: %s\n&amp;quot;, dlerror());&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;abort();&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt;
}&lt;br/&gt;
&lt;br/&gt;
void php_json_encode(smart_str *buf, zval *value, int options TSRMLS_DC)&lt;br/&gt;
{&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_init_json_symbols();&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_json_encode(buf, value, options TSRMLS_CC);&lt;br/&gt;
}&lt;br/&gt;
&lt;br/&gt;
void php_json_decode(zval *out, char *buf, int len, zend_bool assoc, long depth TSRMLS_DC)&lt;br/&gt;
{&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_init_json_symbols();&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_json_decode(out, buf, len, assoc, depth TSRMLS_CC);&lt;br/&gt;
}&lt;br/&gt;
</comment>
                    <comment id="43755" author="ingenthr" created="Sun, 11 Nov 2012 09:53:48 -0600"  >Very interesting.  Why is this done only on RHEL/CentOS?  We should check with some PHP internals folks before we go too far here.  Maybe there&amp;#39;s some subtlety we don&amp;#39;t understand. </comment>
                    <comment id="43756" author="Pierre" created="Sun, 11 Nov 2012 10:26:20 -0600"  >hi!&lt;br/&gt;
&lt;br/&gt;
Not sure what RHEL5/6 does but PHP 5.3.2 has these APIs exported since the very 1st day:&lt;br/&gt;
&lt;br/&gt;
&lt;a href=&quot;https://github.com/php/php-src/blob/php-5.3.2/ext/json/php_json.h&quot;&gt;https://github.com/php/php-src/blob/php-5.3.2/ext/json/php_json.h&lt;/a&gt;&lt;br/&gt;
&lt;br/&gt;
Also json has always been a default extension in PHP, again something wrong at RHEL.&lt;br/&gt;
&lt;br/&gt;
I would suggest to add a configure check to see if it is exposed and refused to compile if it is missing. To me it is a bug in RHEL (not the 1st weird one :) and would not begin to duplicate code around (especially not for json, to ensure 100% compatibility and get all fixes in time).</comment>
                    <comment id="43757" author="mnunberg" created="Sun, 11 Nov 2012 11:09:01 -0600"  >The real problem is in the first line I mentioned; and it might be a change in the arguments of dlopen. If the json extension is truly loaded before the couchbase one, then the couchbase ext *should* find the appropriate symbols to use.&lt;br/&gt;
&lt;br/&gt;
However it seems that for RHEL (I haven&amp;#39;t checked on debian.. debian builds the json ext into the php executable itself, rhel provides it as a loadable module) even though the json extension is already loaded, because there is something weird with either the way it uses dlopen (default php header macro for DL_LOAD uses RTLD_GLOBAL, i.e. make the symbols global to the entire app.. but it might be that RHEL uses RTLD_LOCAL...).&lt;br/&gt;
&lt;br/&gt;
But we&amp;#39;re not duplicating code here and I personally like the call-to-php solution (even though it&amp;#39;s not the most elegant, it&amp;#39;s the most predictable/reliable. For example, I don&amp;#39;t know how the snippet in my last post would work on a php that doesn&amp;#39;t have json as a DSO)</comment>
                    <comment id="43766" author="mnunberg" created="Sun, 11 Nov 2012 13:49:56 -0600"  >So it seems we&amp;#39;re (or is it only me) looking at it from multiply wrong ways :)&lt;br/&gt;
&lt;br/&gt;
(1) RHEL (and debian) modify the default php DL_LOAD from using RTLD_LAZY (which would have avoided giving us this error) to RTLD_NOW&lt;br/&gt;
&lt;br/&gt;
(2) On Debian this is not a problem (at least not for JSON) since it&amp;#39;s compiled into the php binary&lt;br/&gt;
&lt;br/&gt;
(3) Even on RHEL, placing extension=json.so before extension=couchbase.so seems to do the trick. This is mentioned in the documentation&lt;br/&gt;
&lt;br/&gt;
(4) For tests, run-tests.php will not work. Unless a specifically crafted ini file is written, run-tests.php will not load the json extension at all. Defining an extra -d parameter will load the json extension; however the script counter-intuitively *appends* this option to the commandline, so one thus effectively has:&lt;br/&gt;
&lt;br/&gt;
-d extension=couchbase.so -d extension=json.so&lt;br/&gt;
&lt;br/&gt;
Coupled with RTLD_NOW, this fails.&lt;br/&gt;
&lt;br/&gt;
I&amp;#39;d still like to fix this in code; as this is a fairly confusing matter; if only to be able to print out a more meaningful user message.</comment>
                    <comment id="43767" author="Pierre" created="Sun, 11 Nov 2012 15:40:31 -0600"  >1) Not sure that should cause this error, as long as the loading order is respected.&lt;br/&gt;
&lt;br/&gt;
2) Debian does it right. JSON is a default builtin extension and should always be available, not optionally.&lt;br/&gt;
&lt;br/&gt;
3) Yes, loading order, that should be documented as such in the couchbase install documentation&lt;br/&gt;
&lt;br/&gt;
4) yes, it is expected, also using a php.ini is always a good thing, to avoid tests failure due to random php.ini being caught&lt;br/&gt;
&lt;br/&gt;
There is nothing to fix in couchbase, calling user land function is horribly slow and should really not be done for such thing.</comment>
                    <comment id="43768" author="mnunberg" created="Sun, 11 Nov 2012 16:06:27 -0600"  >The fix here would be to make users understand this a bit better.&lt;br/&gt;
&lt;br/&gt;
The point isn&amp;#39;t that something is broken, but rather that something is confusing. This issue is hinted in the couchbase ext documentation, but seems to be passed over by quite a few people who have run into this.&lt;br/&gt;
&lt;br/&gt;
This seems like a very subtle configuration aspect which users shouldn&amp;#39;t have to encounter; or at least something in which we&amp;#39;d be able to show the user an error message.&lt;br/&gt;
&lt;br/&gt;
So without going into a debate of terminology about what&amp;#39;s &amp;quot;broken&amp;quot; and whose &amp;quot;fault&amp;quot; it is, this is something that lots of users are seeing, and shouldn&amp;#39;t. Such fine minutiae really isn&amp;#39;t easy to pick up.&lt;br/&gt;
&lt;br/&gt;
Another option would have been to load the symbols dynamically from either the binary or from the loaded library (depending on the configuration) - however &amp;#39;php_json_decode&amp;#39; is now no longer an exported symbol (it&amp;#39;s defined in the header as an inline wrapper around php_json_decode_ex) in some versions.</comment>
                    <comment id="43770" author="Pierre" created="Sun, 11 Nov 2012 16:16:37 -0600"  >ext dependencies are a very common issue in php, this is well documented. I won&amp;#39;t change anything in the code (causing more arms) and clearly document that the json ext, for old broken (it is broken, as it must be builtin and always enabled) distribution packages.</comment>
                    <comment id="43771" author="ingenthr" created="Sun, 11 Nov 2012 16:27:25 -0600"  >Thanks for all the help here Pierre.&lt;br/&gt;
&lt;br/&gt;
According to Mark, this doesn&amp;#39;t affect only old, broken distribution packages.  It&amp;#39;s even in recent RHEL6*.&lt;br/&gt;
&lt;br/&gt;
Just to fix this with the simplest, most supportable solution perhaps we should test the function at startup time and if it&amp;#39;s not there log and exit appropriately?  If the distro is loading that lazily, and people want to use that distro, then they need to configure their PHP .ini&amp;#39;s correctly, right?&lt;br/&gt;
&lt;br/&gt;
Our log message can be explicit even, saying &amp;quot;make sure json whatever is loaded first with your php.ini&amp;quot;.  &lt;br/&gt;
&lt;br/&gt;
Thoughts?&lt;br/&gt;
&lt;br/&gt;
* which maybe is arguably old, broken, but it&amp;#39;s also arguably not since it&amp;#39;s the most recent thing shipped on this particular distro fork</comment>
                    <comment id="43772" author="ingenthr" created="Sun, 11 Nov 2012 16:29:11 -0600"  >Pierre: one other question-- any &amp;#39;prior art&amp;#39; here?  In other words, surely some other extension must rely on json and has an approach?</comment>
                    <comment id="43773" author="mnunberg" created="Sun, 11 Nov 2012 16:40:52 -0600"  >Unfortunately there is no way to configure RHEL&amp;#39;s php to load things lazily.&lt;br/&gt;
&lt;br/&gt;
RHEL Specifically mangles this.&lt;br/&gt;
&lt;br/&gt;
I know the patch says 5.0.4, but this is still in php-5.3.3-14.el6_3.src.rpm:&lt;br/&gt;
&lt;br/&gt;
--- php-5.0.4/Zend/zend.h.dlopen&lt;br/&gt;
+++ php-5.0.4/Zend/zend.h&lt;br/&gt;
@@ -102,11 +102,11 @@&lt;br/&gt;
&amp;nbsp;# endif&lt;br/&gt;
&lt;br/&gt;
&amp;nbsp;# if defined(RTLD_GROUP) &amp;amp;&amp;amp; defined(RTLD_WORLD) &amp;amp;&amp;amp; defined(RTLD_PARENT)&lt;br/&gt;
-#  define DL_LOAD(libname)                     dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)&lt;br/&gt;
+#  define DL_LOAD(libname)                     dlopen(libname, RTLD_NOW | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)&lt;br/&gt;
&amp;nbsp;# elif defined(RTLD_DEEPBIND)&lt;br/&gt;
-#  define DL_LOAD(libname)                     dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)&lt;br/&gt;
+#  define DL_LOAD(libname)                     dlopen(libname, RTLD_NOW | RTLD_GLOBAL | RTLD_DEEPBIND)&lt;br/&gt;
&amp;nbsp;# else&lt;br/&gt;
-#  define DL_LOAD(libname)                     dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)&lt;br/&gt;
+#  define DL_LOAD(libname)                     dlopen(libname, RTLD_NOW | RTLD_GLOBAL)&lt;br/&gt;
&amp;nbsp;# endif&lt;br/&gt;
&amp;nbsp;# define DL_UNLOAD                                     dlclose&lt;br/&gt;
&amp;nbsp;# if defined(DLSYM_NEEDS_UNDERSCORE)&lt;br/&gt;
~                                                                                                                                    &lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
So basically by the time our library loads, if it utilizes a bare &amp;#39;json_decode&amp;#39; that reference is resolved immediately; our module has no chance to warn.</comment>
                    <comment id="43820" author="ingenthr" created="Mon, 12 Nov 2012 14:36:18 -0600"  >Given there is no good solution, for now we&amp;#39;ll need to document this one very, very well.</comment>
                    <comment id="43821" author="kzeller" created="Mon, 12 Nov 2012 14:46:39 -0600"  >I don&amp;#39;t do the release notes for individual SDK libraries.</comment>
                    <comment id="43847" author="ingenthr" created="Mon, 12 Nov 2012 16:48:33 -0600"  >This isn&amp;#39;t a release note item, this is a PHP documentation item.  This needs to be added to the getting started guide with a really clear description of what the issue is and how to work around it for RHEL/CentOS.  &lt;br/&gt;
&lt;br/&gt;
I think you&amp;#39;re still able to help us with PHP documentation, right?</comment>
                    <comment id="43849" author="kzeller" created="Mon, 12 Nov 2012 16:53:13 -0600"  >I see. Do you want this to go as a note during the platform-specific install section under RHEL/Centos?</comment>
                    <comment id="43853" author="ingenthr" created="Mon, 12 Nov 2012 17:10:20 -0600"  >I&amp;#39;ll follow the docs team&amp;#39;s guidance on how best to present the info.&lt;br/&gt;
&lt;br/&gt;
Just be aware that it&amp;#39;s something we&amp;#39;ve frequently hit and nearly every CentOS/RHEL user will hit it too.  It&amp;#39;s not our bug really that we can&amp;#39;t make it simpler.  It&amp;#39;s a limitation in current PHP extension loading.&lt;br/&gt;
&lt;br/&gt;
That&amp;#39;s why I think it needs to be covered in the appropriate section of the getting started guide, which is both on the web site (&lt;a href=&quot;http://www.couchbase.com/develop/php/next&quot;&gt;http://www.couchbase.com/develop/php/next&lt;/a&gt;) and in our documentation (&lt;a href=&quot;http://www.couchbase.com/docs/couchbase-sdk-php-1.1/download.html&quot;&gt;http://www.couchbase.com/docs/couchbase-sdk-php-1.1/download.html&lt;/a&gt; and &lt;a href=&quot;http://www.couchbase.com/docs/couchbase-sdk-php-1.1/installation-verification.html)&quot;&gt;http://www.couchbase.com/docs/couchbase-sdk-php-1.1/installation-verification.html)&lt;/a&gt;.  Most people will hit it when following either of those.&lt;br/&gt;
&lt;br/&gt;
Our web pages currently have the following note:&lt;br/&gt;
Note: With the PHP packages on many Red Hat/CentOS distributions (and possibly others), PHP&amp;#39;s JSON encoding is not available to other extensions by default. As a result, you may see an error resolving the php_json_encode symbol. The solution is to edit ini file that loads the JSON extension (typically /etc/php.d/json.ini) to add the Couchbase extension after the JSON extension.&lt;br/&gt;
&lt;br/&gt;
Something along these lines (but improved, if you think need be) should be added to the getting started guide in the documentation.</comment>
                    <comment id="43854" author="ingenthr" created="Mon, 12 Nov 2012 17:13:09 -0600"  >Note, Pierre replied via email to my &amp;#39;prior art&amp;#39; question:&lt;br/&gt;
&lt;br/&gt;
No, ext dep manager is a long due todo but much easier to document than to implement.&lt;br/&gt;
&lt;br/&gt;
Other core exts have this, exif and mbstring, pdo exts and the sin pdo ext (which should be builtin but rhel and defiant made it wrong 1st)</comment>
                    <comment id="43991" author="kzeller" created="Wed, 14 Nov 2012 12:56:17 -0600"  >Hi,&lt;br/&gt;
&lt;br/&gt;
I&amp;#39;m adding this. Do we have an example of the php_json_encode error that you will get? Need to add this to the section.</comment>
                    <comment id="44002" author="kzeller" created="Wed, 14 Nov 2012 13:15:58 -0600"  >Added to getting started/install as:&lt;br/&gt;
&lt;br/&gt;
&amp;quot;If you are using the PHP SDK on a Linux distribution such as Red Hat/CentOS, be aware that JSON encoding for PHP is by default not available to other extensions. As a result you will receive an error resolving the php_json_encode symbol. The solution is to edit the .ini file that loads the JSON extension to add the Couchbase extension after the JSON extension. For instance, if your JSON extension is at /etc/php.d/json.ini, add the following line to the file under extensions:&lt;br/&gt;
&lt;br/&gt;
extension=/path/to/couchbase.so&amp;quot;</comment>
                    <comment id="44003" author="kzeller" created="Wed, 14 Nov 2012 13:16:26 -0600"  >Added to getting started and install for PHP 1.1:&lt;br/&gt;
&lt;br/&gt;
If you are using the PHP SDK on a Linux distribution such as Red Hat/CentOS, be aware that JSON encoding for PHP is by default not available to other extensions. As a result you will receive an error resolving the php_json_encode symbol. The solution is to edit the .ini file that loads the JSON extension to add the Couchbase extension after the JSON extension. For instance, if your JSON extension is at /etc/php.d/json.ini, add the following line to the file under extensions:&lt;br/&gt;
&lt;br/&gt;
extension=/path/to/couchbase.so</comment>
                    <comment id="44908" author="ingenthr" created="Wed, 28 Nov 2012 00:08:52 -0600"  >Karen: per the email thread with Mark Nunberg the other day, can we update this to have the two line recommendation?  Perhaps that&amp;#39;s what you&amp;#39;ve already done?</comment>
                    <comment id="44935" author="kzeller" created="Wed, 28 Nov 2012 11:30:24 -0600"  >Oh yes, I did update per Mark&amp;#39;s email several days ago. It is now:&lt;br/&gt;
&lt;br/&gt;
Depending on the platform you are using, you may also need to reference the JSON library in your PHP configuration file.&lt;br/&gt;
&lt;br/&gt;
If you are using the Couchbase PHP SDK on Red Hat/CentOS or their derivatives, be aware that JSON encoding for PHP is by default not available to other extensions. As a result you will receive an error resolving the php_json_encode symbol. The solution is to edit the php.ini file to load the JSON library and also load the Couchbase library. For instance, if your extensions are at /etc/php.ini, add the following two lines to the file:&lt;br/&gt;
&lt;br/&gt;
extension=/path/to/json.so&lt;br/&gt;
extension=/path/to/couchbase.so&lt;br/&gt;
The reference to the two extensions must be in this specific order.&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
You can see it here:&lt;br/&gt;
&lt;br/&gt;
&lt;a href=&quot;http://www.couchbase.com/docs/couchbase-sdk-php-1.1/download.html&quot;&gt;http://www.couchbase.com/docs/couchbase-sdk-php-1.1/download.html&lt;/a&gt;</comment>
                    <comment id="44936" author="kzeller" created="Wed, 28 Nov 2012 11:30:44 -0600"  >Oh yes, I did update per Mark&amp;#39;s email several days ago. It is now:&lt;br/&gt;
&lt;br/&gt;
Depending on the platform you are using, you may also need to reference the JSON library in your PHP configuration file.&lt;br/&gt;
&lt;br/&gt;
If you are using the Couchbase PHP SDK on Red Hat/CentOS or their derivatives, be aware that JSON encoding for PHP is by default not available to other extensions. As a result you will receive an error resolving the php_json_encode symbol. The solution is to edit the php.ini file to load the JSON library and also load the Couchbase library. For instance, if your extensions are at /etc/php.ini, add the following two lines to the file:&lt;br/&gt;
&lt;br/&gt;
extension=/path/to/json.so&lt;br/&gt;
extension=/path/to/couchbase.so&lt;br/&gt;
The reference to the two extensions must be in this specific order.&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
You can see it here:&lt;br/&gt;
&lt;br/&gt;
&lt;a href=&quot;http://www.couchbase.com/docs/couchbase-sdk-php-1.1/download.html&quot;&gt;http://www.couchbase.com/docs/couchbase-sdk-php-1.1/download.html&lt;/a&gt;</comment>
                    <comment id="46067" author="creotiv" created="Mon, 17 Dec 2012 07:15:34 -0600"  >Use version 1.1.1 of client lib and still get this error even when couchbase.so loaded after json.so&lt;br/&gt;
&lt;br/&gt;
CentOS 5.6, PHP 5.2.17, Couchbase 1.8</comment>
                    <comment id="46075" author="kzeller" created="Mon, 17 Dec 2012 11:29:34 -0600"  >Hi Matt,&lt;br/&gt;
&lt;br/&gt;
This was reported as an technical issue still with PHP SDK:&lt;br/&gt;
&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;[ &lt;a href=&quot;http://www.couchbase.com/issues/browse/PCBC-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=46067#comment-46067&quot;&gt;http://www.couchbase.com/issues/browse/PCBC-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;amp;focusedCommentId=46067#comment-46067&lt;/a&gt; ]&lt;br/&gt;
&lt;br/&gt;
Andrey Nikishaev commented on &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;:&lt;br/&gt;
---------------------------------------&lt;br/&gt;
&lt;br/&gt;
Use version 1.1.1 of client lib and still get this error even when couchbase.so loaded after json.so</comment>
                    <comment id="46081" author="mnunberg" created="Mon, 17 Dec 2012 12:01:27 -0600"  >what&amp;#39;s the exact error you&amp;#39;re getting?&lt;br/&gt;
&lt;br/&gt;
Maybe the json module needs to be installed as well? (I&amp;#39;ll need to check this) --&lt;br/&gt;
</comment>
                    <comment id="46118" author="ingenthr" created="Mon, 17 Dec 2012 16:57:15 -0600"  >Andrey: We do not support PHP 5.2, so you&amp;#39;ll want to try 5.3 or later.  CentOS 5.6 does have, if I recall correctly, a &amp;quot;php53&amp;quot; package.</comment>
                    <comment id="57788" author="trond" created="Fri, 10 May 2013 02:43:07 -0500"  >There are multiple bugs reported for this issue</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                                                                                                                                                    <customfield id="customfield_10081" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Rank</customfieldname>
                <customfieldvalues>
                    <customfieldvalue>9798</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>