如何安装ioncube扩展

2012-05-23 09:03:02
王春生
141604
最后编辑:禅道 - 闫敏 于 2020-07-13 10:06:28
简介:禅道的加密软件使用的是ioncube,本篇文章向您讲述如何部署安装ioncube的扩展。
禅道专业版本的核心代码都是加密的(前端的html, css, js, 配置,语言项是开源的。),使用的加密软件是 ioncube,因此要能运行禅道专业版本的软件,先要安装ioncube扩展。

一、下载loader-wizard.php( 支持php7.0、php7.1、php7.2版本

ioncube提供了一个安装的向导程序,可以非常方便的帮助检测php的运行环境,自动给出提示。

1.1 通过下面的地址下载loader-wizard: http://www.ioncube.com/loader-wizard/loader-wizard.zip

1.2 下载之后,将其解压缩,到apache的www或者htdoc目录。

二、运行loader-wizard.php程序

2.1 使用浏览器访问loader-wizard.php 比如 http://localhost/loader-wizard.php 实际的访问路径根据情况修改。

2.2 这个loader程序经过计算之后,会自动给出提示( 下图只是一个例子,具体操作需要根据贵公司网页访问 loader-wizard.php后显示的界面操作):

  • 根据这个向导程序的提示,下载相应的解密软件,我们也提供解密软件的国内地址,需要注意下向导中提示的软件名与下文中网址软件名相互对应,即可直接使用国内网址下载。
  • https://dl.cnezsoft.com/ioncube_loaders_lin_x86-64.zip
    https://dl.cnezsoft.com/ioncube_loaders_lin_x86.zip
    https://dl.cnezsoft.com/ioncube_loaders_lin_aarch64.zip
    https://dl.cnezsoft.com/ioncube_loaders_lin_armv7l.zip
    https://dl.cnezsoft.com/ioncube_loaders_win_nonts_vc15_x86-64.zip
    https://dl.cnezsoft.com/ioncube_loaders_win_vc15_x86-64.zip
    https://dl.cnezsoft.com/ioncube_loaders_win_nonts_vc15_x86.zip
    https://dl.cnezsoft.com/ioncube_loaders_win_vc15_x86.zip
    https://dl.cnezsoft.com/ioncube_loaders_win_nonts_vc14_x86.zip
    https://dl.cnezsoft.com/ioncube_loaders_win_vc14_x86.zip
    https://dl.cnezsoft.com/ioncube_loaders_win_nonts_vc11_x86-64.zip
    https://dl.cnezsoft.com/ioncube_loaders_win_vc11_x86-64.zip
    https://dl.cnezsoft.com/ioncube_loaders_win_nonts_vc11_x86.zip
    https://dl.cnezsoft.com/ioncube_loaders_win_vc11_x86.zip
    https://dl.cnezsoft.com/ioncube_loaders_win_nonts_vc9_x86.zip
    https://dl.cnezsoft.com/ioncube_loaders_win_vc9_x86.zip
    https://dl.cnezsoft.com/ioncube_loaders_dar_x86-64.zip
    https://dl.cnezsoft.com/ioncube_loaders_dar_x86.zip
  • 将下载下来的解密软件放在它指定的目录中。
  • 下载向导程序计算出来新的php.ini文件,替换系统原来的php.ini文件。 注:如果提示要下载00-ioncube 开头的文件放在某个目录,可以把这个文件下载后打开,把里面的代码复制到 php.ini 粘帖在第一行,保存php.ini后不需要把00-ioncube文件拷贝到服务上。
  • 重新启动webserver, 如果用的是nginx 需要重启一下php-fpm服务

2.3 验证是否安装成功

重新启动之后,再次访问loader.php,如果安装成功,系统会提示。

看到这个界面,就表示解密软件已经安装成功了。


2.4 Mac 系统下 ioncube 安装注意事项

下载相应解压软件后放置到 系统指定目录中 提醒  operation not permitted  问题。


关闭方式:

一般情况下我们在使用mac系统过程中下载一些文件、新建一些项目之后,这些文件都会默认是只读状态,这时我们只需要简单的一句权限设置命令就可以解决

sudo chmod -R 777 你要修改文件上层目录的路径
但是我们在对 usr/bin 等系统目录下的文件进行操作的时候往往会出现这样的错误 operation not permitted

这是因为一些mac用户在升级系统之后,电脑启用了SIP(System Integrity Protection),增加了rootless机制,导致即使在root权限下依然无法修改文件,在必要时候为了能够修改下面的文件,我们只能关闭该保护机制

 

1)重启过程中按住 command+R,进入保护模式,打开terminal终端,输入  csrutil disable
2)再次重启,即可对 usr/bin 等系统目录下文件进行修改

PS:如果要恢复保护机制,重新进入保护模式,输入 csrutil enable





