Aug 8, 2020 | Uncategorized

IonCube Loader: The Guide (with help for problem hosts)

By Luke Bryant

TL;DR If you are like me, then I was racking my brains trying to figure out what went wrong when WordPress said, “there was a Critical Error: IonCube Loader is not installed”. Even though my PHPinfo file said it was installed fine. What gives?! Well, for troubleshooting, click here. And you will be taken to the work-around.

Disclaimer: This is specifically a “problem” Ionos (previously 1&1) and WordPress – although I imagine the same issue could happen on most CMS, including Joomla, Drupal, etc. and most shared hosting providers – this is about my experience with WordPress, and when I Googled some answers, there was little to no information available to help me. So I made this…

Intro

I recently discovered IonCube Loader because I had never needed to use it before. While it seemed (and was) pretty straightforward to install and set up on my hosting provider, there were still a few problems.

These problems have nothing to do with IonCube itself or the developer of the software that needed IonCube, but with the host itself.

Now, IonCube Loader can be installed on many hosts, including dedicated, VPS, and even shared hosting. And for this endeavour, it was a shared host that I was installing on.

That isn’t actually proving to be as problematic as I thought it might be, but I soon realised that this particular host created a php.ini file in almost every directory that is created.

When we install IonCube, it will add some information to the php.ini file that it needs to tell it that it is installed.

Wait… am I getting ahead of myself?

What is IonCube?

ionCube PHP Encoder and Loader logo

IonCube is made up of the encoder and the loader. The encoder is used by developers to encode and secure their PHP-based software/plugins/anything, and then the loader is used to decode and run that software. Without the Loader, your server won’t understand the encoded files at all.

Why would developers use this? Well, to protect their code from people who might want to copy it, among others. Here are the pros as IonCube state them:

  • Unique External and Dynamic Keys encryption feature for the ultimate in PHP security.
  • Compiled Bytecode protection.
  • Command-line plus GUI for Windows and macOS.
  • Binary code obfuscation.
  • Optional expiry, domain, IP and MAC locking for effective code licensing.
  • One-time purchase with no annual renewal.
  • And more

So, if you are a developer who wants to write PHP software that you might want to license to people, then this could be a good solution.

However, if you are just trying to get the encoded software to run, then you are here for the Loader!

If you are like me, then I was racking my brains trying to figure out what went wrong when WordPress said there was a Critical Error: IonCube Loader is not installed. Even though my PHPinfo file said it was installed fine. What gives?!

Well, for troubleshooting, click here. And you will be taken to the workaround. Otherwise, stick around for the Installation…

First Step: IonCube Loader Installation

The first step to any successful installation is installing the correct software on your server.

You need to know which version of PHP you’re running (most likely 5.6, 7.1, 7.2, 7.3, or 7.4), and also the server’s software (many options include Linux, FreeBSD, OpenBSD, macOS, and Windows in 32- or 64-bit versions).

With so many options, you can either check your PHPinfo file (which you may need to create) or use the handy wizard provided by IonCube Loader.

Using the IonCube Wizard

The Wizard is actually great, and very usable! It will scan your server to determine the PHP version you have, which wasn’t immediately clear in some tutorials that say you should find out the PHP version first.

It is easy enough, though, to check your PHP version first, to make sure the wizard is correct, and then proceed with the installation of the IonCube version you require.

During installation, the IonCube installer creates a folder in your root directory called ‘ioncube’, and within it are the files your server and IonCube need to decode the encoded files.

The next step is important, as you now need to tell your PHP server where that information resides. To tell your server where to look for the decoder, you will need to update a php.ini file. It looks something like this:

zend_extension = /something/something/blah/htdocs/directory/yourWebsiteDirectory/ioncube/ioncube_loader_lin_7.4.so^

or this:

zend_extension = /htdocs/YourApp/ioncube/ioncube_loader_lin_7.4.so^

The 7.4 in the example refers to PHP 7.4, so you may have to install 5.6, 7.0, 7.2, etc., depending on your host and the PHP version.

^The install wizard will tell you the correct URL/directory path to use, but you will have to copy and paste it into the php.ini file

The PHP.ini file of doom.

This is where some of the problems start. Though they aren’t really problems, they are kind of annoying.

The php.ini file is a PHP configuration file that lets you override certain settings from the default.

You can, for example, change the memory PHP is allowed to use, which is my most common use for it, or change the maximum upload size.

The configuration file (php.ini) is read when PHP starts up. For the server module versions of PHP, this happens only once when the webserver is started. For the CGI and CLI versions, it happens on every invocation.

php.net

Basically, it is an important way to configure your PHP settings. The ionCube Loader is all about PHP, and we need to inform the PHP server that ionCube is in the /ioncube/ directory. The wizard even tells you what information to add to the php.ini file. Great.

Once this is done, you think you’ve cracked it, and you run phpinfo again, and it says it’s installed. Perfect!

But then the bit of software you want to run that requires ionCube does this…

ionCube Loader error in WordPress: Site error: the ionCube PHP Loader needs to be installed. This is a widely used PHP extension for running ionCube protected code, website security and malware blocking.
ionCube Loader error in WordPress

But wait! PHP.info says ionCube is installed perfectly fine!?

So, I went back to the drawing board, uninstalled IonCube, loaded different PHP versions and tried it all again. The problem persisted.

What. The. Actual…

But then I figured it out.

The problem is that ionos – and possibly a few other hosts – don’t just put a php.ini file in the root directory. And the ionCube installer informed me that “you may need to update the php.ini file wherever the encoded code resides”.

So, in my case, I needed to update a few more php.ini files* that were put into WordPress directories that now contained the ionCube encoded files.

* update them to include this: zend_extension = /htdocs/YourApp/ioncube/ioncube_loader_lin_7.4.so to point to the correct location of ionCube loader. (The install wizard will tell you the correct URL to use, but you will have to copy and paste it into the php.ini file.)

The first one you should try is /wp-admin/, but you will have to play around with it depending on your installation and where the encoded files are.

For a while, I just added the updated php.ini file to a few directories until it worked, and eventually it did.

You need to update the other php.ini files with the same information as the first one that points to the ionCube installation.

Now it should work! Hope that helped.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Luke B on Instagram

Luke Bryant is a graphic designer, illustrator, web designer etc., by day, based over at fartsake.com and fasprinting.co.uk - One day he may even have enough time to design something awesome for this site… once he's done a new website for FAS… and all his paying customers… but definitely after that! Spend most of my time working or in a Coffee shop in Uxbridge reading news, blogging or shopping.