php v5.2.17 + ioncube

I’ve installed the php v5.2.17 from the bleeding edge repository and all is working except the ioncube loader. I went to the ioncube loader site and got the latest 64bit 5.2 loaders and installed them on this centos 5.6 server and set the zend_extension variable correctly in php.ini but now if I do a php -v I get this:

[root@webmin public_html]# php -v

The ionCube PHP Loader is disabled because of startup problems.
PHP 5.2.17 (cli) (built: Jan 16 2011 22:43:26)
Copyright © 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright © 1998-2010 Zend Technologies
with the ionCube PHP Loader v4.0.8, Copyright © 2002-2011, by ionCube Ltd., and
with Zend Optimizer v3.3.9, Copyright © 1998-2009, by Zend Technologies

Here’s my php info. Everything including ioncube appears to be ok.

I can’t find a solution as to why I’m getting this error. Any help would be great!


Yeah, Ioncube should work well with those PHP versions. I did some Googling on the error you got, and I ran into this thread in the Ioncube forums… they list a few thoughts as to what might cause that:

Thanks for the reply…

I have it set to zend_extension= in the /etc/php.ini

zend_extension= “/usr/lib64/php/modules/”
zend_extension_ts = “/usr/lib64/php/modules/”
zend_extension= “/usr/lib64/php/modules/”

I’m thinking it’s being loaded twice but I don’t know where or how to find this out.

Is there anywhere else on virtualmin that this loader would be loading from?


Hmm, so you have all three of those lines in your php.ini file? That may actually be your issue there… I believe zend_extension is a non-threaded version of ioncube, and zend_extension_ts is for a threaded version.

Typically, you’d use one or the other, not both versions of Ioncube.

My recommendation would be to comment out the “zend_extension_ts” line and see if that works for you.


Ok, i commented out that line and restarted apache and did php -v again and got same exact message. Is there another php.ini or another version of php (5.1.6) on this box from before I upgraded php? If everything is working then I guess it’s not that big of a deal…I just know that if there is one error message somewhere, something may go wrong at some point.

Well, I don’t see your phpinfo() output there anymore… but it lists all the .ini files that are processed as PHP loads up.

You may want to review which files it’s loading, and make sure none of them have a duplicate entry.


oops, try it again.

it’s says it’s using this:

I checked that file and made sure there was no thread loader. But also, why is it loading that ini file and not /etc/php.ini?

Also, i’m doing this php -v via ssh command, so I doubt the root server is checking this one virtual server’s php.ini file. Or maybe it’s checking both…I don’t know why virtual servers are getting their own php.ini. It’s a good thing and a bad thing. Good because each account can manage their own php settings, bad if thye main server is checking different php.ini files for loaders.


Yeah, any Virtual Server using CGI or FCGID as it’s Execution Mode will use it’s own php.ini file. Only Virtual Servers using mod_php use a global php.ini.

However, most distros have a global directory for PHP .ini files that every PHP application on the system will read from. On CentOS, that’s typically /etc/php.d.

However, you should see a list of what additional .ini files are being processed in your phpinfo output, which would tell you where those are being loaded.


I found it!

it was in /etc/php.d/20ioncube.ini

there was a line (zend_extension= “/usr/lib64/php/modules/”) going to the ioncube loader. I commented it out and ran php -v and no errors now.

Why was that line in there? was it from the previous virtualmin php 5.1 version?

I’m not sure why that would be in there :slight_smile:

The Ioncube loaders aren’t distributed with PHP, so that line would have been added either manually by the root user, or perhaps during the installation of an app.


Also, I noticed when virtuamin had php 5.1 and I installed phpmyadmin using the new installer scripts onto a virtual server it upgraded everything to php to 5.3.6.

Was that because it saw php v5.1 and phpmyadmin had to have php 5.2+? because I just tried installing phpmyadmin again on my new server here with the php 5.2.17 that we just worked on in this post, and it’s still 5.2.17 after the phpmyadmin install. So, that must be it, but just getting clarification from the vm team!

Also, thanks for everything, you guys are great on this forum!

Well, CentOS comes with PHP 5.1.x. Virtualmin would attempt to use that, unless told otherwise :slight_smile:

You can use PHP 5.2.17 by setting up the bleed repo.

However, CentOS doesn’t come with 5.3.6, nor is that in the bleed repo… so I’m not sure where that’s coming from. Is it possible you enabled a third party repo?


Hi Eric

I know this is an old post, but I also have problems with the Ioncube on my VirtualMin Pro installation.
I have recently installed WHMCS and setup an account with OpenSRS.
The system recommend that I setup a weekly cron job to run the following command :

php -q /home/ito-hosting/public_html/modules/registrars/opensrs/opensrssync.php

When I try to do that I get the following error :

Output from command php -q /home/ito-hosting/public_html/modules/registrars/opensrs/opensrssync.php …

PHP Warning: Module ‘mssql’ already loaded in Unknown on line 0
Site error: the file /home/ito-hosting/public_html/modules/registrars/opensrs/opensrssync.php requires the ionCube PHP Loader to be installed by the site administrator.

But if I look into the PHP.ini located in the virtual server /home/ito-hosting/etc/ I see the following line (last line in the PHP.ini file).

And I can see the file referred to in the above variable.
I have tried to restart the http service, without any result.
You can see my PHPinfo file here :

I can’t see what I missing.
Shall I add the Ioncube loader to the default PHP.ini as well?

  • Tim Hallgren


You would just need to tell PHP to use the php.ini file from that particular Virtual Server.

To do that, you could use a command like this in your cron:

PHPRC=/home/ito-hosting/etc/ php -q /home/ito-hosting/public_html/modules/registrars/opensrs/opensrssync.php

Hi Eric

It worked like a charm, except that I get an PHP MySQL error :
PHP Warning: Module ‘mssql’ already loaded in Unknown on line 0

But it seems to run and the error above is properly within the PHP file run.
I also found out that I could run the job the following way.

/usr/bin/wget -q -O /dev/null

  • Tim Hallgren

Well, that warning means that there’s a line in your php.ini file that’s loading the “mssql” module a second time.

You could always comment that line out if that module is being loaded elsewhere.


Hi Eric

That is right :slight_smile:
I have commented that line out with the MySQL load so it will not be loaded twice.

I setup the cron job to run two twice a week at 2 AM, but the job ran for every minute for an hour, until I noticed the “Minutes” section.
It was set to all so that explains it, I thought it was was minutes in the specific hour it should run and not how many minutes it would run :slight_smile:

Is it possible to create cron jobs to run on specific times in a specific hour?
For example 02:15 and 02:25 or similar?

Sorry to ask for something else in this thread.

  • Tim

Is it possible to create cron jobs to run on specific times in a specific hour? For example 02:15 and 02:25 or similar?

Sure – your cron job would need to look like this:

15,25 2 * * * COMMAND_TO_RUN