Installing ionCube PHP Loader on Bluehost

I’m an avid WordPress user (every site I start up and run, and many of my clients’ sites as well) and when installing a new Plugin this morning I ran into a little problem. After about an hour of fiddling around on various FAQs and forum topics, I was able to deduce a solution. And rather than dust myself off and walk away, I’m posting this so that others might have an easier time than I did.

Now, first a little bit more detail might be necessary. The exact error I ran into was this:

Site error: the file (filename) requires the ionCube PHP Loader ioncube_loader_lin_5.2.so to be installed by the site administrator.

(If anyone cares, this happened when installing a Plugin called WP-Member to a blog I run called Frontending. More on the relevancy of adding in that Plugin before long :).)

Nobody likes errors. When I saw this I did what any able minded person of the modern world would do. I Google’d it. Odds are that you might have discovered this very post by running a search like I did.

Walking through the solution

It should be said, although the post title says so, that this solution is only likely to work when you are hosted by Bluehost. As I am, this is how I figured it out.

So what is ionCube? Apparently it’s a PHP encoder of some sort, that certain applications use in order to run. In my research I was able to see a couple of examples, one where a Joomla plugin was the culprit, in other cases a WordPress Plugin called Fedafi. Basically the host is only set up with the basics of ionCube, and we need to supplement it. 

Open up your site in an FTP client and browse to the topmost level. This is the level that lists public_html as a folder. You should see a folder called ioncube. Crack that sucker open and you should see two files (at least), ioncube_loader_lin_ts.so and ioncube_loader_lin.so. You probably won’t see the ioncube_loader_lin_5.2.so file mentioned in the error message. That makes sense, right?

Run over to the ionCube site and grab the appropriate zip full of the loader you need. Now, in order to determine which of the files you should download, you’ll need to know your server’s OS and architecture. You can find this located in your Bluehost Cpanel along the left sidebar. Mine is running on Linux (OS) and x86_64 (architecture). Find your own and grab the corresponding zip file from the ionCube loaders page.

Unzip and throw the two files with 5.2 at the end into your site’s ioncube folder, the one we identified a minute ago. Now we should be good, right? Well, almost.

Traversing php.ini

Odds are that you’ve heard of php.ini at one point or another, most likely when editing it (or at times creating it) in order to increase the size of files you can upload to your site. Before stepping into this dunghole of a problem myself, I had only ever modified php.ini in order to do that. Now, it’s time for a bit more of an understanding of how php.ini works in cooperation with Bluehost’s Cpanel.

In your Bluehost Cpanel, jump into PHP Config. I usually just run a find/text search on the page to see where it’s located. You should see three options, like in the image below:

 

First, pay attention to the first three options regarding the PHP you are running.

First, pay attention to the first three options regarding the PHP you are running.

You can see that, in my case, I’m now running PHP5 with FastCGI. There is a lot having to do with this decision that I won’t cover here, but one reason related to the issue at hand is that we want to be able to only have to deal with one instance of php.ini, and not copy it ourselves into every directory that will be using it. That would just be a pain in the ass. (Note that choosing FastCGI is not necessary for this to work, but it makes it a bit less painful, I think.)

Assuming that you don’t have any major modifications done to your php.ini file, go ahead and hit the “Install php.ini Master File” button, after selecting IonCube from the options above it. Keep in mind that if you do have any worthwhile modifications done to php.ini, you can just copy them and paste them into your new php.ini file when it’s there.

Take a look into your public_html folder. There should now be a php.ini.default file. Kill the file ending so it is just php.ini. Now download it and open it up so that we can make the modification we need to.

Toward the bottom of your php.ini file you should see the references to the basic ionCube loaders. It should look something like this:

 

Note that the path referencing the ioncube files may be slightly different for you.

Note that the path referencing the ioncube files may be slightly different for you.

At line 118 and 119, we see the references to the two files that were originally in use at our site. But we want to add two more, two references to the two 5.2 files that we added.

The key here is to maintain the nomenclature of line 118, but duplicate it for the two new files. So we’re going to add two lines that look like this: zend_extension=/home/sitename/ioncube/filename. We’re also going to add them directly after the [Zend] at line 1123.

Use this image as a reference:

 

Again, note that the path to the two files you add will need to be adjusted from what's displayed here.

Again, note that the path to the two files you add will need to be adjusted from what's displayed here.

Once you have those two lines (in the above, the lines added to 1124 and 1125) in your php.ini file, save that puppy.

Given a minute or two for your cache to clear (force a reload if necessary) you should be good to go with whatever problem you’re facing. In my case, I was immediately able to successfully activate WP-Member. So I’m a happy camper.

It should be mentioned that I found a good deal of help with this issue at these following sites.

I appreciate their help, and only put this together so that there is one consistent tutorial on the issue. Hope it helps someone!

10 thoughts on “Installing ionCube PHP Loader on Bluehost

  1. Great guide. We had been trying to do a similar one, but as each host is vastly different, we stuck with a standard ionCube install guide.
    Anyone buying our plugin who doesnt have ionCube installed already can request us to install it for them.

    Thank you for mentioning our plugin.
    Best wishes
    Dave
    wp-Member.com

  2. Hey Ryan, thanks a million. I’ve really been wanting to standardize on squarespace as a web platform but I my ideas require a lot of dynamic server side stuff and php which squarespace doesn’t allow.

    This has really been getting to me, so thanks.

  3. IonCube has been a problem on quite a few hosts. It is unbelievable how little the hosts will assist you when you have problems.
    We recently started installing IonCube onto any host for any of our customers that require it for our plugin.

    Best wishes
    Dave
    wp-Member.com

  4. hello Ryan,

    Thanks for the great guide, can you pls email a copy of your php.ini file?? i am using bluehost too..but can’t get the correct php.ini file following your guide step by step. pls help, thanks a lot!

  5. Hi Ryan,

    Thanks for doing the dirty work for us 🙂

    What do you do if you are hosting multiple domains on your server? The php.ini goes to into the public_html folder, but this has folders for five of my sites. Can I add those two ioncube loader files for each of my sites, in the php.ini file before I upload it to the public_html folder? Will that work? I’d appreaciate your input, thanks.

  6. Thanks for the guide. I’ve been having a problem with this on my article directory. I think I’ve fixed the ioncube problem but now it’s telling me my software license is invalid!

    One step forward…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s