IonCube Advance system test


\n"; echo ioncube_test(); echo "

\n"; echo server_software(); echo "

\n"; echo additional_info(); echo "
\n"; echo more_info(); ?>
| => |v\">)([^ <]*)(.* $thread_safe, 'DEBUG_BUILD' => $debug_build, 'PHP_INI' => $php_ini_path, 'CGI_CLI' => $cgi_cli); } function ioncube_test() { $working = ""; $instructions = ""; $status = ""; $working = "\n"; $status = ""; $instructions = ""; $ok = true; $status_class = "red"; if ( extension_loaded('ionCube Loader') ) { $ioncube_loader_version = ioncube_loader_version_array(); $working .= ""; $status .= "Installed: version " . $ioncube_loader_version['version']; if ($ioncube_loader_version['major'] < 3 || ($ioncube_loader_version['major'] == 3 && $ioncube_loader_version['minor'] < 1) ) { $instructions .= "Ioncube loader is installed but needs to be updated.
The most recent version of the loader can be found here. "; $status_class = "orange"; } else { $instructions .= "No additional configuration required."; $status_class = "green"; } } else { $working .= "Testing whether your system supports run-time loading...
\n"; $sys_info = ic_system_info(); if ($sys_info['THREAD_SAFE'] && !$sys_info['CGI_CLI']) { $status .= "Your PHP install appears to have threading support and run-time Loading\n" ."is only possible on threaded web servers if using the CGI, FastCGI or\n" ."CLI interface.
\n"; $instructions .= "To run encoded files please install the Loader in the php.ini file.\n" ."Instructions can be found here."; $ok = false; } if ($sys_info['DEBUG_BUILD']) { $status .= "Your PHP installation appears to be built with debugging support\n" . "enabled and this is incompatible with ionCube Loaders.
\n
\nDebugging support in PHP produces slower execution, is\n" . "not recommended for production builds and was probably a mistake.
\n"; $instructions .= "You should rebuild PHP without the --enable-debug option.
\n"; $ok = false; } // // Check safe mode and for a valid extensions directory // if ( ini_get('safe_mode') ) { $status .= "PHP safe mode is enabled and run time loading will not be possible."; $instructions .= "To run encoded files please install the Loader in the php.ini file.\n" . "Instructions can be found here.\n" . "Alternatively contact your hosting provider or system administrator,\n" . "and ask them to enable safe mode for your account."; $ok = false; } /* elseif (!is_dir(realpath(ini_get('extension_dir')))) { echo "The setting of extension_dir in the php.ini file is not a directory or may not exist and run time loading will not be possible. You do not need write permissions on the extension_dir but for run-time loading to work a path from the extensions directory to wherever the Loader is installed must exist.
\n"; $ok = false; } */ // If ok to try and find a Loader if ($ok) { // // Look for a Loader // // Old style naming should be long gone now $test_old_name = false; $_u = php_uname(); $_os = substr($_u,0,strpos($_u,' ')); $_os_key = strtolower(substr($_u,0,3)); $_php_version = phpversion(); $_php_family = substr($_php_version,0,3); $_loader_sfix = (($_os_key == 'win') ? '.dll' : '.so'); $_ln_old="ioncube_loader.$_loader_sfix"; $_ln_old_loc="/ioncube/$_ln_old"; $_ln_new="ioncube_loader_${_os_key}_${_php_family}${_loader_sfix}"; $_ln_new_loc="/ioncube/$_ln_new"; $working .= "
\nLooking for Loader '$_ln_new'"; if ($test_old_name) { $working .= " or '$_ln_old'"; } $working .= "
\n
\n"; $_extdir = ini_get('extension_dir'); if ($_extdir == './') { $_extdir = '.'; } $_oid = $_id = realpath($_extdir); $_here = dirname(__FILE__); if ((@$_id[1]) == ':') { $_id = str_replace('\\','/',substr($_id,2)); $_here = str_replace('\\','/',substr($_here,2)); } $_rd=str_repeat('/..',substr_count($_id,'/')).$_here.'/'; if ($_oid !== false) { $working .= "Extensions Dir: $_extdir ($_id)
\n"; $working .= "Relative Path: $_rd
\n"; } else { $working .= "Extensions Dir: $_extdir (NOT FOUND)
\n
\n"; $status .= "The directory set for the extension_dir entry in the\n" . "php.ini file may not exist, and run time loading will not be possible.
\n"; $instructions .= "Please ask your hosting provider or system administrator to create the\n" . "directory
\n
\n" . "$_extdir
\n
\n" . "ensuring that it is accessible by the web server software. They do not\n" . "need to restart the server. Then rerun this script. As an alternative,\n" . "your host could install the Loader in the php.ini file. Instructions can be found here.
\n"; $ok = false; } if ($ok) { $_ln = ''; $_i=strlen($_rd); while($_i--) { if($_rd[$_i]=='/') { if ($test_old_name) { // Try the old style Loader name $_lp=substr($_rd,0,$_i).$_ln_old_loc; $_fqlp=$_oid.$_lp; if(@file_exists($_fqlp)) { $working .= "Found Loader: $_fqlp
\n"; $_ln=$_lp; break; } } // Try the new style Loader name $_lp=substr($_rd,0,$_i).$_ln_new_loc; $_fqlp=$_oid.$_lp; if(@file_exists($_fqlp)) { $working .= "Found Loader: $_fqlp
\n"; $_ln=$_lp; break; } } } // // If Loader not found, try the fallback of in the extensions directory // if (!$_ln) { if ($test_old_name) { if (@file_exists($_id.$_ln_old_loc)) { $_ln = $_ln_old_loc; } } if (@file_exists($_id.$_ln_new_loc)) { $_ln = $_ln_new_loc; } if ($_ln) { $working .= "Found Loader $_ln in extensions directory.
\n"; } } $working .= "
\n"; if ($_ln) { $working .= "Trying to install Loader - this may produce an error...
\n
\n"; @dl($_ln); if( extension_loaded('ionCube Loader') ) { $ioncube_loader_version = ioncube_loader_version_array(); $status .= "The Loader version ".$ioncube_loader_version['version']." was successfully installed and encoded files should be able to\n" . "automatically install the Loader when needed."; if ($ioncube_loader_version['major'] < 3 || ($ioncube_loader_version['major'] == 3 && $ioncube_loader_version['minor'] < 1) ) { $instructions .= "Ioncube loader is installed but needs to be updated.
The most recent version of the loader can be found here. "; $status_class = "orange"; } else { $instructions .= "No changes to your php.ini file\n" . "are required to use encoded files on this system."; $status_class = "green"; } } else { $status .= "The Loader was not installed."; } } else { $status .= "Run-time loading should be possible on your system but no suitable Loader\n" . "was found."; $instructions .= "The Loader for $_os (PHP $_php_family) is required.
\n" . "Loaders can be downloaded from www.ioncube.com
\n"; $instructions .= "Please download the appropriate loader, extract the package and upload the 'ioncube' folder to the root directory of your site (e.g. '/public_html/ioncube/' or '/htdocs/ioncube/').\n" . "After that run this script again."; $status_class = "orange"; } } } } //$instructions should never be empty. //if it is, then put default: if (empty($instructions)) { $instructions = "Run-time loading is not currently possible.
\n" . "Please contact your web-host asking to install ionCube loader in php.ini
\n" . "Loaders can be downloaded from www.ioncube.com
\n" . "Instructions can be found here

