function ini_loader_warnings() { $warnings = array(); if (find_server_type() == SERVER_SHARED) { if (own_php_ini_possible()) { $sys = get_sysinfo(); $ini_name = ini_file_name(); $rootpath = realpath($_SERVER['DOCUMENT_ROOT']); $root_ini_file = $rootpath . DIRECTORY_SEPARATOR . $ini_name; $cgibinpath = @realpath($_SERVER['DOCUMENT_ROOT'] . "/cgi-bin"); $cgibin_ini_file = empty($cgibinpath) ? '' : $cgibinpath . DIRECTORY_SEPARATOR . $ini_name; $here = unix_path_dir(); $ini_files = unrecognised_inis_webspace($here); $shared_ini_loc = shared_ini_location(); $shared_ini_file = $shared_ini_loc . DIRECTORY_SEPARATOR . $ini_name; $ini_dir = dirname($sys['PHP_INI']); $all_ini_locations_used = !empty($ini_files); foreach ($ini_files as $full_ini_loc) { $advice = "The file {$full_ini_loc} is not being recognised by PHP."; $advice .= " Please check that the name and location of the file are correct."; if (!ini_same_dir_as_wizard()) { $ini_loc_dir = dirname($full_ini_loc); if (!@file_exists($shared_ini_file) && !empty($shared_ini_loc) && $ini_loc_dir != $shared_ini_loc && $ini_dir != $shared_ini_loc) { $all_ini_locations_used = false; $advice .= " Please try copying the <code>{$full_ini_loc}</code> file to <code>" . $shared_ini_loc . "</code>."; } else { if (!@file_exists($root_ini_file) && $rootpath != $shared_ini_loc && $full_ini_loc != $rootpath) { $all_ini_locations_used = false; $advice .= " Please try copying the <code>{$full_ini_loc}</code> file to <code>" . $rootpath . "</code>."; } if (!empty($cgibin_ini_file) && !@file_exists($cgibin_ini_file) && $cgibinpath != $shared_ini_loc && $full_ini_loc != $cgibinpath && $cgibinpath != $rootpath) { $all_ini_locations_used = false; $advice .= " Please try copying the <code>{$full_ini_loc}</code> file to <code>" . $cgibinpath . "</code>."; } $herepath = realpath($here); $here_ini_file = $herepath . DIRECTORY_SEPARATOR . $ini_name; if (!@file_exists($here_ini_file) && $herepath != $rootpath && $herepath != $cgibinpath) { $all_ini_locations_used = false; $advice .= " It may be necessary to copy the <code>{$full_ini_loc}</code> file to <code>{$herepath}</code> and to all " . (is_ms_windows() ? 'folders' : 'directories') . ' in which you have encoded files'; } } } else { $all_ini_locations_used = false; } $warnings[] = $advice; } if ($all_ini_locations_used) { $warnings[] = "<strong>It looks as if ini files are not being recognised in any of the standard locations in your webspace. Please contact your hosting provider to check whether you can create your own PHP ini file and where it should go.</strong>"; } } else { if (own_php_ini_possible(true)) { $warnings[] = "You may not be able to create your own ini files on your shared server. <br><strong>You might need to ask your server administrator to install the ionCube Loader for you.</strong>"; } } } else { $loader_dir_pair = correct_loader_wrong_location(); if (!empty($loader_dir_pair)) { $advice = "The correct loader for your system has been found at <code>{$loader_dir_pair['loader']}</code>."; if ($loader_dir_pair['loader'] != $loader_dir_pair['newloc']) { $advice .= " You may wish to copy the loader from <code>{$loader_dir_pair['loader']}</code> to <code>{$loader_dir_pair['newloc']}</code>."; } $warnings[] = $advice; } } return $warnings; }
function ini_loader_warnings() { $warnings = array(); if (find_server_type() == SERVER_SHARED) { if (own_php_ini_possible()) { $sys = get_sysinfo(); $ini_name = ini_file_name(); $rootpath = realpath($_SERVER['DOCUMENT_ROOT']); $root_ini_file = $rootpath . DIRECTORY_SEPARATOR . $ini_name; $cgibinpath = @realpath($_SERVER['DOCUMENT_ROOT'] . "/cgi-bin"); $cgibin_ini_file = empty($cgibinpath) ? '' : $cgibinpath . DIRECTORY_SEPARATOR . $ini_name; $here = unix_path_dir(); $ini_files = unrecognised_inis_webspace($here); $shared_ini_loc = shared_ini_location(); $shared_ini_file = $shared_ini_loc . DIRECTORY_SEPARATOR . $ini_name; $ini_dir = dirname($sys['PHP_INI']); $all_ini_locations_used = !empty($ini_files); foreach ($ini_files as $full_ini_loc) { $advice = "文件 {$full_ini_loc} 没有被PHP认可。"; $advice .= " 请检查文件名、路径是正确的。"; if (!ini_same_dir_as_wizard()) { $ini_loc_dir = dirname($full_ini_loc); if (!@file_exists($shared_ini_file) && !empty($shared_ini_loc) && $ini_loc_dir != $shared_ini_loc && $ini_dir != $shared_ini_loc) { $all_ini_locations_used = false; $advice .= " 请将<code>{$full_ini_loc}</code> 复制到<code>" . $shared_ini_loc . "</code>。"; } else { if (!@file_exists($root_ini_file) && $rootpath != $shared_ini_loc && $full_ini_loc != $rootpath) { $all_ini_locations_used = false; $advice .= " 请将文件 <code>{$full_ini_loc}</code> 复制到 <code>" . $rootpath . "</code>."; } if (!empty($cgibin_ini_file) && !@file_exists($cgibin_ini_file) && $cgibinpath != $shared_ini_loc && $full_ini_loc != $cgibinpath && $cgibinpath != $rootpath) { $all_ini_locations_used = false; $advice .= " 请将文件 <code>{$full_ini_loc}</code> 复制到 <code>" . $cgibinpath . "</code>。"; } $herepath = realpath($here); $here_ini_file = $herepath . DIRECTORY_SEPARATOR . $ini_name; if (!@file_exists($here_ini_file) && $herepath != $rootpath && $herepath != $cgibinpath) { $all_ini_locations_used = false; $advice .= " 需要将文件 <code>{$full_ini_loc}</code> 复制到 <code>{$herepath}</code> 和所有加密文件所在的路径。"; } } } else { $all_ini_locations_used = false; } $warnings[] = $advice; } if ($all_ini_locations_used) { $warnings[] = "<strong>好像ini配置文件不在默认的位置,请联系服务器提供商,询问是否能够创建自己的PHP ini文件和创建位置。</strong>"; } } else { if (own_php_ini_possible(true)) { $warnings[] = "你可能没有权限在共享服务器上创建自己的ini文件。 <br><strong>请联系管理员安装ionCube loader。</strong>"; } } } else { $loader_dir_pair = correct_loader_wrong_location(); if (!empty($loader_dir_pair)) { $advice = "在<code>{$loader_dir_pair['loader']}</code>已经找到可用的loader。"; if ($loader_dir_pair['loader'] != $loader_dir_pair['newloc']) { $advice .= " 你可能想将loader文件 <code>{$loader_dir_pair['loader']}</code> 复制到 <code>{$loader_dir_pair['newloc']}</code>。"; } $warnings[] = $advice; } } return $warnings; }