评论列表
Mohist 2020-06-11 20:21:57
ioncube一直下载失败根本没有卵用
张玉洁 2020-06-12 09:14:46
在这个安装ioncube的手册中,我们也提供了解密软件的国内下载地址,可以试一下,需要注意下向导中提示的软件名与下文中网址软件名相互对应。如果还是无法下载成功,可以添加网页上方QQ,邀请进群,方便截图排查问题。
lili 2020-02-25 16:08:38
太复杂了,没见过这么复杂的,还不知道好不好用,费这么大劲去学专业知识?算求了吧,不用了
石洋洋 2020-02-25 16:49:44
一共需要操作5步就比较麻烦了?我们有提供云服务:www.zentaopm.com 开通就可以使用,不需要操作也不需要维护,可以试一下。
gift 2019-10-16 17:30:07
按照提示安装了之后重启fpm报错:
[root@dev etc]# php -m
Failed loading /usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/ioncube_loader_lin_7.1.so: /usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/ioncube_loader_lin_7.1.so: undefined symbol: zend_interrupt_function
张玉洁 2019-10-16 17:39:06
可以添加网页上方QQ,邀请进群,方便截图排查问题。
北极以北 2019-05-07 09:34:18
错误应用程序名称: httpd.exe,版本: 2.4.23.0,时间戳: 0x5776399f
错误模块名称: unknown,版本: 0.0.0.0,时间戳: 0x00000000
异常代码: 0xc0000005
错误偏移量: 0x0000000000000000
错误进程 ID: 0x1e6c
错误应用程序启动时间: 0x01d504151e303a29
错误应用程序路径: e:\wamp64\bin\apache\apache2.4.23\bin\httpd.exe
错误模块路径: unknown
报告 ID: 4e065ae5-e9bb-4da8-acf2-8d3118318245
错误程序包全名:
错误程序包相对应用程序 ID:
石洋洋 2019-05-07 10:44:37
建议使用禅道windows一键安装包,已经集成好了,启动服务即可使用。
2019-04-01 20:50:27
运行/loader-wizard.php提示出现下面错误,请问如何处理
PHP Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in C:\www\zentaopms\ioncube\loader-wizard.php on line 2638
石洋洋 2019-04-02 13:46:00
多刷新几次试试。
m 2018-10-10 18:36:43
ionCube 不支持 arm64 系统,有解决方案么
王林 2018-10-11 08:59:25
可以添加下页面上方QQ,邀请进群后,具体哪里有问题截图咨询一下。
ken 2018-06-08 15:13:39
打开loader_wizard.php后,只能看到源码如下:
$v) { $tmp_key = urlencode(is_int($k) ? $numeric_prefix.$k : $k); if ($key) $tmp_key = $key.'['.$tmp_key.']'; if ( is_array($v) || is_object($v) ) { $res[] = php4_http_build_query($v, null , $tmp_key); } else { $res[] = $tmp_key."=".urlencode($v); } } $separator = ini_get('arg_separator.output'); return implode($separator, $res); } function script_version() { return "2.60"; } function retrieve_latest_wizard_version() { $v = false; $s = trim(remote_file_contents(WIZARD_LATEST_VERSION_URL)); if (preg_match('/^\d+([.]\d+)*$/', $s)) { $v = $s; } return $v; } function latest_wizard_version() { if (!isset($_SESSION['latest_wizard_version'])) { $_SESSION['latest_wizard_version'] = retrieve_latest_wizard_version(); } return $_SESSION['latest_wizard_version']; } function update_is_available($lv) { if (is_numeric($lv)) { $lv_parts = explode('.',$lv); $script_parts = explode('.',script_version()); return ($lv_parts[0] > $script_parts[0] || ($lv_parts[0] == $script_parts[0] && $lv_parts[1] > $script_parts[1])); } else { return null; } } function check_for_wizard_update($echo_message = false) { $latest_version = latest_wizard_version(); $update_available = update_is_available($latest_version); if ($update_available) { if ($echo_message) { echo '

An updated version of this Wizard script is available here.
'; } return $latest_version; } else { return $update_available; } } function remote_file_contents($url) { $remote_file_opening = ini_get('allow_url_fopen'); $contents = false; if (isset($_SESSION['timing_out']) && $_SESSION['timing_out']) { return false; } @session_write_close(); $timing_out = 0; if ($remote_file_opening) { $fh = @fopen($url,'rb'); if ($fh) { stream_set_blocking($fh,0); stream_set_timeout($fh,IONCUBE_CONNECT_TIMEOUT); while (!feof($fh)) { $result = fread($fh, 8192); $info = stream_get_meta_data($fh); $timing_out = $info['timed_out']?1:0; if ($timing_out) { break; } if ($result !== false) { $contents .= $result; } else { break; } } fclose($fh); } else { $timing_out = 1; } } elseif (extension_loaded('curl')) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,IONCUBE_CONNECT_TIMEOUT); $output = curl_exec($ch); $info = curl_getinfo($ch); $timing_out = ($info['http_code'] >= 400)?1:0; curl_close($ch); if (is_string($output)) { $contents = $output; } } else { $timing_out = 1; } @session_start(); $_SESSION['timing_out'] = $timing_out; return $contents; } function php_version() { $v = explode('.',PHP_VERSION); return array( 'major' => $v[0], 'minor' => $v[1], 'release' => $v[2]); } function php_version_maj_min() { $vprts = php_version(); return ($vprts['major'] . '.' . $vprts['minor']); } function is_supported_php_version() { $v = php_version(); return ((($v['major'] == 4) && ($v['minor'] >= 1)) || (($v['major'] == 5) && (($v['minor'] >= 1) || ($v['release'] >= 3))) || $v['major'] == 7); } function is_php_version_or_greater($major,$minor,$release = 0) { $version = php_version(); return ($version['major'] > $major || ($version['major'] == $major && $version['minor'] > $minor) || ($version['major'] == $major && $version['minor'] == $minor && $version['release'] >= $release)); } function ini_file_name() { $sysinfo = get_sysinfo(); return (!empty($sysinfo['PHP_INI'])?$sysinfo['PHP_INI_BASENAME']:'php.ini'); } function get_remote_session_value($session_var,$remote_url,$default_function) { if (!isset($_SESSION[$session_var])) { $serialised_res = remote_file_contents($remote_url); $unserialised_res = @unserialize($serialised_res); if (empty($unserialised_res)) { $unserialised_res = call_user_func($default_function); } else { $_SESSION['remote_access_successful'] = 1; } if (false === $unserialised_res) { $unserialised_res = ''; } $_SESSION[$session_var] = $unserialised_res; } return $_SESSION[$session_var]; } function get_file_contents($file) { if (function_exists('file_get_contents')) { $strs = @file_get_contents($file); } else { $lines = @file($file); $strs = join(' ',$lines); } return $strs; } function default_platform_list() { $platforms = array(); $platforms[] = array('os'=>'win', 'os_human'=>'Windows VC6', 'is_legacy' => 1, 'os_mod' => '_vc6', 'arch'=>'x86', 'dirname'=>'win32', 'us1-dir'=>'windows_vc6/x86' ); $platforms[] = array('os'=>'win', 'os_human'=>'Windows VC6 (Non-TS)', 'is_legacy' => 1, 'os_mod' => '_nonts_vc6', 'arch'=>'x86', 'dirname'=>'win32-nonts', 'us1-dir'=>'windows_vc6/x86-nonts' ); $platforms[] = array('os'=>'win', 'os_human'=>'Windows VC9', 'os_mod' => '_vc9', 'arch'=>'x86', 'dirname'=>'win32_vc9', 'us1-dir'=>'windows_vc9/x86' ); $platforms[] = array('os'=>'win', 'os_human'=>'Windows VC9 (Non-TS)', 'os_mod' => '_nonts_vc9', 'arch'=>'x86', 'dirname'=>'win32-nonts_vc9', 'us1-dir'=>'windows_vc9/x86-nonts' ); $platforms[] = array('os'=>'win', 'os_human'=>'Windows VC11', 'os_mod' => '_vc11', 'arch'=>'x86', 'dirname'=>'win32_vc11', 'us1-dir'=>'windows_vc11/x86' ); $platforms[] = array('os'=>'win', 'os_human'=>'Windows VC11 (Non-TS)', 'os_mod' => '_nonts_vc11', 'arch'=>'x86', 'dirname'=>'win32-nonts_vc11', 'us1-dir'=>'windows_vc11/x86-nonts' ); $platforms[] = array('os'=>'win', 'os_human'=>'Windows VC11', 'os_mod' => '_vc11', 'arch'=>'x86-64', 'dirname'=>'win64_vc11', 'us1-dir'=>'windows_vc11/amd64' ); $platforms[] = array('os'=>'win', 'os_human'=>'Windows VC11 (Non-TS)', 'os_mod' => '_nonts_vc11', 'arch'=>'x86-64', 'dirname'=>'win64-nonts_vc11', 'us1-dir'=>'windows_vc11/amd64-nonts' ); $platforms[] = array('os'=>'win', 'os_human'=>'Windows VC14', 'os_mod' => '_vc14', 'arch'=>'x86', 'dirname'=>'win32_vc14', 'us1-dir'=>'windows_vc14/x86' ); $platforms[] = array('os'=>'win', 'os_human'=>'Windows VC14 (Non-TS)', 'os_mod' => '_nonts_vc14', 'arch'=>'x86', 'dirname'=>'win32-nonts_vc14', 'us1-dir'=>'windows_vc14/x86-nonts' ); $platforms[] = array('os'=>'win', 'os_human'=>'Windows VC14', 'os_mod' => '_vc14', 'arch'=>'x86-64', 'dirname'=>'win64_vc14', 'us1-dir'=>'windows_vc14/amd64' ); $platforms[] = array('os'=>'win', 'os_human'=>'Windows VC14 (Non-TS)', 'os_mod' => '_nonts_vc14', 'arch'=>'x86-64', 'dirname'=>'win64-nonts_vc14', 'us1-dir'=>'windows_vc14/amd64-nonts' ); $platforms[] = array('os'=>'win', 'os_human'=>'Windows VC15', 'os_mod' => '_vc15', 'arch'=>'x86', 'dirname'=>'win32_vc15', 'us1-dir'=>'windows_vc15/x86' ); $platforms[] = array('os'=>'win', 'os_human'=>'Windows VC15 (Non-TS)', 'os_mod' => '_nonts_vc15', 'arch'=>'x86', 'dirname'=>'win32-nonts_vc15', 'us1-dir'=>'windows_vc15/x86-nonts' ); $platforms[] = array('os'=>'win', 'os_human'=>'Windows VC15', 'os_mod' => '_vc15', 'arch'=>'x86-64', 'dirname'=>'win64_vc15', 'us1-dir'=>'windows_vc15/amd64' ); $platforms[] = array('os'=>'win', 'os_human'=>'Windows VC15 (Non-TS)', 'os_mod' => '_nonts_vc15', 'arch'=>'x86-64', 'dirname'=>'win64-nonts_vc15', 'us1-dir'=>'windows_vc15/amd64-nonts' ); $platforms[] = array('os'=>'lin', 'os_human'=>'Linux', 'arch'=>'x86', 'dirname'=>'linux_i686-glibc2.3.4', 'us1-dir'=>'linux/x86'); $platforms[] = array('os'=>'lin', 'os_human'=>'Linux', 'arch'=>'x86-64', 'dirname'=>'linux_x86_64-glibc2.3.4', 'us1-dir'=>'linux/x86_64'); $platforms[] = array('os'=>'lin','os_human'=>'Linux', 'arch'=>'ppc', 'dirname'=>'linux_ppc-glibc2.3.4','us1-dir'=>'linux/ppc'); $platforms[] = array('os'=>'lin','os_human'=>'Linux', 'arch'=>'ppc64', 'dirname'=>'linux_ppc64-glibc2.5','us1-dir'=>'linux/ppc64'); $platforms[] = array('os'=>'dra', 'os_human'=>'DragonFly', 'arch'=>'x86', 'dirname'=>'dragonfly_i386-1.7', 'us1-dir'=>'Dragonfly/x86'); $platforms[] = array('os'=>'fre', 'os_human'=>'FreeBSD 4', 'os_mod'=>'_4', 'arch'=>'x86', 'dirname'=>'freebsd_i386-4.8', 'us1-dir'=>'FreeBSD/v4'); $platforms[] = array('os'=>'fre', 'os_human'=>'FreeBSD 6', 'os_mod'=>'_6', 'arch'=>'x86', 'dirname'=>'freebsd_i386-6.2', 'us1-dir'=>'FreeBSD/v6/x86'); $platforms[] = array('os'=>'fre', 'os_human'=>'FreeBSD 6', 'os_mod'=>'_6', 'arch'=>'x86-64', 'dirname'=>'freebsd_amd64-6.2', 'us1-dir'=>'FreeBSD/v6/AMD64'); $platforms[] = array('os'=>'fre', 'os_human'=>'FreeBSD 7', 'os_mod'=>'_7', 'arch'=>'x86', 'dirname'=>'freebsd_i386-7.3', 'us1-dir'=>'FreeBSD/v7/x86'); $platforms[] = array('os'=>'fre', 'os_human'=>'FreeBSD 7', 'os_mod'=>'_7', 'arch'=>'x86-64', 'dirname'=>'freebsd_amd64-7.3', 'us1-dir'=>'FreeBSD/v7/AMD64'); $platforms[] = array('os'=>'fre', 'os_human'=>'FreeBSD 8', 'os_mod'=>'_8', 'arch'=>'x86', 'dirname'=>'freebsd_i386-8.0', 'us1-dir'=>'FreeBSD/v8/x86'); $platforms[] = array('os'=>'fre', 'os_human'=>'FreeBSD 8', 'os_mod'=>'_8', 'arch'=>'x86-64', 'dirname'=>'freebsd_amd64-8.0', 'us1-dir'=>'FreeBSD/v8/AMD64'); $platforms[] = array('os'=>'bsd', 'os_human'=>'BSDi', 'is_legacy' => 1, 'arch'=>'x86', 'dirname'=>'bsdi_i386-4.3.1'); $platforms[] = array('os'=>'net', 'os_human'=>'NetBSD', 'arch'=>'x86', 'dirname'=>'netbsd_i386-2.1','us1-dir'=>'NetBSD/x86'); $platforms[] = array('os'=>'net', 'os_human'=>'NetBSD', 'arch'=>'x86-64', 'dirname'=>'netbsd_amd64-2.0','us1-dir'=>'NetBSD/x86_64'); $platforms[] = array('os'=>'ope', 'os_human'=>'OpenBSD 4.2', 'os_mod'=>'_4.2', 'arch'=>'x86', 'dirname'=>'openbsd_i386-4.2', 'us1-dir'=>'OpenBSD/x86'); $platforms[] = array('os'=>'ope', 'os_human'=>'OpenBSD 4.5', 'os_mod'=>'_4.5', 'arch'=>'x86', 'dirname'=>'openbsd_i386-4.5', 'us1-dir'=>'OpenBSD/x86'); $platforms[] = array('os'=>'ope', 'os_human'=>'OpenBSD 4.6', 'os_mod'=>'_4.6', 'arch'=>'x86', 'dirname'=>'openbsd_i386-4.6', 'us1-dir'=>'OpenBSD/x86'); $platforms[] = array('os'=>'ope', 'os_human'=>'OpenBSD 4.7', 'os_mod'=>'_4.7', 'arch'=>'x86-64', 'dirname'=>'openbsd_amd64-4.7', 'us1-dir' => 'OpenBSD/x86_64'); $platforms[] = array('os'=>'dar', 'os_human'=>'OS X', 'is_legacy' => 1, 'arch'=>'ppc', 'dirname'=>'osx_powerpc-8.5','us1-dir'=>'OSX/ppc'); $platforms[] = array('os'=>'dar', 'os_human'=>'OS X', 'arch'=>'x86', 'dirname'=>'osx_i386-8.11','us1-dir'=>'OSX/x86'); $platforms[] = array('os'=>'dar', 'os_human'=>'OS X', 'arch'=>'x86-64', 'dirname'=>'osx_x86-64-10.2','us1-dir'=>'OSX/x86_64'); $platforms[] = array('os'=>'sun', 'os_human'=>'Solaris', 'is_legacy' => 1, 'arch'=>'sparc', 'dirname'=>'solaris_sparc-5.9', 'us1-dir'=>'Solaris/sparc'); $platforms[] = array('os'=>'sun', 'os_human'=>'Solaris', 'arch'=>'x86', 'dirname'=>'solaris_i386-5.10','us1-dir'=>'Solaris/x86'); return $platforms; } function get_loader_platforms() { return get_remote_session_value('loader_platform_info',LOADER_PLATFORM_URL,'default_platform_list'); } function get_platforminfo() { static $platforminfo; if (empty($platforminfo)) { $platforminfo = get_loader_platforms(); } return $platforminfo; } function default_php_versions() { return array(); } function get_php_versions() { return get_remote_session_value('php_version_info',LOADER_PHP_VERSION_URL,'default_php_versions'); } function get_max_php_version_supported() { static $max_php_version; if (empty($max_php_version)) { $php_versions = get_php_versions(); $dirname = calc_dirname(); if (array_key_exists($dirname,$php_versions)) { $max_php_version = $php_versions[$dirname]; } else { $max_php_version = NULL; } } return $max_php_version; } function is_after_max_php_version_supported() { $is_too_recent_php = false; $supported_php_version = get_max_php_version_supported(); if (!is_null($supported_php_version)) { $pversion = php_version(); $supported_parts = explode('.',$supported_php_version); $is_too_recent_php = ($supported_parts[0] < $pversion['major'] || ($supported_parts[0] == $pversion['major'] && $supported_parts[1] < $pversion['minor'])); } if ($is_too_recent_php) { return $supported_php_version; } else { return false; } } function supported_os_variants($os_code,$arch_code) { if (empty($os_code)) { return ERROR_UNKNOWN_OS; } if (empty($arch_code)) { return ERROR_UNKNOWN_ARCH; } $os_found = false; $arch_found = false; $os_arch_matches = array(); $pinfo = get_platforminfo(); foreach ($pinfo as $p) { if ($p['os'] == $os_code && $p['arch'] == $arch_code) { $os_arch_matches[$p['os_human']] = (isset($p['os_mod']))?(0 + (int) str_replace('_','',$p['os_mod'])):''; } if ($p['os'] == $os_code) { $os_found = true; } elseif ($p['arch'] == $arch_code) { $arch_found = true; } } if (!empty($os_arch_matches)) { asort($os_arch_matches); return $os_arch_matches; } elseif (!$os_found) { return ERROR_UNSUPPORTED_OS; } elseif (!$arch_found) { return ERROR_UNSUPPORTED_ARCH; } else { return ERROR_UNSUPPORTED_ARCH_OS; } } function default_win_compilers() { return array('VC6','VC9','VC11','VC14','VC15'); } function supported_win_compilers() { static $win_compilers; if (empty($win_compilers)) { $win_compilers = find_win_compilers(); } return $win_compilers; } function find_win_compilers() { return get_remote_session_value('php_compilers_info',PHP_COMPILERS_URL,'default_win_compilers'); } function server_software_info() { $ss = array('full' => '','short' => ''); $ss['full'] = $_SERVER['SERVER_SOFTWARE']; if (preg_match('/apache/i', $ss['full'])) { $ss['short'] = 'Apache'; } else if (preg_match('/IIS/',$ss['full'])) { $ss['short'] = 'IIS'; } else { $ss['short'] = ''; } return $ss; } function match_arch_pattern($str) { $arch = null; $arch_patterns = array( 'i.?86' => 'x86', 'x86[-_]64' => 'x86', 'x86' => 'x86', 'amd64' => 'x86', 'SMP Tue Jan 01 00:00:00 CEST 2000 all GNU\/Linux' => 'x86', 'ppc64' => 'ppc', 'ppc' => 'ppc', 'powerpc' => 'ppc', 'sparc' => 'sparc', 'sun' => 'sparc' ); foreach ($arch_patterns as $token => $a) { if (preg_match("/$token/i", $str)) { $arch = $a; break; } } return $arch; } function required_loader_arch($mach_info,$os_code,$wordsize) { if ($os_code == 'win') { $arch = ($wordsize == 32)?'x86':'x86-64'; } elseif (!empty($os_code)) { $arch = match_arch_pattern($mach_info); if ($wordsize == 64) { if ($arch == 'x86') { $arch = 'x86-64'; } elseif ($arch == 'ppc') { $arch = 'ppc64'; } } } else { $arch = ERROR_UNKNOWN_ARCH; } return $arch; } function uname($part = 'a') { $result = ''; if (!function_is_disabled('php_uname')) { $result = @php_uname($part); } elseif (function_exists('posix_uname') && !function_is_disabled('posix_uname')) { $posix_equivs = array( 'm' => 'machine', 'n' => 'nodename', 'r' => 'release', 's' => 'sysname' ); $puname = @posix_uname(); if ($part == 'a' || !array_key_exists($part,$posix_equivs)) { $result = join(' ',$puname); } else { $result = $puname[$posix_equivs[$part]]; } } else { if (!function_is_disabled('phpinfo')) { ob_start(); phpinfo(INFO_GENERAL); $pinfo = ob_get_contents(); ob_end_clean(); if (preg_match('~System.*?(| => |v">)([^<]*)~i',$pinfo,$match)) { $uname = $match[2]; if ($part == 'r') { if (!empty($uname) && preg_match('/\S+\s+\S+\s+([0-9.]+)/',$uname,$matchver)) { $result = $matchver[1]; } else { $result = ''; } } else { $result = $uname; } } } else { $result = ''; } } return $result; } function calc_word_size($os_code) { $wordsize = null; if ('win' === $os_code) { ob_start(); phpinfo(INFO_GENERAL); $pinfo = ob_get_contents(); ob_end_clean(); if (preg_match('~Compiler.*?(| => |v">)([^<]*)~i',$pinfo,$compmatch)) { if (preg_match("/(VC[0-9]+)/i",$compmatch[2],$vcmatch)) { $compiler = strtoupper($vcmatch[1]); } else { $compiler = 'VC6'; } } else { $compiler = 'VC6'; } if ($compiler === 'VC9' || $compiler === 'VC11' || $compiler === 'VC14' || $compiler === 'VC15') { if (preg_match('~Architecture.*?(| => |v">)([^<]*)~i',$pinfo,$archmatch)) { if (preg_match("/x64/i",$archmatch[2])) { $wordsize = 64; } else { $wordsize = 32; } } elseif (isset($_ENV['PROCESSOR_ARCHITECTURE']) && preg_match('~(amd64|x86-64|x86_64)~i',$_ENV['PROCESSOR_ARCHITECTURE'])) { if (preg_match('~Configure Command.*?(| => |v">)([^<]*)~i',$pinfo,$confmatch)) { if (preg_match('~(x64|lib64|system64)~i',$confmatch[2])) { $wordsize = 64; } } } else { $wordsize = 32; } } } if (empty($wordsize)) { $wordsize = ((-1^0xffffffff)?64:32); } return $wordsize; } function required_loader($unamestr = '') { $un = empty($unamestr)?uname():$unamestr; $php_major_version = substr(PHP_VERSION,0,3); $os_name = substr($un,0,strpos($un,' ')); $os_code = empty($os_name)?'':strtolower(substr($os_name,0,3)); $wordsize = calc_word_size($os_code); if ($os_code == 'win' && $wordsize == 64 && $php_major_version < '5.5') { $arch = ERROR_WINDOWS_64_BIT; } else { $arch = required_loader_arch($un,$os_code,$wordsize); } if (!is_string($arch)) { return $arch; } $os_variants = supported_os_variants($os_code,$arch); if (!is_array($os_variants)) { return $os_variants; } $os_ver = ''; if (preg_match('/([0-9.]+)/',uname('r'),$match)) { $os_ver = $match[1]; } $os_ver_parts = preg_split('@\.@',$os_ver); $loader_sfix = (($os_code == 'win') ? 'dll' : 'so'); $file = "ioncube_loader_${os_code}_${php_major_version}.${loader_sfix}"; if ($os_code == 'win') { $os_name = 'Windows'; $file_ts = $file; $os_name_qual = 'Windows'; } else { $os_names = array_keys($os_variants); if (count($os_variants) > 1) { $parts = explode(" ",$os_names[0]); $os_name = $parts[0]; $os_name_qual = $os_name . ' ' . $os_ver_parts[0] . '.' . $os_ver_parts[1]; } else { $os_name = $os_names[0]; $os_name_qual = $os_name; } $file_ts = "ioncube_loader_${os_code}_${php_major_version}_ts.${loader_sfix}"; } return array( 'uname' => $un, 'arch' => $arch, 'oscode' => $os_code, 'osname' => $os_name, 'osnamequal' => $os_name_qual, 'osvariants' => $os_variants, 'osver' => $os_ver, 'osver2' => $os_ver_parts, 'file' => $file, 'file_ts' => $file_ts, 'wordsize' => $wordsize ); } function ic_system_info() { $thread_safe = null; $debug_build = null; $cgi_cli = false; $is_cgi = false; $is_cli = false; $php_ini_path = ''; $php_ini_dir = ''; $php_ini_add = ''; $is_supported_compiler = true; $php_compiler = is_ms_windows()?'VC6':''; ob_start(); phpinfo(INFO_GENERAL); $php_info = ob_get_contents(); ob_end_clean(); $breaker = (php_sapi_name() == 'cli')?'\n':''; $lines = explode($breaker,$php_info); foreach ($lines as $line) { if (preg_match('/command/i',$line)) { continue; } if (preg_match('/thread safety/i', $line)) { $thread_safe = (preg_match('/(enabled|yes)/i', $line) != 0); } if (preg_match('/debug build/i', $line)) { $debug_build = (preg_match('/(enabled|yes)/i', $line) != 0); } if (preg_match('~configuration file.*(| => |v">)([^ <]*)~i',$line,$match)) { $php_ini_path = $match[2]; if (!@file_exists($php_ini_path)) { $php_ini_path = ''; } } if (preg_match('~dir for additional \.ini files.*(| => |v">)([^ <]*)~i',$line,$match)) { $php_ini_dir = $match[2]; if (!@file_exists($php_ini_dir)) { $php_ini_dir = ''; } } if (preg_match('~additional \.ini files parsed.*(| => |v">)([^ <]*)~i',$line,$match)) { $php_ini_add = $match[2]; } if (preg_match('/compiler/i',$line)) { $supported_match = join('|',supported_win_compilers()); $is_supported_compiler = preg_match("/($supported_match)/i",$line); if (preg_match("/(VC[0-9]+)/i",$line,$match)) { $php_compiler = strtoupper($match[1]); } else { $php_compiler = ''; } } } $is_cgi = strpos(php_sapi_name(),'cgi') !== false; $is_cli = strpos(php_sapi_name(),'cli') !== false; $cgi_cli = $is_cgi || $is_cli; $ss = server_software_info(); if (!$php_ini_path && function_exists('php_ini_loaded_file')) { $php_ini_path = php_ini_loaded_file(); if ($php_ini_path === false) { $php_ini_path = ''; } } if (!empty($php_ini_path)) { $real_path = @realpath($php_ini_path); if (false !== $real_path) { $php_ini_path = $real_path; } } $php_ini_basename = basename($php_ini_path); return array( 'THREAD_SAFE' => $thread_safe, 'DEBUG_BUILD' => $debug_build, 'PHP_INI' => $php_ini_path, 'PHP_INI_BASENAME' => $php_ini_basename, 'PHP_INI_DIR' => $php_ini_dir, 'PHP_INI_ADDITIONAL' => $php_ini_add, 'PHPRC' => getenv('PHPRC'), 'CGI_CLI' => $cgi_cli, 'IS_CGI' => $is_cgi, 'IS_CLI' => $is_cli, 'PHP_COMPILER' => $php_compiler, 'SUPPORTED_COMPILER' => $is_supported_compiler, 'FULL_SS' => $ss['full'], 'SS' => $ss['short']); } function is_possibly_dedicated_or_local() { $sys = get_sysinfo(); return (empty($sys['PHP_INI']) || !@file_exists($sys['PHP_INI']) || (is_readable($sys['PHP_INI']) && (0 !== strpos($sys['PHP_INI'],$_SERVER['DOCUMENT_ROOT'])))); } function is_local() { $ret = false; if ($_SERVER["SERVER_NAME"] == 'localhost') { $ret = true; } else { $ip_address = strtolower($_SERVER["REMOTE_ADDR"]); if (strpos(':',$ip_address) === false) { $ip_parts = explode('.',$ip_address); $ret = (($ip_parts[0] == 10) || ($ip_parts[0] == 172 && $ip_parts[1] >= 16 && $ip_parts[1] <= 31) || ($ip_parts[0] == 192 && $ip_parts[1] == 168)); } else { $ret = ($ip_address == '::1') || (($ip_address[0] == 'f') && ($ip_address[1] >= 'c' && $ip_address[1] <= 'f')); } } return $ret; } function is_shared() { return !is_local() && !is_possibly_dedicated_or_local(); } function find_server_type($chosen_type = '',$type_must_be_chosen = false,$set_session = false) { $server_type = SERVER_UNKNOWN; if (empty($chosen_type)) { if ($type_must_be_chosen) { $server_type = SERVER_UNKNOWN; } else { if (isset($_SESSION['server_type']) && $_SESSION['server_type'] != SERVER_UNKNOWN) { $server_type = $_SESSION['server_type']; } elseif (is_local()) { $server_type = SERVER_LOCAL; } elseif (!is_possibly_dedicated_or_local()) { $server_type = SERVER_SHARED; } else { $server_type = SERVER_UNKNOWN; } } } else { switch ($chosen_type) { case 's': $server_type = SERVER_SHARED; break; case 'd': $server_type = SERVER_DEDICATED; break; case 'l': $server_type = SERVER_LOCAL; break; default: $server_type = SERVER_UNKNOWN; break; } } if ($set_session) { $_SESSION['server_type'] = $server_type; } return $server_type; } function server_type_string() { $server_code = find_server_type(); switch ($server_code) { case SERVER_SHARED: $server_string = 'SHARED'; break; case SERVER_LOCAL: $server_string = 'LOCAL'; break; case SERVER_DEDICATED: $server_string = 'DEDICATED'; break; default: $server_string = 'UNKNOWN'; break; } return $server_string; } function server_type_code() { $server_code = find_server_type(); switch ($server_code) { case SERVER_SHARED: $server_char = 's'; break; case SERVER_LOCAL: $server_char = 'l'; break; case SERVER_DEDICATED: $server_char = 'd'; break; default: $server_char = ''; break; } return $server_char; } function get_sysinfo() { static $sysinfo; if (empty($sysinfo)) { $sysinfo = ic_system_info(); } return $sysinfo; } function get_loaderinfo() { static $loader; if (empty($loader)) { $loader = required_loader(); } return $loader; } function is_ms_windows() { $loader_info = get_loaderinfo(); return ($loader_info['oscode'] == 'win'); } function function_is_disabled($fn_name) { $disabled_functions=explode(',',ini_get('disable_functions')); return in_array($fn_name, $disabled_functions); } function selinux_is_enabled() { $se_enabled = false; if (!is_ms_windows()) { $cmd = @shell_exec('sestatus'); $se_enabled = preg_match('/enabled/i',$cmd); } return $se_enabled; } function grsecurity_is_enabled() { $gr_enabled = false; if (!is_ms_windows()) { $cmd = @shell_exec('gradm -S'); $gr_enabled = preg_match('/enabled/i',$cmd); } return $gr_enabled; } function threaded_and_not_cgi() { $sys = get_sysinfo(); return($sys['THREAD_SAFE'] && !$sys['IS_CGI']); } function is_restricted_server($only_safe_mode = false) { $disable_functions = ini_get('disable_functions'); $open_basedir = ini_get('open_basedir'); $php_restrictions = !empty($disable_functions) || !empty($open_basedir); $system_restrictions = selinux_is_enabled() || grsecurity_is_enabled(); $non_safe_mode_restrictions = $php_restrictions || $system_restrictions; return (ini_get('safe_mode') || (!$only_safe_mode && $non_safe_mode_restrictions)); } function server_restriction_warnings() { $warnings = array(); if (find_server_type() == SERVER_SHARED) { if (is_restricted_server()) { $warnings[] = "Server restrictions are in place which might affect the operation of this Loader Wizard or prevent the installation of the Loader."; } } else { $warning_suffix = "This may affect the operation of this Loader Wizard."; if (ini_get('safe_mode')) { $warnings[] = "Safe mode is in effect on the server. " . $warning_suffix; } $disabled_functions = ini_get('disable_functions'); if (!empty($disabled_functions)) { $warnings[] = "Some functions are disabled through disable_functions. " . $warning_suffix; } $open_basedir = ini_get('open_basedir'); if (!empty($open_basedir)) { $warnings[] = "Open basedir restrictions are in effect. " . $warning_suffix; } } return $warnings; } function own_php_ini_possible($only_safe_mode = false) { $sysinfo = get_sysinfo(); return ($sysinfo['CGI_CLI'] && !is_ms_windows() && !is_restricted_server($only_safe_mode)); } function extension_dir() { $extdir = ini_get('extension_dir'); if ($extdir == './' || ($extdir == '.\\' && is_ms_windows())) { $extdir = '.'; } return $extdir; } function possibly_selinux() { $loaderinfo = get_loaderinfo(); $se_env = (getenv("SELINUX_INIT")); return (strtolower($loaderinfo['osname']) == 'linux' && $se_env && ($se_env == 'Yes' || $se_env == '1')); } function ini_same_dir_as_wizard() { $sys = get_sysinfo(); return dirname($sys['PHP_INI']) == dirname(__FILE__); } function extension_dir_path() { $ext_dir = extension_dir(); if ($ext_dir == '.' || (dirname($ext_dir) == '.')) { $ext_dir_path = @realpath($ext_dir); } else { $ext_dir_path = $ext_dir; } return $ext_dir_path; } function get_loader_name() { $u = uname(); $sys = get_sysinfo(); $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' : (($sys['THREAD_SAFE'])?'_ts.so':'.so')); $loader_name="ioncube_loader_${os_key}_${php_family}${loader_sfix}"; return $loader_name; } function get_reqd_version($variants) { $exact_match = false; $nearest_version = 0; $loader_info = get_loaderinfo(); $os_version = $loader_info['osver2'][0] . '.' . $loader_info['osver2'][1]; $os_version_major = $loader_info['osver2'][0]; foreach ($variants as $v) { if ($v == $os_version || (is_int($v) && $v == $os_version_major)) { $exact_match = true; $nearest_version = $v; break; } elseif ($v > $os_version) { break; } else { $nearest_version = $v; } } return (array($nearest_version,$exact_match)); } function get_default_loader_dir_webspace() { return ($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . LOADER_SUBDIR); } function get_loader_location($loader_dir = '') { if (empty($loader_dir)) { $loader_dir = get_default_loader_dir_webspace(); } $loader_name = get_loader_name(); return ($loader_dir . DIRECTORY_SEPARATOR . $loader_name); } function get_loader_location_from_ini($php_ini = '') { $errors = array(); if (empty($php_ini)) { $sysinfo = get_sysinfo(); $php_ini = $sysinfo['PHP_INI']; } if (!@file_exists($php_ini)) { if (empty($php_ini)) { $errors[ERROR_INI_NOT_FOUND] = "The configuration file could not be found."; } else { $errors[ERROR_INI_NOT_FOUND] = "The $php_ini file could not be found."; } } elseif (!is_readable($php_ini)) { $errors[ERROR_INI_NOT_READABLE] = "The $php_ini file could not be read."; } if (!empty($errors)) { return array('location' => '', 'errors' => $errors); } $lines = file($php_ini); $ext_start = zend_extension_line_start(); $wrong_ext_start = ($ext_start == 'zend_extension')?'zend_extension_ts':'zend_extension'; $loader_path = ''; $loader_name_match = "ioncube_loader"; foreach ($lines as $l) { if (preg_match("/^\s*$ext_start\s*=\s*\"?([^\"]+)\"?/i",$l,$corr_matches)) { if (preg_match("/$loader_name_match/i",$corr_matches[1])) { if (!empty($loader_path)) { $errors[ERROR_INI_MULTIPLE_IC_LOADER_LINES] = "It appears that multiple $ext_start lines for the ionCube Loader have been included in the configuration file, $php_ini."; } $loader_path = $corr_matches[1]; } else { if (empty($loader_path)) { $errors[ERROR_INI_NOT_FIRST_ZE] = "The ionCube Loader must be the first Zend extension listed in the configuration file, $php_ini."; } } } if (empty($loader_path)) { if (preg_match("/^\s*$wrong_ext_start\s*=\s*\"?([^\"]+)\"?/i",$l,$bad_start_matches)) { if (preg_match("/$loader_name_match/i",$bad_start_matches[1])) { $bad_zend_ext_msg = "The line for the ionCube Loader in the configuration file, $php_ini, should start with $ext_start and not $wrong_ext_start."; $errors[ERROR_INI_WRONG_ZE_START] = $bad_zend_ext_msg; $loader_path = $bad_start_matches[1]; } } } } $loader_path = trim($loader_path); if ($loader_path === '') { $errors[ERROR_INI_ZE_LINE_NOT_FOUND] = "The necessary zend_extension line could not be found in the configuration file, $php_ini."; } elseif (!@file_exists($loader_path)) { $errors[ERROR_INI_LOADER_FILE_NOT_FOUND] = "The loader file $loader_path, listed in the configuration file, $php_ini, does not exist or is not accessible."; } elseif (basename($loader_path) == $loader_path) { $errors[ERROR_INI_NOT_FULL_PATH] = "A full path must be specified for the loader file in the configuration file, $php_ini."; } return array('location' => $loader_path, 'errors' => $errors); } function zend_extension_line_missing($ini_path) { $loader_loc = get_loader_location_from_ini($ini_path); return (!empty($loader_loc['errors']) && array_key_exists(ERROR_INI_ZE_LINE_NOT_FOUND,$loader_loc['errors'])); } function find_additional_ioncube_ini() { $sys = get_sysinfo(); $ioncube_ini = ''; if (!empty($sys['PHP_INI_ADDITIONAL']) && !preg_match('/(none)/i',$sys['PHP_INI_ADDITIONAL'])) { $ini_files = explode(',',$sys['PHP_INI_ADDITIONAL']); foreach ($ini_files as $f) { $fn = trim($f); $bfn = basename($fn); if (preg_match('/ioncube/i',$bfn)) { $ioncube_ini = $fn; break; } } } return $ioncube_ini; } function get_additional_ini_files() { $sys = get_sysinfo(); $ini_files = array(); if (!empty($sys['PHP_INI_ADDITIONAL']) && !preg_match('/(none)/i',$sys['PHP_INI_ADDITIONAL'])) { $ini_files = explode(',',$sys['PHP_INI_ADDITIONAL']); } return (array_map('trim',$ini_files)); } function all_ini_contents() { $sys = get_sysinfo(); $output = ''; $output .= ";;; *MAIN INI FILE AT ${sys['PHP_INI']}* ;;;" . PHP_EOL; $output .= get_file_contents($sys['PHP_INI']); $other_inis = get_additional_ini_files(); foreach ($other_inis as $inif) { $output .= ";;; *Additional ini file at $inif* ;;;" . PHP_EOL; $output .= get_file_contents($inif); } $here = unix_path_dir(); $unrec_ini_files = unrecognised_inis_webspace($here); foreach ($unrec_ini_files as $urinif) { $output .= ";;; *UNRECOGNISED INI FILE at $urinif* ;;;" . PHP_EOL; $output .= get_file_contents($urinif); } return $output; } function scan_inis_for_loader() { $ldloc = array('location' => '', 'errors' => array()); $sysinfo = get_sysinfo(); if (empty($sysinfo['PHP_INI'])) { $ini_files_not_found = array("Main ini file"); $ini_file_list = get_additional_ini_files(); } else { $ini_files_not_found = array(); $ini_file_list = array_merge(array($sysinfo['PHP_INI']),get_additional_ini_files()); } $server_type = find_server_type(); $shared_server = SERVER_SHARED == $server_type; foreach ($ini_file_list as $f) { $ldloc = get_loader_location_from_ini($f); if (array_key_exists(ERROR_INI_ZE_LINE_NOT_FOUND,$ldloc['errors'])) { unset($ldloc['errors'][ERROR_INI_ZE_LINE_NOT_FOUND]); } if ($shared_server && array_key_exists(ERROR_INI_NOT_FOUND,$ldloc['errors'])) { if (false == user_ini_space_path($f)) { $ldloc['errors'][ERROR_INI_NOT_FOUND] = "A system ini file cannot be found or read by the Wizard - you cannot do anything about this on your shared server."; } else { $ldloc['errors'][ERROR_INI_USER_INI_NOT_FOUND] = $ldloc['errors'][ERROR_INI_NOT_FOUND]; } } elseif (array_key_exists(ERROR_INI_NOT_FOUND,$ldloc['errors'])) { $ini_files_not_found[] = $f; } if (!empty($ldloc['location'])) { break; } } if (!empty($ini_files_not_found)) { $plural = (count($ini_files_not_found) > 1)?"s":""; $ldloc['errors'][ERROR_INI_NOT_FOUND] = "The following ini file$plural could not be found by the Wizard: " . join(',',$ini_files_not_found); if (is_restricted_server()) { $ldloc['errors'][ERROR_INI_NOT_FOUND] .= "
This may be due to server restrictions in place."; } } if (empty($ldloc['location'])) { $ldloc['errors'][ERROR_INI_ZE_LINE_NOT_FOUND] = "The necessary zend_extension line could not be found in the configuration."; } return $ldloc; } function find_loader_filesystem() { $ld_inst_dir = loader_install_dir(find_server_type()); $loader_name = get_loader_name(); $suggested_loader_path = $ld_inst_dir . DIRECTORY_SEPARATOR . $loader_name; if (@file_exists($suggested_loader_path)) { $location = $suggested_loader_path; } elseif (@file_exists($loader_name)) { $location = @realpath($loader_name); } else { $ld_loc = get_loader_location(); if (@file_exists($ld_loc)) { $location = $ld_loc; } else { $location = ''; } } return $location; } function find_loader($search_directories_if_not_ini = false) { $sysinfo = get_sysinfo(); $php_ini = $sysinfo['PHP_INI']; $rtl_path = get_runtime_loading_path_if_applicable(); $location = ''; $errors = array(); if (!empty($rtl_path)) { $location = $rtl_path; } else { $loader_ini = scan_inis_for_loader(); $location = $loader_ini['location']; $errors = $loader_ini['errors']; } if (empty($location) && (empty($errors) || $search_directories_if_not_ini)) { $errors = array(); $location = find_loader_filesystem(); if (empty($location)) { $errors[ERROR_LOADER_NOT_FOUND] = 'The loader file could not be found in standard locations.'; } } if (!empty($errors)) { return $errors; } else { return $location; } } function zend_extension_line_start() { $sysinfo = get_sysinfo(); $is_53_or_later = is_php_version_or_greater(5,3); return (is_bool($sysinfo['THREAD_SAFE']) && $sysinfo['THREAD_SAFE'] && !$is_53_or_later ? 'zend_extension_ts' : 'zend_extension'); } function ioncube_loader_version_information() { $old_version = true; $liv = ""; $lv = ""; $mv = 0; if (function_exists('ioncube_loader_iversion')) { $liv = ioncube_loader_iversion(); $lv = sprintf("%d.%d.%d", $liv / 10000, ($liv / 100) % 100, $liv % 100); $latest_version = get_latestversion(); $lat_parts = explode('.',$latest_version); $cur_parts = explode('.',$lv); if (($cur_parts[0] > $lat_parts[0]) || ($cur_parts[0] == $lat_parts[0] && $cur_parts[1] > $lat_parts[1]) || ($cur_parts[0] == $lat_parts[0] && $cur_parts[1] == $lat_parts[1] && $cur_parts[2] >= $lat_parts[2])) { $old_version = false; } else { $old_version = $latest_version; } $mv = $cur_parts[0]; } return array($lv,$mv,$old_version); } function default_loader_version_info() { return array(); } function get_loader_version_info() { return get_remote_session_value('loader_version_info',LOADER_LATEST_VERSIONS_URL,'default_loader_version_info'); } function calc_platform() { $platform = array(); $platform_info = get_platforminfo(); $loader = get_loaderinfo(); $multiple_os_versions = false; if (is_array($loader) && array_key_exists('osvariants',$loader) && is_array($loader['osvariants'])) { $versions = array_values($loader['osvariants']); $multiple_os_versions = !empty($versions[0]); } if ($multiple_os_versions) { list($osvar,$exact_match) = get_reqd_version($loader['osvariants']); } else { $osvar = null; if (is_ms_windows()) { $sys = get_sysinfo(); $phpc = (empty($sys['PHP_COMPILER']))?'vc6':strtolower($sys['PHP_COMPILER']); $osvar = ($sys['THREAD_SAFE']?'':'nonts_') . $phpc; } } foreach ($platform_info as $p) { if ($p['os'] == $loader['oscode'] && $p['arch'] == $loader['arch'] && (empty($osvar) || $p['os_mod'] == "_" . $osvar)) { $platform = $p; break; } } return $platform; } function get_platform() { static $this_platform; if (!isset($this_platform)) { $this_platform = calc_platform(); } return $this_platform; } function is_legacy_platform() { $platform = get_platform(); return array_key_exists('is_legacy',$platform); } function calc_dirname() { $dirname = ''; $platform = get_platform(); if (!empty($platform)) { $dirname = $platform['dirname']; } return $dirname; } function calc_loader_latest_version() { $lv_info = get_loader_version_info(); $latest_version = RECENT_LOADER_VERSION; if (!empty($lv_info)) { $dirname = calc_dirname(); if (!empty($dirname)) { $compiler_specific_version = false; if (is_ms_windows()) { $sys = get_sysinfo(); $phpc = strtolower($sys['PHP_COMPILER']); if (!empty($phpc)) { $dirname_comp = $dirname . "_" . $phpc; if (array_key_exists($dirname_comp,$lv_info)) { $latest_version = $lv_info[$dirname_comp]; $compiler_specific_version = true; } } } if (!$compiler_specific_version && array_key_exists($dirname,$lv_info)) { $latest_version = $lv_info[$dirname]; } } } return $latest_version; } function get_latestversion() { static $latest_version; if (empty($latest_version)) { $latest_version = calc_loader_latest_version(); } return $latest_version; } function runtime_loader_location() { $loader_path = false; $ext_path = extension_dir_path(); if ($ext_path !== false) { $id = $ext_path; $here = dirname(__FILE__); if (isset($id[1]) && $id[1] == ':') { $id = str_replace('\\','/',substr($id,2)); $here = str_replace('\\','/',substr($here,2)); } $rd=str_repeat('/..',substr_count($id,'/')).$here.'/'; $i=strlen($rd); $loader_loc = DIRECTORY_SEPARATOR . basename($here) . DIRECTORY_SEPARATOR . get_loader_name(); while($i--) { if($rd[$i]=='/') { $loader_path = runtime_location_exists($ext_path,$rd,$i,$loader_loc); if ($loader_path !== false) { break; } } } if (!$loader_path && !empty($loader_loc) && @file_exists($loader_loc)) { $loader_path = basename($loader_loc); } } return $loader_path; } function runtime_location_exists($ext_dir,$path_str,$sep_pos,$loc_name) { $sub_path = substr($path_str,0,$sep_pos); $lp = $sub_path . $loc_name; $fqlp = $ext_dir.$lp; if(@file_exists($fqlp)) { return $lp; } else { return false; } } function runtime_loading_is_possible() { return !((is_php_version_or_greater(5,2,5)) || is_restricted_server() || !ini_get('enable_dl') || !function_exists('dl') || function_is_disabled('dl') || threaded_and_not_cgi()); } function shared_and_runtime_loading() { return (find_server_type() == SERVER_SHARED && empty($_SESSION['use_ini_method']) && runtime_loading_is_possible()); } function get_valid_runtime_loading_path($ignore_loading_check = false) { if ($ignore_loading_check || runtime_loading_is_possible()) { return runtime_loader_location(); } else { return false; } } function runtime_loading($rtl_path = null) { if (empty($rtl_path)) { $rtl_path = get_valid_runtime_loading_path(); } if (!empty($rtl_path) && @dl($rtl_path)) { return $rtl_path; } else { return false; } } function get_runtime_loading_path_if_applicable() { $rtl = null; if (shared_and_runtime_loading()) { $rtl = get_valid_runtime_loading_path(); } return $rtl; } function try_runtime_loading_if_applicable() { $rtl_path = get_runtime_loading_path_if_applicable(); if (!empty($rtl_path)) { return runtime_loading($rtl_path); } else { return $rtl_path; } } function runtime_loading_instructions() { $default = get_default_address(); echo '
Runtime Loading Instructions
'; echo '
'; echo '

On your shared server the Loader can be installed using the runtime loading method.'; echo " (Please click here if you are not on a shared server.)
"; if ('.' == extension_dir()) { $dirphrase = is_ms_windows()?'folder':'directory'; echo "Please note that on your system the Loader must be present in the same " . $dirphrase . " as the first encoded file accessed."; } echo '

'; loader_download_instructions(); $loader_dir = loader_install_instructions(SERVER_SHARED,dirname(__FILE__)); shared_test_instructions(); echo '

'; echo '
'; } function runtime_loading_errors() { $errors = array(); $ext_path = extension_dir_path(); if (false === $ext_path) { $errors[ERROR_RUNTIME_EXT_DIR_NOT_FOUND] = "Extensions directory cannot be found."; } else { $expected_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . get_loader_name(); if (!@file_exists($expected_file)) { $errors[ERROR_RUNTIME_LOADER_FILE_NOT_FOUND] = "The Loader file was expected to be at $expected_file but could not be found."; } else { $errors = loader_compatibility_test($expected_file); } } return $errors; } function windows_package_name() { $sys = get_sysinfo(); $loader = get_loaderinfo(); return (LOADERS_PACKAGE_PREFIX . 'win' . '_' . ($sys['THREAD_SAFE']?'':'nonts_') . strtolower($sys['PHP_COMPILER']) . '_' . $loader['arch']); } function unix_package_name() { $sysinfo = get_sysinfo(); $loader = get_loaderinfo(); $multiple_os_versions = false; if (is_array($loader) && array_key_exists('osvariants',$loader) && is_array($loader['osvariants'])) { $versions = array_values($loader['osvariants']); $multiple_os_versions = !empty($versions[0]); } if ($multiple_os_versions) { list($reqd_version,$exact_match) = get_reqd_version($loader['osvariants']); if ($reqd_version) { $basename = LOADERS_PACKAGE_PREFIX . $loader['oscode'] . '_' . $reqd_version . '_' . $loader['arch']; } else { $basename = ""; } } else { $basename = LOADERS_PACKAGE_PREFIX . $loader['oscode'] . '_' . $loader['arch']; } return array($basename,$multiple_os_versions); } function loader_download_instructions() { $sysinfo = get_sysinfo(); $loader = get_loaderinfo(); $multiple_os_versions = false; if (is_ms_windows()) { if (is_bool($sysinfo['THREAD_SAFE'])) { $download_str = '
Download the following archive of Windows ' . $sysinfo['PHP_COMPILER']; if (!$sysinfo['THREAD_SAFE']) { $download_str .= ' non-TS'; } $download_str .= ' ' . $loader['arch'] . ' Loaders:'; echo $download_str; $basename = windows_package_name(); echo make_archive_list($basename,array('zip')); echo 'A Loaders archive can also be downloaded from ' . LOADERS_PAGE . '.'; } else { echo '
Download a Windows Loaders archive from here. If PHP is built with thread safety disabled, use the Windows non-TS Loaders.'; } } else { list($basename,$multiple_os_versions) = unix_package_name(); if ($basename == "") { echo '
Download a ' . $loader['osname'] . ' ' . $loader['arch'] . ' Loaders archive from here.'; echo "
Your system appears to be ${loader['osnamequal']} for ${loader['wordsize']} bit. If Loaders are not available for that exact release of ${loader['osname']}, Loaders built for an earlier release should work. Note that you may need to install back compatibility libraries for the operating system."; echo '
If you cannot find a suitable loader then please raise a ticket at our support helpdesk.'; } else { echo '
Download one of the following archives of Loaders for ' . $loader['osnamequal'] . ' ' . $loader['arch'] . ':'; if (SERVER_SHARED == find_server_type()) { $archives = array('zip','tar.gz','tar.bz2'); } else { $archives = array('tar.gz','tar.bz2'); } echo make_archive_list($basename,$archives); echo "

"; if ($multiple_os_versions && !$exact_match) { echo "

Note that you may need to install back compatibility libraries for ${loader['osname']}.
"; } } } echo '
'; } function ini_dir() { $sysinfo = get_sysinfo(); $parent_dir = ''; if (!empty($sysinfo['PHP_INI'])) { $parent_dir = dirname($sysinfo['PHP_INI']); } else { $parent_dir = $_SERVER["PHPRC"]; if (@is_file($parent_dir)) { $parent_dir = dirname($parent_dir); } } return $parent_dir; } function unix_install_dir() { $ext_dir = extension_dir_path(); $cur_dir = @realpath('.'); if (empty($ext_dir) || $ext_dir == $cur_dir) { $loader_dir = UNIX_SYSTEM_LOADER_DIR; } else { $loader_dir = $ext_dir; } return $loader_dir; } function windows_install_dir() { $sysinfo = get_sysinfo(); if ($sysinfo['SS'] == 'IIS') { if (false === ($ext_dir = extension_dir_path())) { $parent_dir = ini_dir(); $ext_dir = $parent_dir . '\\ext'; if (!empty($parent_dir) && @file_exists($ext_dir)) { $loader_dir = $ext_dir; } else { $loader_dir = $_SERVER['windir'] . '\\' . WINDOWS_IIS_LOADER_DIR; } } else { $loader_dir = $ext_dir; } } else { if (false === ($ext_dir = extension_dir_path())) { $parent_dir = ini_dir(); $loader_dir = $parent_dir . '\\' . 'ioncube'; } else { $loader_dir = $ext_dir; } } return $loader_dir; } function loader_install_dir($server_type) { if (SERVER_SHARED == $server_type && own_php_ini_possible()) { $loader_dir = get_default_loader_dir_webspace(); } elseif (is_ms_windows()) { $loader_dir = windows_install_dir(); } else { $loader_dir = unix_install_dir(); } return $loader_dir; } function writeable_directories() { $root_path = @realpath($_SERVER['DOCUMENT_ROOT']); $above_root_path = @realpath($_SERVER['DOCUMENT_ROOT'] . "/.."); $root_path_cgi_bin = @realpath($_SERVER['DOCUMENT_ROOT'] . "/cgi-bin"); $above_root_cgi_bin = @realpath($_SERVER['DOCUMENT_ROOT'] . "/../cgi-bin"); $paths = array(); foreach (array($root_path,$above_root_path,$root_path_cgi_bin,$above_root_cgi_bin) as $p) { if (@is_writeable($p)) { $paths[] = $p; } } return $paths; } function loader_install_instructions($server_type,$loader_dir = '') { if (empty($loader_dir)) { $loader_dir = loader_install_dir($server_type); } if (SERVER_LOCAL == $server_type) { echo "
Put the Loader files in $loader_dir
"; } else { echo "
Transfer the Loaders to your web server and install in $loader_dir
"; } return $loader_dir; } function zend_extension_lines($loader_dir) { $zend_extension_lines = array(); $sysinfo = get_sysinfo(); $qt = (is_ms_windows()?'"':''); $loader = get_loaderinfo(); if (!is_bool($sysinfo['THREAD_SAFE']) || !$sysinfo['THREAD_SAFE']) { $path = $qt . $loader_dir . DIRECTORY_SEPARATOR . $loader['file'] . $qt; $zend_extension_lines[] = "zend_extension = " . $path; } if ((!is_bool($sysinfo['THREAD_SAFE']) && !is_php_version_or_greater(5,3)) || $sysinfo['THREAD_SAFE']) { $line_start = is_php_version_or_greater(5,3)?'zend_extension':'zend_extension_ts'; $path = $qt . $loader_dir . DIRECTORY_SEPARATOR . $loader['file_ts'] . $qt; $zend_extension_lines[] = $line_start . " = " . $path; } return $zend_extension_lines; } function user_ini_base() { $doc_root_path = realpath($_SERVER['DOCUMENT_ROOT']); $above_root_path = @realpath($_SERVER['DOCUMENT_ROOT'] . "/.."); if (!empty($above_root_path) && @is_writeable($above_root_path)) { $start_path = $above_root_path; } else { $start_path = $doc_root_path; } return $start_path; } function user_ini_space_path($file) { $user_base = user_ini_base(); $fpath = @realpath($file); if (!empty($fpath) && (0 === strpos($fpath,$user_base))) { return $fpath; } else { return false; } } function default_ini_path() { return (realpath($_SERVER['DOCUMENT_ROOT'])); } function shared_ini_location() { $phprc = getenv('PHPRC'); if (!empty($phprc)) { $phprc_path = user_ini_space_path($phprc); if (false !== $phprc_path) { return $phprc_path; } else { return default_ini_path(); } } else { return default_ini_path(); } } function zend_extension_instructions($server_type,$loader_dir) { $sysinfo = get_sysinfo(); $base = get_base_address(); $editing_ini = true; $php_ini_name = ini_file_name(); if (isset($sysinfo['PHP_INI']) && @file_exists($sysinfo['PHP_INI'])) { $php_ini_path = $sysinfo['PHP_INI']; } else { $php_ini_path = ''; } if (is_bool($sysinfo['THREAD_SAFE'])) { $kwd = zend_extension_line_start(); } else { $kwd = 'zend_extension/zend_extension_ts'; } $server_type_code = server_type_code(); $zend_extension_lines = zend_extension_lines($loader_dir); if (SERVER_SHARED == $server_type && own_php_ini_possible()) { $ini_dir = shared_ini_location(); $php_ini_path = $ini_dir . DIRECTORY_SEPARATOR . $php_ini_name; if (@file_exists($php_ini_path)) { $edit_line = "
Edit the $php_ini_name in the $ini_dir directory"; if (zend_extension_line_missing($php_ini_path) && @is_writeable($php_ini_path) && @is_writeable($ini_dir)) { if (function_exists('file_get_contents')) { $ini_strs = @file_get_contents($php_ini_path); } else { $lines = @file($php_ini_path); $ini_strs = join(' ',$lines); } $fh = @fopen($php_ini_path,"wb"); if ($fh !== false) { foreach ($zend_extension_lines as $zl) { fwrite($fh,$zl . PHP_EOL); } fwrite($fh,$ini_strs); fclose($fh); $editing_ini = false; echo "
Your php.ini file at $php_ini_path has been modified to include the necessary line for the ionCube Loader."; } else { echo $edit_line; } } else { echo $edit_line; } } else { $download_ini_file = "
Save this $php_ini_name file and upload it to $ini_dir (full path on your server)."; if (@is_writeable($ini_dir)) { $fh = @fopen($php_ini_path,"wb"); if ($fh !== false) { foreach ($zend_extension_lines as $zl) { fwrite($fh,$zl . PHP_EOL); } if (!empty($sysinfo['PHP_INI']) && is_readable($sysinfo['PHP_INI'])) { if (function_exists('file_get_contents')) { $ini_strs = @file_get_contents($sysinfo['PHP_INI']); } else { $lines = @file($sysinfo['PHP_INI']); $ini_strs = join(' ',$lines); } fwrite($fh,$ini_strs); } fclose($fh); echo "
A $php_ini_name file has been created for you in $ini_dir."; } else { echo $download_ini_file; } } else { echo $download_ini_file; } $editing_ini = false; } } elseif (!empty($sysinfo['PHP_INI'])) { if (empty($sysinfo['PHP_INI_DIR'])) { echo "
Edit the file ${sysinfo['PHP_INI']}"; } else { $php_ini_path = find_additional_ioncube_ini(); if (empty($php_ini_path)) { $php_ini_name = ADDITIONAL_INI_FILE_NAME; echo "
Save this $php_ini_name file and put it in your ini files directory, ${sysinfo['PHP_INI_DIR']}"; $editing_ini = false; } else { $php_ini_name = basename($php_ini_path); echo "
Edit the file $php_ini_path"; } } } else { echo "
Edit the system $php_ini_name file"; } if ($editing_ini) { echo " and before any other $kwd lines ensure that the following is included:
"; foreach ($zend_extension_lines as $zl) { echo "$zl
"; } if (!empty($php_ini_path)) { if (zend_extension_line_missing($php_ini_path)) { echo "Alternatively, replace your current $php_ini_path file with this new $php_ini_name file."; } } } echo '
'; } function server_restart_instructions() { $sysinfo = get_sysinfo(); $base = get_base_address(); if ($sysinfo['SS']) { echo "
Restart the ${sysinfo['SS']} server software.
"; } else { echo "
Restart the server software.
"; } echo "
When the server software has restarted, click here to test the Loader.
"; if ($sysinfo['SS'] == 'Apache' && !is_ms_windows()) { echo '
If the Loader installation failed, check the Apache error log file for errors and see our guide to Unix related errors.
'; } } function shared_test_instructions() { $base = get_base_address(); echo "
Click here to test the Loader.
"; } function link_to_php_ini_instructions() { $default = get_default_address(); echo "

Please click here for instructions on using the php.ini method instead.
"; } function php_ini_instruction_list($server_type) { echo '
Installation Instructions
'; echo '
'; echo '

'; loader_download_instructions(); $loader_dir = loader_install_instructions($server_type); zend_extension_instructions($server_type,$loader_dir); if ($server_type != SERVER_SHARED || !own_php_ini_possible()) { server_restart_instructions(); } else { shared_test_instructions(); } echo '

'; echo '
'; } function php_ini_install_shared($give_preamble = true) { $php_ini_name = ini_file_name(); $default = get_default_address(); if ($give_preamble) { echo "

On your shared server, the Loader should be installed using a $php_ini_name configuration file."; echo " (Please click here if you are not on a shared server.)
"; } if (own_php_ini_possible()) { echo '

With your hosting account, you may be able to use your own PHP configuration file.
'; } else { echo "

It appears that you cannot install the ionCube Loader using the $php_ini_name file. Your server provider or system administrator should be able to perform the installation for you. Please refer them to the following instructions.
"; } php_ini_instruction_list(SERVER_SHARED); } function php_ini_install($server_type_desc = null, $server_type = SERVER_DEDICATED, $required = true) { $php_ini_name = ini_file_name(); $default = get_default_address(); echo '

'; if ($server_type_desc) { echo "For a $server_type_desc server "; } else { echo "For this server "; } if ($required) { echo "you should install the ionCube Loader using the $php_ini_name configuration file."; } else { echo "installing the ionCube Loader using the $php_ini_name file is recommended."; } if ($server_type_desc) { echo " (Please click here if you are not on a $server_type_desc server.)"; } echo '
'; php_ini_instruction_list($server_type); } function help_resources($error_list = array()) { $self = get_self(); $base = get_base_address(); $server_type_code = server_type_code(); $server_type = find_server_type(); $sysinfo = get_sysinfo(); $resources = array( 'ionCube Loaders FAQ', 'ionCube Loader Forum' ); if (SERVER_SHARED != $server_type || own_php_ini_possible(true)) { $support_info = array ( 'department' => WIZARD_SUPPORT_TICKET_DEPARTMENT, 'subject' => "ionCube Loader installation problem", 'message' => support_ticket_information() ); if (SERVER_LOCAL == $server_type && !info_should_be_disabled()) { $temp_files = system_info_temporary_files(); } else { $temp_files = NULL; } if (!empty($temp_files)) { $support_info['ini'] = base64_encode(file_get_contents($temp_files['ini'])); $support_info['phpinfo'] = base64_encode(file_get_contents($temp_files['phpinfo'])); $support_info['additional'] = base64_encode(file_get_contents($temp_files['additional'])); $loader_path = find_loader(true); if (is_string($loader_path)) { $support_info['loader'] = base64_encode(file_get_contents($loader_path)); $support_info['loader_name'] = basename($loader_path); } else { $support_info['loader'] = ''; $support_info['loader_name'] = ''; } } else { $support_info['ini'] = ''; $support_info['phpinfo'] = ''; $support_info['additional'] = ''; $support_info['loader'] = '
石洋洋 2018-06-08 15:23:17
1、如果使用的是禅道一键安装包,不需要安装,默认已经集成好了。
2、如果是自己搭建的环境,环境搭建的有问题,没有对php文件进行解析。
ckc 2018-06-05 09:07:23
安装成功了,但提示The file /home/preown6/public_html/init.php was encoded by the ionCube Encoder for PHP 4.0 and cannot run under PHP 7.0
禅道-Bee 2018-06-05 11:25:15
可以联系下官网顶部的商务QQ,邀请加入禅道技术交流群,在群里截图提问下。
孙智华 2018-03-13 19:13:52
C:\xampp\apache目录没有www或者htdoc目录 这个压缩包放在哪?
石洋洋 2018-03-14 08:16:19
只要放在网页可以访问的目录,然后用浏览器访问即可。
朱峰 2018-02-12 17:26:09
目前是一键安装包的9.5.1 php解压后放置在 htdoc中
http://localhost:10080/loader-wizard.php打开内容开不大明白 截取如下,请帮忙判断是出了什么问题
?Download one of the following archives of Windows ' . $sysinfo['PHP_COMPILER']; if (!$sysinfo['THREAD_SAFE']) { $download_str .= ' non-TS'; } $download_str .= ' ' . $loader['arch'] . ' Loaders:'; echo $download_str; $basename = windows_package_name(); echo make_archive_list($basename,array('zip','ipf.zip')); echo "
Please note that the MS Windows installer version is suitable either for direct installation on a Windows machine or for uploading from a local PC to your server.
"; echo 'A Loaders archive can also be downloaded from ' . LOADERS_PAGE . '.'; } else { echo '

?Download a Windows Loaders archive from here. If PHP is built with thread safety disabled, use the Windows non-TS Loaders.'; } } else { list($basename,$multiple_os_versions) = unix_package_name(); if ($basename == "") { echo '
?Download a ' . $loader['osname'] . ' ' . $loader['arch'] . ' Loaders archive from here.'; echo "
Your system appears to be ${loader['osnamequal']} for ${loader['wordsize']} bit. If Loaders are not available for that exact release of ${loader['osname']}, Loaders built for an earlier release should work. Note that you may need to install back compatibility libraries for the operating system."; echo '
If you cannot find a suitable loader then please raise a ticket at our support helpdesk.'; } else { echo '
?Download one of the following archives of Loaders for ' . $loader['osnamequal'] . ' ' . $loader['arch'] . ':'; if (SERVER_SHARED == find_server_type()) { $archives = array('zip','tar.gz','tar.bz2','ipf.zip'); } else { $archives = array('tar.gz','tar.bz2','ipf.zip'); } echo make_archive_list($basename,$archives); echo "
Please note that the MS Windows installer version is suitable for uploading from a Windows PC to your ${loader['osname']} server.
"; echo "
"; if ($multiple_os_versions && !$exact_match) { echo "
Note that you may need to install back compatibility libraries for ${loader['osname']}.
石洋洋 2018-02-12 17:28:57
一键安装包中默认已经集成好了 ioncube,不需要安装的。
1/4
发表评论
评论通过审核后显示。