\n" . "For additional questions please contact support at $email, providing a link to this script."; } //echo "
\nPlease send the output of this script to $email if you have questions or require further assistance.
\n
\n"; $body = "" . "ionCube Loader
\n" . "Status: $status
\n" . "Instructions: $instructions"; return $body; } //END OF RTL-TESTER FUNCTIONS function server_software() { if (isset($_SERVER['SERVER_SOFTWARE'])) { $status = $_SERVER['SERVER_SOFTWARE']; } else if (($sf = getenv('SERVER_SOFTWARE'))) { $status = $sf; } else { $status = 'n/a'; } if ( strcasecmp(substr($status, 0, 6), "Apache") == 0 ) { $status_class = "green"; } else { $status_class = "red"; } $body = "Server Software
\n" . "Status: $status
\n" . "Instructions: You must run Apache web server. This script does not support IIS."; return $body; } function additional_info() { $php_version = phpversion() . " (" . php_sapi_name() . ")"; $php_flavour = substr($php_version,0,3); $os_name = substr(php_uname(),0,strpos(php_uname(),' ')); $os_code = strtolower(substr($os_name,0,3)); $safe_mode = ini_get('safe_mode') ? 'Enabled' : 'Disabled'; $enable_dl = ini_get('enable_dl') ? 'Enabled' : 'Disabled'; $sys_info = ic_system_info(); $cgi = $sys_info['CGI_CLI'] ? 'Yes' : 'No'; $thread_safe = $sys_info['THREAD_SAFE'] ? 'Yes' : 'No'; $server_name = $_SERVER['SERVER_NAME']; $server_ip = $_SERVER['SERVER_ADDR']; $resolved_ip = @gethostbyname($server_name); $path = getcwd(); $body = "Additional Information
\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "
PHP Version:$php_version
Operating System:$os_name
safe_mode:$safe_mode
enable_dl:$enable_dl
PHP as CGI:$cgi
Thread safety:$thread_safe
Server name:$server_name
Server IP:$server_ip
Resolved IP:$resolved_ip
Absolute path:$path
PHP info:Click here
\n"; return $body; } function intro() { return "This script will check if IonCube will work on your site.\n" . "The results are displayed in green, orange or red color.
\n" . "If some of the results are not green please follow the instructions and run this script again."; } function more_info() { return "This script also displays other important information about your server.
\n"; } function ioncube_loader_version_array () { if ( function_exists('ioncube_loader_iversion') ) { // Mmmrr $ioncube_loader_iversion = ioncube_loader_iversion(); $ioncube_loader_version_major = (int)substr($ioncube_loader_iversion,0,1); $ioncube_loader_version_minor = (int)substr($ioncube_loader_iversion,1,2); $ioncube_loader_version_revision = (int)substr($ioncube_loader_iversion,3,2); $ioncube_loader_version = "$ioncube_loader_version_major.$ioncube_loader_version_minor.$ioncube_loader_version_revision"; } else { $ioncube_loader_version = ioncube_loader_version(); $ioncube_loader_version_major = (int)substr($ioncube_loader_version,0,1); $ioncube_loader_version_minor = (int)substr($ioncube_loader_version,2,1); } return array('version'=>$ioncube_loader_version, 'major'=>$ioncube_loader_version_major, 'minor'=>$ioncube_loader_version_minor); }