ionCube and Xcache conflict
A problem we came across while trying to install ionCube on our development environment.
To begin, I’m not a huge fan of Magento modules that are encoded with things like ionCube. We at AlterWeb think that if we make and sell a module, the customer has the right to change the module to there needs if they need to. Another thing we don’t like about those modules is that we can’t check what the module is exactly doing and if we have to worry about security or performance issues.
That said, sometimes we have to come off our high horses and work with a module that is encoded with ionCube for our customers benefits.
HTTP Error 500 (Internal Server Error)
So I tried to install ionCube on my development server by downloading the ionCube loader on my server in the right directory (/usr/local/ioncube/ioncube_loader_lin_5.5.so) and adding the following line to my php.ini:
I was a little surprised by the simplicity of this installation process because I could remember a previous time where I tried to install ionCube on my Macbook and it took me hours (I don’t know what I was doing that time but this looked so easy).
But then it came. I refreshed my browser and saw a "HTTP Error 500 (Internal Server Error)". Not a very useful error message so I took a look at my server log. It showed the following messages:
- [Thu May 21 15:29:34.524859 2015] [fcgid:warn] [pid 25424] (104)Connection reset by peer: [client IP*.***.***.***:33980] mod_fcgid: error reading data from FastCGI server
- [Thu May 21 15:29:34.524993 2015] [core:error] [pid 25424] [client IP*.***.***.***:33980] End of script output before headers: index.php
Unfortunately this was also not very helpful to me :-(.
Let’s fast forward to the solution because all my hours after that, where thrown away by searching DuckDuckGo / Google for people with the same problem (and I was hoping, a solution). But without any luck. So I eventually contacted the support helpdesk of ionCube to ask for there help. Within an hour I got a mail asking for more information and after another hour they send me a mail with the solution.
The problem seems to be that there is a conflict between the XCache module (recommended in the tutorial I was talking about in the beginning) and the latest ionCube Loader (5.0.6) due to the way XCache works and the need for the Loader to be the first extension loaded. So I removed the "/etc/php5/cgi/conf.d/20-xcache.ini" file so XCache isn't loaded anymore and the problem was gone.
Of course I was wondering if disabling XCache was a problem. So I did a little digging and found that PHP 5.5 (the version coming with Ubuntu 14.04) is coming with his own opcache. And if I have to believe this source, it's beating XCache.
I would like to thank the support helpdesk of ionCube for there quick and helpful response. I wish there where more companies that had such a great support team!
The support helpdesk of ionCube has sent me a email that they have launched a new version (5.0.7) of there loader that works around the issue with XCache.