Show server ioncube loader version with php

18,386

Solution 1

You can simply use phpinfo(). If you want to check it's loaded or not, you can use extension_loaded().

<?php
phpinfo();

Solution 2

It's an old question, but it's always good to know that the easiest way to find out the exact version of the ionCube Loader is to SSH to the server and type

php -v

This will give you something like :

PHP 5.5.30 (cli) (...)
with the ionCube PHP Loader v4.7.5, Copyright (c) 2002-2014, by ionCube Ltd.(...)

Solution 3

If the Loader is installed, you can retrieve this programatically by calling ioncube_loader_version() or ioncube_loader_iversion() in the Loader API.

phpinfo() as suggested will show the Loader version too if the Loader is installed at the time of the call.

The User Guide PDF has more details of the Loader API.

Solution 4

Use the following function. phpinfo not work if listed in disable_functions

function GetIonCubeLoaderVersion() {
        if (function_exists('ioncube_loader_version')) {
            $version = ioncube_loader_version();
            $a = explode('.', $version);
            $count = count($a);
            if ($count == 3) {
                return $version;
            } elseif ($count == 2) {
                return $version . ".0";
            } elseif ($count == 1) {
                return $version . ".0.0";
            }
            $version = implode('.', array_slice($a, 0, 3));
            return $version;
        }
        return 'Not Found!';
}

Solution 5

Here is my solution to get ionCube version from phpInfo:

function GetIonCubeLoaderVersion()
{
    ob_start();
    phpinfo(INFO_GENERAL);
    $aux = str_replace('&nbsp;', ' ', ob_get_clean());
    if($aux !== false)
    {
        $pos = mb_stripos($aux, 'ionCube PHP Loader');
        if($pos !== false)
        {
            $aux = mb_substr($aux, $pos + 18);
            $aux = mb_substr($aux, mb_stripos($aux, ' v') + 2);

            $version = '';
            $c = 0;
            $char = mb_substr($aux, $c++, 1);
            while(mb_strpos('0123456789.', $char) !== false)
            {
                $version .= $char;
                $char = mb_substr($aux, $c++, 1);
            }

            return $version;
        }
    }

    return false;
}
Share:
18,386
Pafo
Author by

Pafo

Updated on June 27, 2022

Comments

  • Pafo
    Pafo almost 2 years

    I am using ioncube to encode my scripts.

    But i don't know the loader version that is installed on sever.

    Is there any way or any code or any function to Show the exact version of IONCUBE loader version ?

  • Pafo
    Pafo over 9 years
    I WANT THE VERSION !
  • iFarbod
    iFarbod over 9 years
  • RozzA
    RozzA over 6 years
    best answer for me
  • Hamid
    Hamid over 5 years
    this feature not work when phpinfo exists in disabe_functions
  • José Carlos PHP
    José Carlos PHP over 5 years
    Obvious, @Hamid
  • José Carlos PHP
    José Carlos PHP over 5 years
    Nice approach :)
  • Nick
    Nick over 5 years
    ioncube_loader_iversion() as mentioned above is generally the best approach as rather than a string it returns an integer that can be easily compared by using numerical methods.