Jump to content
  • 0

[FluxCP] Warning: set_time_limit() has been disabled for security reasons


darking123

Question


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  931
  • Reputation:   13
  • Joined:  12/20/11
  • Last Seen:  

this is my error

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit in safe mode in /home/midgardr/public_html/cp/index.php on line 74

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/midgardr/public_html/cp/index.php:74) in /home/midgardr/public_html/cp/index.php on line 139

Warning: Cannot modify header information - headers already sent by (output started at /home/midgardr/public_html/cp/index.php:74) in /home/midgardr/public_html/cp/lib/Flux/Template.php on line 781

i am using windows vps

Edited by glemor123
Link to comment
Share on other sites

Recommended Posts

  • -1

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  707
  • Reputation:   168
  • Joined:  01/26/12
  • Last Seen:  

Hi glemor123,

Turn off PHP safe mode.

Google: http://lmgtfy.com/?q=windows+turn+off+php+safe+mode

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  633
  • Reputation:   78
  • Joined:  11/14/11
  • Last Seen:  

what webserver are you using like wamp, xamp or lamp?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  931
  • Reputation:   13
  • Joined:  12/20/11
  • Last Seen:  

i use cpanel sir jaypee from good vps

cause the cp is originaly placed in a linux vps from bluesky..then we changed host to goodvps windows server

then i just copy and paste the cp folder to our new cpanel from windows...i already edited all but still it has error

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  633
  • Reputation:   78
  • Joined:  11/14/11
  • Last Seen:  

Do you have the permission to make change in your php.ini settings?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  707
  • Reputation:   168
  • Joined:  01/26/12
  • Last Seen:  

Hi glemor123,

These errors are caused by a poorly configured php.ini.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  931
  • Reputation:   13
  • Joined:  12/20/11
  • Last Seen:  

how to fix then to make my flux cp work again?and what php.ini is al about

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  633
  • Reputation:   78
  • Joined:  11/14/11
  • Last Seen:  

php.ini is like configuration file. But i think in shared webhosting they do not allow you to edit the php.ini instead you use init_set() function like this:

init_set("safe_mode","0"); 

I think you put this code inside index.php at the top or beginning. Please make sure that your not using PHP 5.4 because I read in php.net that safe_mode is removed in PHP 5.4

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  931
  • Reputation:   13
  • Joined:  12/20/11
  • Last Seen:  

i already put what you said

still this error

init_set("safe_mode","0");

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit in safe mode in /home/midgardr/public_html/cp/index.php on line 75

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/midgardr/public_html/cp/index.php:2) in /home/midgardr/public_html/cp/index.php on line 140

Warning: Cannot modify header information - headers already sent by (output started at /home/midgardr/public_html/cp/index.php:2) in /home/midgardr/public_html/cp/lib/Flux/Template.php on line 781

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  633
  • Reputation:   78
  • Joined:  11/14/11
  • Last Seen:  

I guess you need to contact your Hosting Provider

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  707
  • Reputation:   168
  • Joined:  01/26/12
  • Last Seen:  

Hi glemor123,

Did you restart your PHP service after you made that modification? You need to restart.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  633
  • Reputation:   78
  • Joined:  11/14/11
  • Last Seen:  

as far as I know you dont need to restart the server when you use init_set();

and also clear your fluxCP cache here at data/tmp/

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  707
  • Reputation:   168
  • Joined:  01/26/12
  • Last Seen:  

as far as I know you dont need to restart the server when you use init_set();

and also clear your fluxCP cache here at data/tmp/

Not the server itself, the PHP process. If he just edited the config, the PHP will still be on safe mode until he restarts the PHP service.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  931
  • Reputation:   13
  • Joined:  12/20/11
  • Last Seen:  

hoW TO RESTART MY PHP. . Im am using windows vps

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  707
  • Reputation:   168
  • Joined:  01/26/12
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  931
  • Reputation:   13
  • Joined:  12/20/11
  • Last Seen:  

gonna try it...any more suggestions??

as far as I know you dont need to restart the server when you use init_set();

and also clear your fluxCP cache here at data/tmp/

didnt work

still there is the error

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  931
  • Reputation:   13
  • Joined:  12/20/11
  • Last Seen:  

can you edit it for me

here is my index.php

init_set("safe_mode","0");
<?php
if (version_compare(PHP_VERSION, '5.2.1', '<')) {
echo '<h2>Error</h2>';
echo '<p>PHP 5.2.1 or higher is required to use Flux Control Panel.</p>';
echo '<p>You are running '.PHP_VERSION.'</p>';
exit;
}
// Disable Zend Engine 1 compatibility mode.
// See: http://www.php.net/manual/en/ini.core.php#ini.zend.ze1-compatibility-mode
ini_set('zend.ze1_compatibility_mode', 0);
// Time started.
define('__START__', microtime(true));
error_reporting(E_ALL);
ini_set('display_errors', 1);
define('FLUX_ROOT',	   str_replace('', '/', dirname(__FILE__)));
define('FLUX_DATA_DIR',   'data');
define('FLUX_CONFIG_DIR', 'config');
define('FLUX_LIB_DIR',	'lib');
define('FLUX_MODULE_DIR', 'modules');
define('FLUX_THEME_DIR',  'themes');
define('FLUX_ADDON_DIR',  'addons');
define('FLUX_LANG_DIR',   'lang');
// Clean GPC arrays in the event magic_quotes_gpc is enabled.
if (ini_get('magic_quotes_gpc')) {
$gpc = array(&$_GET, &$_POST, &$_REQUEST, &$_COOKIE);
foreach ($gpc as &$arr) {
 foreach ($arr as $key => $value) {
  if (is_string($value)) {
$arr[$key] = stripslashes($value);
  }
 }
}
}
set_include_path(FLUX_LIB_DIR.PATH_SEPARATOR.get_include_path());
//ini_set('session.save_path', 'data/sessions');
// Default account levels.
require_once FLUX_CONFIG_DIR.'/levels.php';
// Some necessary Flux core libraries.
require_once 'Flux.php';
require_once 'Flux/Dispatcher.php';
require_once 'Flux/SessionData.php';
require_once 'Flux/DataObject.php';
require_once 'Flux/Authorization.php';
require_once 'Flux/Installer.php';
require_once 'Flux/PermissionError.php';
// Vendor libraries.
require_once 'markdown/markdown.php';
try {
if (!extension_loaded('pdo')) {
 throw new Flux_Error('The PDO extension is required to use Flux, please make sure it is installed along with the PDO_MYSQL driver.');
}
elseif (!extension_loaded('pdo_mysql')) {
 throw new Flux_Error('The PDO_MYSQL driver for the PDO extension must be installed to use Flux.  Please consult the PHP manual for installation instructions.');
}

// Initialize Flux.
Flux::initialize(array(
 'appConfigFile'	  => FLUX_CONFIG_DIR.'/application.php',
 'serversConfigFile'  => FLUX_CONFIG_DIR.'/servers.php',
 //'messagesConfigFile' => FLUX_CONFIG_DIR.'/messages.php' // No longer needed (Deprecated)
));

// Set time limit.
set_time_limit((int)Flux::config('ScriptTimeLimit'));

// Set default timezone for entire app.
$timezone = Flux::config('DateDefaultTimezone');
if ($timezone && !@date_default_timezone_set($timezone)) {
 throw new Flux_Error("'$timezone' is not a valid timezone.  Consult http://php.net/timezones for a list of valid timezones.");
}

// Create some basic directories.
$directories = array(
 FLUX_DATA_DIR.'/logs/schemas',
 FLUX_DATA_DIR.'/logs/schemas/logindb',
 FLUX_DATA_DIR.'/logs/schemas/charmapdb',
 FLUX_DATA_DIR.'/logs/transactions',
 FLUX_DATA_DIR.'/logs/mail',
 FLUX_DATA_DIR.'/logs/mysql',
 FLUX_DATA_DIR.'/logs/mysql/errors',
 FLUX_DATA_DIR.'/logs/errors',
 FLUX_DATA_DIR.'/logs/errors/exceptions',
 FLUX_DATA_DIR.'/logs/errors/mail',
);
// Schema log directories.
foreach (Flux::$loginAthenaGroupRegistry as $serverName => $loginAthenaGroup) {
 $directories[] = FLUX_DATA_DIR."/logs/schemas/logindb/$serverName";
 $directories[] = FLUX_DATA_DIR."/logs/schemas/charmapdb/$serverName";

 foreach ($loginAthenaGroup->athenaServers as $athenaServer) {
  $directories[] = FLUX_DATA_DIR."/logs/schemas/charmapdb/$serverName/{$athenaServer->serverName}";
 }
}
foreach ($directories as $directory) {
 if (is_writable(dirname($directory)) && !is_dir($directory)) {
  mkdir($directory, 0777);
 }
}

// Installer library.
$installer = Flux_Installer::getInstance();
if ($hasUpdates=$installer->updateNeeded()) {
 Flux::config('ThemeName', 'installer');
}

$sessionKey = Flux::config('SessionKey');
session_save_path($dir=realpath(FLUX_DATA_DIR.'/sessions'));
if (!is_writable($dir)) {
 throw new Flux_PermissionError("The session storage directory '$dir' is not writable.  Remedy with `chmod 0707 $dir`");
}
elseif (!is_writable($dir=realpath(FLUX_DATA_DIR.'/logs'))) {
 throw new Flux_PermissionError("The log storage directory '$dir' is not writable.  Remedy with `chmod 0707 $dir`");
}
elseif (!is_writable($dir=realpath(FLUX_DATA_DIR.'/itemshop'))) {
 throw new Flux_PermissionError("The item shop image directory '$dir' is not writable.  Remedy with `chmod 0707 $dir`");
}
elseif (!is_writable($dir=realpath(FLUX_DATA_DIR.'/tmp'))) {
 throw new Flux_PermissionError("The temporary directory '$dir' is not writable.  Remedy with `chmod 0707 $dir`");
}
elseif (ini_get('session.use_trans_sid')) {
 throw new Flux_Error("The 'session.use_trans_sid' php.ini configuration must be turned off for Flux to work.");
}
else {
 $sessionExpireDuration = Flux::config('SessionCookieExpire') * 60 * 60;
 session_set_cookie_params($sessionExpireDuration, Flux::config('BaseURI'));
 ini_set('session.name', $sessionKey);
 session_start();
}

if (empty($_SESSION[$sessionKey]) || !is_array($_SESSION[$sessionKey])) {
 $_SESSION[$sessionKey] = array();
}

// Initialize session data.
Flux::$sessionData = new Flux_SessionData($_SESSION[$sessionKey], $hasUpdates);

// Initialize authorization component.
$accessConfig = Flux::parseConfigFile(FLUX_CONFIG_DIR.'/access.php');

// Merge with add-on configs.
foreach (Flux::$addons as $addon) {
 $accessConfig->merge($addon->accessConfig);
}

$accessConfig->set('unauthorized.index', AccountLevel::ANYONE);
$authComponent = Flux_Authorization::getInstance($accessConfig, Flux::$sessionData);

if (!Flux::config('DebugMode')) {
 ini_set('display_errors', 0);
}
// Dispatch requests->modules->actions->views.
$dispatcher = Flux_Dispatcher::getInstance();
$dispatcher->setDefaultModule(Flux::config('DefaultModule'));
$dispatcher->dispatch(array(
 'basePath'				  => Flux::config('BaseURI'),
 'useCleanUrls'			  => Flux::config('UseCleanUrls'),
 'modulePath'				=> FLUX_MODULE_DIR,
 'themePath'				 => FLUX_THEME_DIR.'/'.Flux::config('ThemeName'),
 'missingActionModuleAction' => Flux::config('DebugMode') ? array('errors', 'missing_action') : array('main', 'page_not_found'),
 'missingViewModuleAction'   => Flux::config('DebugMode') ? array('errors', 'missing_view')   : array('main', 'page_not_found')
));
}
catch (Exception $e) {
$exceptionDir = FLUX_DATA_DIR.'/logs/errors/exceptions';
if (is_writable($exceptionDir)) {
 require_once 'Flux/LogFile.php';
 $today = date('Ymd');
 $eLog  = new Flux_LogFile("$exceptionDir/$today.log");

 // Log exception.
 $eLog->puts('(%s) Exception %s: %s', get_class($e), get_class($e), $e->getMessage());
 foreach (explode("n", $e->getTraceAsString()) as $traceLine) {
  $eLog->puts('(%s) **TRACE** %s', get_class($e), $traceLine);
 }
}

require_once FLUX_CONFIG_DIR.'/error.php';
define('__ERROR__', 1);
include $errorFile;
}
?>

here is my

template.php

<?php
require_once 'Flux/Paginator.php';
/**
* The template is mostly responsible for the presentation logic of things, but
* currently it also carries the task of executing the action files, which are
* responsible for the business logic of the application. Maybe this will
* change in the future, but I'm not sure yet. As long as the developers are
* forced to adhere to the separation of business logic and presentation logic
* then I don't think I'll be motivated enough to change this part.
*
* Views are rendered within the scope of the template instance, thus $this can
* be used to access the template instance's methods, and is also how helpers
* are currently implemented.
*/
class Flux_Template {
/**
 * Default data which gets exposed as globals to the templates, and may be
 * set with the setDefaultData() method.
 *
 * @access private
 * @var array
 */
private $defaultData = array();

/**
 * Request parameters.
 *
 * @access protected
 * @var Flux_Config
 */
protected $params;

/**
 * Base URI of the entire application.
 *
 * @access protected
 * @var string
 */
protected $basePath;

/**
 * Module path.
 *
 * @access protected
 * @var string
 */
protected $modulePath;

/**
 * Module name.
 *
 * @access protected
 * @var string
 */
protected $moduleName;

/**
 * Theme path. This is the path to the selected theme itself, not the real
 * theme path which contains several themes.
 *
 * @access protected
 * @var string
 */
protected $themePath;

/**
 * Action name. Actions exist as modulePath/moduleName/actionName.php.
 *
 * @access protected
 * @var string
 */
protected $actionName;

/**
 * Action path, would be the path format documented in $actionName.
 *
 * @access protected
 * @var string
 */
protected $actionPath;

/**
 * View name, this is usually the same as the actionName.
 *
 * @access protected
 * @var string
 */
protected $viewName;

/**
 * View path, follows a similar (or rather, exact) format like actionPath,
 * except there would be a themePath and viewName instead.
 *
 * @access protected
 * @var string
 */
protected $viewPath;

/**
 * Header name. The header file would exist under the themePath's top level
 * and the headerName would simply be the file's basename without the .php
 * extension. This name is usually 'header'.
 *
 * @access protected
 * @var string
 */
protected $headerName;

/**
 * The actual path to the header file.
 *
 * @access protected
 * @var string
 */
protected $headerPath;

/**
 * The footer name.
 * Similar to headerName. This name is usually 'footer'.
 *
 * @access protected
 * @var string
 */
protected $footerName;

/**
 * The actual path to the footer file.
 *
 * @access protected
 * @var string
 */
protected $footerPath;

/**
 * Whether or not to use mod_rewrite-powered clean URLs or just plain old
 * query strings.
 *
 * @access protected
 * @var string
 */
protected $useCleanUrls;

/**
 * URL of the current module/action being viewed.
 *
 * @access protected
 * @var string
 */
protected $url;

/**
 * URL of the current module/action being viewed. (including query string)
 *
 * @access protected
 * @var string
 */
protected $urlWithQs;
protected $urlWithQS; // compatibility.

/**
 * Module/action for missing action's event.
 *
 * @access protected
 * @var array
 */
protected $missingActionModuleAction;

/**
 * Module/action for missing view's event.
 *
 * @access protected
 * @var array
 */
protected $missingViewModuleAction;

/**
 * HTTP referer.
 *
 * @access public
 * @var string
 */
public $referer;

/**
 * Construct new template onbject.
 *
 * @param Flux_Config $config
 * @access public
 */
public function __construct(Flux_Config $config)
{
 $this->params					= $config->get('params');
 $this->basePath				  = $config->get('basePath');
 $this->modulePath				= $config->get('modulePath');
 $this->moduleName				= $config->get('moduleName');
 $this->themePath				 = $config->get('themePath');
 $this->actionName				= $config->get('actionName');
 $this->viewName				  = $config->get('viewName');
 $this->headerName				= $config->get('headerName');
 $this->footerName				= $config->get('footerName');
 $this->useCleanUrls			  = $config->get('useCleanUrls');
 $this->missingActionModuleAction = $config->get('missingActionModuleAction', false);
 $this->missingViewModuleAction   = $config->get('missingViewModuleAction', false);
 $this->referer				   = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
}

/**
 * Any data that gets set here will be available to all templates as global
 * variables unless they are overridden by variables of the same name set
 * in the render() method.
 *
 * @return array
 * @access public
 */
public function setDefaultData(array &$data)
{
 $this->defaultData = $data;
 return $data;
}

/**
 * Render a template, but before doing so, call the action file and render
 * the header->view->footer in that order.
 *
 * @param array $dataArr Key=>value pairs of variables to be exposed to the template as globals.
 * @access public
 */
public function render(array $dataArr = array())
{
 // GZip compression.
 if (Flux::config('GzipCompressOutput')) {
  header('Accept-Encoding: gzip');
  ini_set('zlib.output_handler', '');
  ini_set('zlib.output_compression', 'On');
  ini_set('zlib.output_compression_level', (int)Flux::config('GzipCompressionLevel'));
 }

 $addon = false;
 $this->actionPath = sprintf('%s/%s/%s.php', $this->modulePath, $this->moduleName, $this->actionName);

 if (!file_exists($this->actionPath)) {
  foreach (Flux::$addons as $_tmpAddon) {
if ($_tmpAddon->respondsTo($this->moduleName, $this->actionName)) {
 $addon = $_tmpAddon;
 $this->actionPath = sprintf('%s/%s/%s.php', $addon->moduleDir, $this->moduleName, $this->actionName);
}
  }

  if (!$addon) {
$this->moduleName = $this->missingActionModuleAction[0];
$this->actionName = $this->missingActionModuleAction[1];
$this->viewName   = $this->missingActionModuleAction[1];
$this->actionPath = sprintf('%s/%s/%s.php', $this->modulePath, $this->moduleName, $this->actionName);
  }
 }

 $viewExists = false;
 $this->viewPath = sprintf('%s/%s/%s.php', $this->themePath, $this->moduleName, $this->actionName);

 if (!file_exists($this->viewPath)) {
  if ($addon) {
$this->viewPath = sprintf('%s/%s/%s.php', $addon->themeDir, $this->moduleName, $this->actionName);
$viewExists = $addon->hasView($this->moduleName, $this->actionName);
  }

  if (!$viewExists) {
$this->moduleName = $this->missingViewModuleAction[0];
$this->actionName = $this->missingViewModuleAction[1];
$this->viewName   = $this->missingViewModuleAction[1];
$this->actionPath = sprintf('%s/%s/%s.php', $this->modulePath, $this->moduleName, $this->actionName);
$this->viewPath   = sprintf('%s/%s/%s.php', $this->themePath, $this->moduleName, $this->viewName);
  }
 }

 $this->headerPath = sprintf('%s/%s.php', $this->themePath, $this->headerName);
 $this->footerPath = sprintf('%s/%s.php', $this->themePath, $this->footerName);
 $this->url		= $this->url($this->moduleName, $this->actionName);
 $this->urlWithQS  = $this->url;

 if (!empty($_SERVER['QUERY_STRING'])) {
  if ($this->useCleanUrls) {
$this->urlWithQS .= "?{$_SERVER['QUERY_STRING']}";
  }
  else {
foreach (explode('&', trim($_SERVER['QUERY_STRING'], '&')) as $line) {
 list ($key,$val) = explode('=', $line, 2);
 $key = urldecode($key);
 $val = urldecode($val);

 if ($key != 'module' && $key != 'action') {
  $this->urlWithQS .= sprintf('&%s=%s', urlencode($key), urlencode($val));
 }
}
  }
 }

 // Compatibility.
 $this->urlWithQs  = $this->urlWithQS;

 // Tidy up!
 if (Flux::config('OutputCleanHTML')) {
  $dispatcher = Flux_Dispatcher::getInstance();
  $tidyIgnore = false;
  if (($tidyIgnores = Flux::config('TidyIgnore')) instanceOf Flux_Config) {
foreach ($tidyIgnores->getChildrenConfigs() as $ignore) {
 $ignore = $ignore->toArray();
 if (is_array($ignore) && array_key_exists('module', $ignore)) {
  $module = $ignore['module'];
  $action = array_key_exists('action', $ignore) ? $ignore['action'] : $dispatcher->defaultAction;
  if ($this->moduleName == $module && $this->actionName == $action) {
   $tidyIgnore = true;
  }
 }
}
  }
  if (!$tidyIgnore) {
ob_start();
  }
 }

 // Merge with default data.
 $data = array_merge($this->defaultData, $dataArr);

 // Extract data array and make them appear as though they were global
 // variables from the template.
 extract($data, EXTR_REFS);

 // Files object.
 $files = new Flux_Config($_FILES);

 $preprocessorPath = sprintf('%s/main/preprocess.php', $this->modulePath);
 if (file_exists($preprocessorPath)) {
  include $preprocessorPath;
 }

 include $this->actionPath;

 $pageMenuFile   = FLUX_ROOT."/modules/{$this->moduleName}/pagemenu/{$this->actionName}.php";
 $pageMenuItems  = array();

 // Get the main menu file first (located in the actual module).
 if (file_exists($pageMenuFile)) {
  ob_start();
  $pageMenuItems = include $pageMenuFile;
  ob_end_clean();
 }

 $addonPageMenuFiles = glob(FLUX_ADDON_DIR."/*/modules/{$this->moduleName}/pagemenu/{$this->actionName}.php");
 if ($addonPageMenuFiles) {
  foreach ($addonPageMenuFiles as $addonPageMenuFile) {
ob_start();
$pageMenuItems = array_merge($pageMenuItems, include $addonPageMenuFile);
ob_end_clean();
  }
 }

 if (file_exists($this->headerPath)) {
  include $this->headerPath;
 }

 include $this->viewPath;

 if (file_exists($this->footerPath)) {
  include $this->footerPath;
 }

 // Really, tidy up!
 if (Flux::config('OutputCleanHTML') && !$tidyIgnore && function_exists('tidy_repair_string')) {
  $content = ob_get_clean();
  $content = tidy_repair_string($content, array('indent' => true, 'wrap' => false, 'output-xhtml' => true), 'utf8');
  echo $content;
 }
}

/**
 * Returns an array of menu items that should be diplayed from the theme.
 * Only menu items the current user (and their level) have access to will
 * be returned as part of the array;
 *
 * @return array
 */
public function getMenuItems($adminMenus = false)
{
 $auth		   = Flux_Authorization::getInstance();
 $accountLevel   = Flux::$sessionData->account->level;
 $adminMenuLevel = Flux::config('AdminMenuLevel');
 $defaultAction  = Flux_Dispatcher::getInstance()->defaultAction;
 $menuItems	  = Flux::config('MenuItems');
 $allowedItems   = array();

 if (!($menuItems instanceOf Flux_Config)) {
  return array();
 }

 foreach ($menuItems->toArray() as $categoryName => $menu) {
  foreach ($menu as $menuName => $menuItem) {
$module = array_key_exists('module', $menuItem) ? $menuItem['module'] : false;
$action = array_key_exists('action', $menuItem) ? $menuItem['action'] : $defaultAction;
$exturl = array_key_exists('exturl', $menuItem) ? $menuItem['exturl'] : null;
if ($adminMenus) {
 if ($auth->actionAllowed($module, $action) && $auth->config("modules.$module.$action") >= $adminMenuLevel) {
  $allowedItems[] = array(
   'name'   => $menuName,
   'exturl' => null,
   'module' => $module,
   'action' => $action,
   'url'	=> $this->url($module, $action)
  );
 }
}
else {
 if (empty($allowedItems[$categoryName])) {
  $allowedItems[$categoryName] = array();
 }

 if ($exturl) {
  $allowedItems[$categoryName][] = array(
   'name'   => $menuName,
   'exturl' => $exturl,
   'module' => null,
   'action' => null,
   'url'	=> $exturl
  );
 }
 elseif ($auth->actionAllowed($module, $action) && $auth->config("modules.$module.$action") < $adminMenuLevel) {
  $allowedItems[$categoryName][] = array(
   'name'   => $menuName,
   'exturl' => null,
   'module' => $module,
   'action' => $action,
   'url'	=> $this->url($module, $action)
  );
 }
}
  }
 }

 return $allowedItems;
}

/**
 * @see Flux_Template::getMenuItems()
 */
public function getAdminMenuItems()
{
 return $this->getMenuItems(true);
}

/**
 * Get sub-menu items for a particular module.
 *
 * @param string $moduleName
 * @return array
 */
public function getSubMenuItems($moduleName = null)
{
 $auth		 = Flux_Authorization::getInstance();
 $moduleName   = $moduleName ? $moduleName : $this->moduleName;
 $subMenuItems = Flux::config('SubMenuItems');
 $allowedItems = array();

 if (!($subMenuItems instanceOf Flux_Config) || !( ($menus = $subMenuItems->get($moduleName)) instanceOf Flux_Config )) {
  return array();
 }

 foreach ($menus->toArray() as $actionName => $menuName) {
  if ($auth->actionAllowed($moduleName, $actionName)) {
$allowedItems[] = array('name' => $menuName, 'module' => $moduleName, 'action' => $actionName);
  }
 }

 return $allowedItems;
}

/**
 * Get an array of login server names.
 *
 * @return array
 */
public function getServerNames()
{
 return array_keys(Flux::$loginAthenaGroupRegistry);
}

/**
 * Determine if more than 1 server exists.
 *
 * @return bool
 */
public function hasManyServers()
{
 return count(Flux::$loginAthenaGroupRegistry) > 1;
}

/**
 * Obtain the absolute web path of the specified user path. Specify the
 * path as a relative path.
 *
 * @param string $path Relative path from basePath.
 * @access public
 */
public function path($path)
{
 if (is_array($path)) {
  $path = implode('/', $path);
 }
 return preg_replace('&/{2,}&', '/', "{$this->basePath}/$path");
}

/**
 * Similar to the path() method, but uses the $themePath as the path from
 * which the user-specified path is relative.
 *
 * @param string $path Relative path from themePath.
 * @access public
 */
public function themePath($path)
{
 if (is_array($path)) {
  $path = implode('/', $path);
 }
 return $this->path("{$this->themePath}/$path");
}

/**
 * Create a URI based on the setting of $useCleanUrls. This will determine
 * whether or not we will create a mod_rewrite-based clean URL or just a
 * regular query string based one.
 *
 * @param string $moduleName
 * @param string $actionName
 * @access public
 */
public function url($moduleName, $actionName = null, $params = array())
{
 $defaultAction  = Flux_Dispatcher::getInstance()->defaultAction;
 $serverProtocol = '';
 $serverAddress  = '';

 if ($params instanceOf Flux_Config) {
  $params = $params->toArray();
 }

 if (array_key_exists('_host', $params)) {
  $_host  = $params['_host'];
  $_https = false;

  if ($_host && ($addr=Flux::config('ServerAddress'))) {
if (array_key_exists('_https', $params)) {
 $_https = $params['_https'];
}
elseif (!empty($_SERVER['HTTPS'])) {
 $_https = true;
}
else {
 $_https = false;
}
$serverProtocol = $_https ? 'https://' : 'http://';
$serverAddress  = $addr;
  }

  unset($params['_host']);

  if (array_key_exists('_https', $params)) {
unset($params['_https']);
  }
 }

 $queryString = '';

 if (count($params)) {
  $queryString .= Flux::config('UseCleanUrls') ? '?' : '&';
  foreach ($params as $param => $value) {
$queryString .= sprintf('%s=%s&', $param, urlencode($value));
  }
  $queryString = rtrim($queryString, '&');
 }

 if ($this->useCleanUrls) {
  if ($actionName && $actionName != $defaultAction) {
$url = sprintf('%s/%s/%s/%s', $this->basePath, $moduleName, $actionName, $queryString);
  }
  else {
$url = sprintf('%s/%s/%s', $this->basePath, $moduleName, $queryString);
  }
 }
 else {
  if ($actionName && $actionName != $defaultAction) {
$url = sprintf('%s/?module=%s&action=%s%s', $this->basePath, $moduleName, $actionName, $queryString);
  }
  else {
$url = sprintf('%s/?module=%s%s', $this->basePath, $moduleName, $queryString);
  }
 }
 return $serverProtocol.preg_replace('&/{2,}&', '/', "$serverAddress/$url");
}

/**
 * Format money strings (note: name soon to be changed).
 *
 * @param float $number Amount
 * @return string Formatted amount
 */
public function formatDollar($number)
{
 $number = (float)$number;
 $amount = number_format(
  $number,
  Flux::config('MoneyDecimalPlaces'),
  Flux::config('MoneyDecimalSymbol'),
  Flux::config('MoneyThousandsSymbol')
 );
 return $amount;
}

/**
 * Format a MySQL DATE column according to the DateFormat config.
 *
 * @param string $data
 * @return string
 * @access public
 */
public function formatDate($date = null)
{
 $ts = $date ? strtotime($date) : time();
 return date(Flux::config('DateFormat'), $ts);
}

/**
 * Format a MySQL DATETIME column according to the DateTimeFormat config.
 *
 * @param string $dataTime
 * @return string
 * @access public
 */
public function formatDateTime($dateTime = null)
{
 $ts = $dateTime ? strtotime($dateTime) : time();
 return date(Flux::config('DateTimeFormat'), $ts);
}

/**
 * Create a series of select fields matching a MySQL DATE format.
 *
 * @param string $name
 * @param string $value DATE formatted string.
 * @return string
 */
public function dateField($name, $value = null)
{
 $ts	= $value && !preg_match('/^0000-00-00(?: 00:00:00)?$/', $value) ? strtotime($value) : time();
 $year  = ($year =$this->params->get("{$name}_year"))  ? $year  : date('Y', $ts);
 $month = ($month=$this->params->get("{$name}_month")) ? $month : date('m', $ts);
 $day   = ($day  =$this->params->get("{$name}_day"))   ? $day   : date('d', $ts);
 $fw	= $year + (int)Flux::config('ForwardYears');
 $bw	= $year - (int)Flux::config('BackwardYears');

 // Get years.
 $years = sprintf('<select name="%s_year">', $name);
 for ($i = $fw; $i >= $bw; --$i) {
  if ($year == $i) {
$years .= sprintf('<option value="%04d" selected="selected">%04d</option>', $i, $i);
  }
  else {
$years .= sprintf('<option value="%04d">%04d</option>', $i, $i);
  }
 }
 $years .= '</select>';

 // Get months.
 $months = sprintf('<select name="%s_month">', $name);
 for ($i = 1; $i <= 12; ++$i) {
  if ($month == $i) {
$months .= sprintf('<option value="%02d" selected="selected">%02d</option>', $i, $i);
  }
  else {
$months .= sprintf('<option value="%02d">%02d</option>', $i, $i);
  }
 }
 $months .= '</select>';

 // Get days.
 $days = sprintf('<select name="%s_day">', $name);
 for ($i = 1; $i <= 31; ++$i) {
  if ($day == $i) {
$days .= sprintf('<option value="%02d" selected="selected">%02d</option>', $i, $i);
  }
  else {
$days .= sprintf('<option value="%02d">%02d</option>', $i, $i);
  }
 }
 $days .= '</select>';

 return sprintf('<span class="date-field">%s-%s-%s</span>', $years, $months, $days);
}

/**
 * Create a series of select fields matching a MySQL DATETIME format.
 *
 * @param string $name
 * @param string $value DATETIME formatted string.
 * @return string
 */
public function dateTimeField($name, $value = null)
{
 $dateField = $this->dateField($name, $value);
 $ts		= $value ? strtotime($value) : strtotime('00:00:00');
 //$ts		= strtotime('00:00:00');
 $hour	  = date('H', $ts);
 $minute	= date('i', $ts);
 $second	= date('s', $ts);

 // Get hours.
 $hours = sprintf('<select name="%s_hour">', $name);
 for ($i = 0; $i <= 23; ++$i) {
  if ($hour == $i) {
$hours .= sprintf('<option value="%02d" selected="selected">%02d</option>', $i, $i);
  }
  else {
$hours .= sprintf('<option value="%02d">%02d</option>', $i, $i);
  }
 }
 $hours .= '</select>';

 // Get minutes.
 $minutes = sprintf('<select name="%s_minute">', $name);
 for ($i = 0; $i <= 59; ++$i) {
  if ($minute == $i) {
$minutes .= sprintf('<option value="%02d" selected="selected">%02d</option>', $i, $i);
  }
  else {
$minutes .= sprintf('<option value="%02d">%02d</option>', $i, $i);
  }
 }
 $minutes .= '</select>';

 // Get seconds.
 $seconds = sprintf('<select name="%s_second">', $name);
 for ($i = 0; $i <= 59; ++$i) {
  if ($second == $i) {
$seconds .= sprintf('<option value="%02d" selected="selected">%02d</option>', $i, $i);
  }
  else {
$seconds .= sprintf('<option value="%02d">%02d</option>', $i, $i);
  }
 }
 $seconds .= '</select>';

 return sprintf('<span class="date-time-field">%s @ %s:%s:%s</span>', $dateField, $hours, $minutes, $seconds);
}

/**
 * Returns "up" or "down" in a span HTML element with either the class
 * .up or .down, based on the value of $bool. True returns up, false
 * returns down.
 *
 * @param bool $bool True/false value
 * @return string Up/down
 */
public function serverUpDown($bool)
{
 $class = $bool ? 'up' : 'down';
 return sprintf('<span class="%s">%s</span>', $class, $bool ? 'Online' : 'Offline');
}

/**
 * Redirect client to another location. Script execution is terminated
 * after instructing the client to redirect.
 *
 * @param string $location
 */
public function redirect($location = null)
{
 if (is_null($location)) {
  $location = $this->basePath;
 }

 header("Location: $location");
 exit;
}

/**
 * Guess the HTTP server's current full URL.
 *
 * @param bool $withRequest True to include REQUEST_URI, false if not.
 * @return string URL
 */
public function entireUrl($withRequest = true)
{
 $proto	= empty($_SERVER['HTTPS']) ? 'http://' : 'https://';
 $hostname = $_SERVER['HTTP_HOST'];
 $request  = $_SERVER['REQUEST_URI'];

 if ($withRequest) {
  $url = $proto.$hostname.$request;
 }
 else {
  $url = $proto.$hostname.'/'.$this->basePath;
 }

 $url = rtrim(preg_replace('&/{2,}&', '/', $url), '/');
 return $url;
}

/**
 * Convenience method for retrieving a paginator instance.
 *
 * @param int $total Total number of records.
 * @param array $options Paginator options.
 * @return Flux_Paginator
 * @access public
 */
public function getPaginator($total, array $options = array())
{
 $paginator = new Flux_Paginator($total, $this->url($this->moduleName, $this->actionName, array('_host' => false)), $options);
 return $paginator;
}

/**
 * Link to an account view page.
 *
 * @param int $accountID
 * @param string $text
 * @return mixed
 * @access public
 */
public function linkToAccount($accountID, $text)
{
 if ($accountID) {
  $url = $this->url('account', 'view', array('id' => $accountID));
  return sprintf('<a href="%s" class="link-to-account">%s</a>', $url, htmlentities($text));
 }
 else {
  return false;
 }
}

/**
 * Link to a character view page.
 *
 * @param int $charID
 * @param string $text
 * @return mixed
 * @access public
 */
public function linkToCharacter($charID, $text, $server = null)
{
 if ($charID) {
  $params = array('id' => $charID);
  if ($server) {
$params['preferred_server'] = $server;
  }

  $url = $this->url('character', 'view', $params);
  return sprintf('<a href="%s" class="link-to-character">%s</a>', $url, htmlentities($text));
 }
 else {
  return false;
 }
}

/**
 * Deny entry to a page if called. This method should be used from a module
 * script, and no where else.
 */
public function deny()
{
 $location = $this->url('unauthorized');
 $this->redirect($location);
}

/**
 * Get the full gender string from a gender letter (e.g. M for Male).
 *
 * @param string $gender
 * @return string
 * @access public
 */
public function genderText($gender)
{
 switch (strtoupper($gender)) {
  case 'M':
return Flux::message('GenderTypeMale');
break;
  case 'F':
return Flux::message('GenderTypeFemale');
break;
  case 'S':
return Flux::message('GenderTypeServer');
break;
  default:
return false;
break;
 }
}

/**
 * Get the account state name corresponding to the state number.
 *
 * @param int $state
 * @return mixed State name or false.
 * @access public
 */
public function accountStateText($state)
{
 $text  = false;
 $state = (int)$state;

 switch ($state) {
  case 0:
$text  = Flux::message('AccountStateNormal');
$class = 'state-normal';
break;
  case 5:
$text  = Flux::message('AccountStatePermBanned');
$class = 'state-permanently-banned';
break;
 }

 if ($text) {
  $text = htmlspecialchars($text);
  return sprintf('<span class="account-state %s">%s<span>', $class, $text);
 }
 else {
  return false;
 }
}

/**
 * Get the job class name from a job ID.
 *
 * @param int $id
 * @return mixed Job class or false.
 * @access public
 */
public function jobClassText($id)
{
 return Flux::getJobClass($id);
}

/**
 * Return hidden input fields containing module and action names based on
 * the setting of UseCleanUrls.
 *
 * @param string $moduleName
 * @param string $actionName
 * @return string
 * @access public
 */
public function moduleActionFormInputs($moduleName, $actionName = null)
{
 $inputs = '';
 if (!Flux::config('UseCleanUrls')) {
  if (!$actionName) {
$dispatcher = Flux_Dispatcher::getInstance();
$actionName = $dispatcher->defaultAction;
  }
  $inputs .= sprintf('<input type="hidden" name="module" value="%s" />', htmlspecialchars($moduleName))."n";
  $inputs .= sprintf('<input type="hidden" name="action" value="%s" />', htmlspecialchars($actionName));
 }
 return $inputs;
}

/**
 * Get the homun class name from a class ID.
 *
 * @param int $id
 * @return mixed Job class or false.
 * @access public
 */
public function homunClassText($id)
{
 return Flux::getHomunClass($id);
}
/**
 * Get the item type name from an item type.
 *
 * @param int $id
 * @return mixed Item type or false.
 * @access public
 */
public function itemTypeText($id)
{
 return Flux::getItemType($id);
}

/**
 *
 *
 */
public function emblem($guildID, $serverName = null, $athenaServerName = null)
{
 if (!$serverName) {
  $serverName = Flux::$sessionData->loginAthenaGroup->serverName;
 }

 if (!$athenaServerName) {
  $athenaServerName = Flux::$sessionData->getAthenaServer(Flux::$sessionData->athenaServerName);
 }

 return $this->url('guild', 'emblem',
  array('login' => $serverName, 'charmap' => $athenaServerName, 'id' => $guildID));
}

/**
 * Redirect to login page if the user is not currently logged in.
 */
public function loginRequired($message = null)
{
 $dispatcher = Flux_Dispatcher::getInstance();
 $dispatcher->loginRequired($this->basePath, $message);
}

/**
 * Link to a item view page.
 *
 * @param int $itemID
 * @param string $text
 * @return mixed
 * @access public
 */
public function linkToItem($itemID, $text, $server = null)
{
 if ($itemID) {
  $params = array('id' => $itemID);
  if ($server) {
$params['preferred_server'] = $server;
  }

  $url = $this->url('item', 'view', $params);
  return sprintf('<a href="%s" class="link-to-item">%s</a>', $url, htmlentities($text));
 }
 else {
  return false;
 }
}

/**
 *
 */
public function displayScript($scriptText)
{
 $lines  = preg_split('/(r?n)/', $scriptText, -1);
 $text   = '';
 $script = array();

 foreach ($lines as $num => $line) {
  $text	.= "$linen";
  $lineNum  = sprintf('<span class="script-line-num">%d</span>', $num + 1);
  $lineCode = sprintf('<span class="script-line-code">%s</span>', htmlspecialchars($line));
  $script[] = sprintf('<p class="script-line">%s %s</p>', $lineNum, $lineCode);
 }

 return trim($text) == '' ? '' : implode("n", $script);
}

/**
 *
 */
public function banTypeText($banType)
{
 $banType = (int)$banType;
 if (!$banType) {
  return Flux::message('BanTypeUnbanned');
 }
 elseif ($banType === 2) {
  return Flux::message('BanTypePermBanned');
 }
 elseif ($banType === 1) {
  return Flux::message('BanTypeTempBanned');
 }
 else {
  return Flux::message('UnknownLabel');
 }
}

/**
 *
 */
public function equippableJobs($equipJob)
{
 $jobs	  = array();
 $equipJob  = (int)$equipJob;
 $equipJobs = Flux::getEquipJobsList();

 foreach ($equipJobs as $bit => $name) {
  if ($equipJob & $bit) {
$jobs[] = $name;
  }
 }

 if (count($jobs) === count($equipJobs)) {
  return array('All Jobs');
 }
 else {
  return $jobs;
 }
}

/**
 * Link to a monster view page.
 *
 * @param int $monsterID
 * @param string $text
 * @return mixed
 * @access public
 */
public function linkToMonster($monsterID, $text, $server = null)
{
 if ($monsterID) {
  $params = array('id' => $monsterID);
  if ($server) {
$params['preferred_server'] = $server;
  }

  $url = $this->url('monster', 'view', $params);
  return sprintf('<a href="%s" class="link-to-monster">%s</a>', $url, htmlentities($text));
 }
 else {
  return false;
 }
}

/**
 *
 */
public function equipLocations($equipLoc)
{
 $locations   = array();
 $equipLoc	= (int)$equipLoc;
 $equipLocs   = Flux::getEquipLocationList();

 foreach ($equipLocs as $bit => $name) {
  if ($equipLoc & $bit) {
$locations[] = $name;
  }
 }

 return $locations;
}

/**
 *
 */
public function equipUpper($equipUpper)
{
 $upper   = array();
 $table   = Flux::getEquipUpperList();

 foreach ($table as $bit => $name) {
  if ($equipUpper & $bit) {
$upper[] = $name;
  }
 }

 return $upper;
}
/**
 * Link to a guild view page.
 *
 * @param int $guildID
 * @param string $text
 * @return mixed
 * @access public
 */
public function linkToGuild($guild_id, $text, $server = null)
{
 if ($guild_id) {
  $params = array('id' => $guild_id);
  if ($server) {
$params['preferred_server'] = $server;
  }

  $url = $this->url('guild', 'view', $params);
  return sprintf('<a href="%s" class="link-to-guild">%s</a>', $url, htmlentities($text));
 }
 else {
  return false;
 }
}

/**
 *
 */
public function donateButton($amount)
{
 ob_start();
 include FLUX_DATA_DIR.'/paypal/button.php';
 $button = ob_get_clean();
 return $button;
}

/**
 *
 */
public function shopItemImage($shopItemID, $serverName = null, $athenaServerName = null)
{
 if (!$serverName) {
  $serverName = Flux::$sessionData->loginAthenaGroup->serverName;
 }

 if (!$athenaServerName) {
  $athenaServerName = Flux::$sessionData->getAthenaServer(Flux::$sessionData->athenaServerName);
 }

 if (!$serverName || !$athenaServerName) {
  return false;
 }

 $dir   = FLUX_DATA_DIR."/itemshop/$serverName/$athenaServerName";
 $exts  = implode('|', array_map('preg_quote', Flux::config('ShopImageExtensions')->toArray()));
 $imgs  = glob("$dir/$shopItemID.*");

 if (is_array($imgs)) {
  $files = preg_grep("/.($exts)$/", $imgs);
 }
 else {
  $files = array();
 }

 if (empty($files)) {
  return false;
 }
 else {
  reset($files);
  $imageFile = current($files);
  return preg_replace('&/{2,}&', '/', "{$this->basePath}/$imageFile");
 }
}

/**
 *
 */
public function iconImage($itemID)
{
 $path = sprintf(FLUX_DATA_DIR."/items/icons/".Flux::config('ItemIconNameFormat'), $itemID);
 $link = preg_replace('&/{2,}&', '/', "{$this->basePath}/$path");
 return file_exists($path) ? $link : false;
}

/**
 *
 */
public function itemImage($itemID)
{
 $path = sprintf(FLUX_DATA_DIR."/items/images/".Flux::config('ItemImageNameFormat'), $itemID);
 $link = preg_replace('&/{2,}&', '/', "{$this->basePath}/$path");
 return file_exists($path) ? $link : false;
}

/**
 *
 */
public function monsterMode($mode)
{
 $modes = Flux::monsterModeToArray($mode);
 $array = array();
 foreach (Flux::config('MonsterModes')->toArray() as $bit => $name) {
  if (in_array($bit, $modes)) {
$array[] = $name;
  }
 }
 return $array;
 }
}
?>

eto pala cpanel information ko

Hosting package  default
Server Name  ashley
cPanel Version  11.30.4 (build 6)
Theme  x3
Apache version  2.2.21
PHP version  5.2.17
MySQL version  5.1.56
Architecture  x86_64
Operating system  linux
Shared IP Address  (SECURED)
Path to sendmail  /usr/sbin/sendmail
Path to Perl  /usr/bin/perl
Perl version  5.8.8
Kernel version  2.6.18-238.19.1.el5
cPanel Pro  1.0 (RC1) 

i already fixed my own problem..i just changed my index.php to this

<?php
if (version_compare(PHP_VERSION, '5.2.1', '<')) {
echo '<h2>Error</h2>';
echo '<p>PHP 5.2.1 or higher is required to use Flux Control Panel.</p>';
echo '<p>You are running '.PHP_VERSION.'</p>';
exit;
}
// Disable Zend Engine 1 compatibility mode.
// See: http://www.php.net/manual/en/ini.core.php#ini.zend.ze1-compatibility-mode
ini_set('zend.ze1_compatibility_mode', 0);
// Time started.
define('__START__', microtime(true));
error_reporting(E_ALL);
ini_set('display_errors', 1);
define('FLUX_ROOT',	   str_replace('', '/', dirname(__FILE__)));
define('FLUX_DATA_DIR',   'data');
define('FLUX_CONFIG_DIR', 'config');
define('FLUX_LIB_DIR',    'lib');
define('FLUX_MODULE_DIR', 'modules');
define('FLUX_THEME_DIR',  'themes');
define('FLUX_ADDON_DIR',  'addons');
define('FLUX_LANG_DIR',   'lang');
// Clean GPC arrays in the event magic_quotes_gpc is enabled.
if (ini_get('magic_quotes_gpc')) {
$gpc = array(&$_GET, &$_POST, &$_REQUEST, &$_COOKIE);
foreach ($gpc as &$arr) {
 foreach ($arr as $key => $value) {
  if (is_string($value)) {
   $arr[$key] = stripslashes($value);
  }
 }
}
}
set_include_path(FLUX_LIB_DIR.PATH_SEPARATOR.get_include_path());
//ini_set('session.save_path', 'data/sessions');
// Default account levels.
require_once FLUX_CONFIG_DIR.'/levels.php';
// Some necessary Flux core libraries.
require_once 'Flux.php';
require_once 'Flux/Dispatcher.php';
require_once 'Flux/SessionData.php';
require_once 'Flux/DataObject.php';
require_once 'Flux/Authorization.php';
require_once 'Flux/Installer.php';
require_once 'Flux/PermissionError.php';
// Vendor libraries.
require_once 'markdown/markdown.php';
try {
if (!extension_loaded('pdo')) {
 throw new Flux_Error('The PDO extension is required to use Flux, please make sure it is installed along with the PDO_MYSQL driver.');
}
elseif (!extension_loaded('pdo_mysql')) {
 throw new Flux_Error('The PDO_MYSQL driver for the PDO extension must be installed to use Flux.  Please consult the PHP manual for installation instructions.');
}

// Initialize Flux.
Flux::initialize(array(
 'appConfigFile'	  => FLUX_CONFIG_DIR.'/application.php',
 'serversConfigFile'  => FLUX_CONFIG_DIR.'/servers.php',
 //'messagesConfigFile' => FLUX_CONFIG_DIR.'/messages.php' // No longer needed (Deprecated)
));

// Set time limit.
//set_time_limit((int)Flux::config('ScriptTimeLimit'));

// Set default timezone for entire app.
$timezone = Flux::config('DateDefaultTimezone');
if ($timezone && !@date_default_timezone_set($timezone)) {
 throw new Flux_Error("'$timezone' is not a valid timezone.  Consult http://php.net/timezones for a list of valid timezones.");
}

// Create some basic directories.
$directories = array(
 FLUX_DATA_DIR.'/logs/schemas',
 FLUX_DATA_DIR.'/logs/schemas/logindb',
 FLUX_DATA_DIR.'/logs/schemas/charmapdb',
 FLUX_DATA_DIR.'/logs/transactions',
 FLUX_DATA_DIR.'/logs/mail',
 FLUX_DATA_DIR.'/logs/mysql',
 FLUX_DATA_DIR.'/logs/mysql/errors',
 FLUX_DATA_DIR.'/logs/errors',
 FLUX_DATA_DIR.'/logs/errors/exceptions',
 FLUX_DATA_DIR.'/logs/errors/mail',
);
// Schema log directories.
foreach (Flux::$loginAthenaGroupRegistry as $serverName => $loginAthenaGroup) {
 $directories[] = FLUX_DATA_DIR."/logs/schemas/logindb/$serverName";
 $directories[] = FLUX_DATA_DIR."/logs/schemas/charmapdb/$serverName";

 foreach ($loginAthenaGroup->athenaServers as $athenaServer) {
  $directories[] = FLUX_DATA_DIR."/logs/schemas/charmapdb/$serverName/{$athenaServer->serverName}";
 }
}
foreach ($directories as $directory) {
 if (is_writable(dirname($directory)) && !is_dir($directory)) {
  mkdir($directory, 0777);
 }
}

// Installer library.
$installer = Flux_Installer::getInstance();
if ($hasUpdates=$installer->updateNeeded()) {
 Flux::config('ThemeName', 'installer');
}

$sessionKey = Flux::config('SessionKey');
session_save_path($dir=realpath(FLUX_DATA_DIR.'/sessions'));
if (!is_writable($dir)) {
 throw new Flux_PermissionError("The session storage directory '$dir' is not writable.  Remedy with `chmod 0707 $dir`");
}
elseif (!is_writable($dir=realpath(FLUX_DATA_DIR.'/logs'))) {
 throw new Flux_PermissionError("The log storage directory '$dir' is not writable.  Remedy with `chmod 0707 $dir`");
}
elseif (!is_writable($dir=realpath(FLUX_DATA_DIR.'/itemshop'))) {
 throw new Flux_PermissionError("The item shop image directory '$dir' is not writable.  Remedy with `chmod 0707 $dir`");
}
elseif (!is_writable($dir=realpath(FLUX_DATA_DIR.'/tmp'))) {
 throw new Flux_PermissionError("The temporary directory '$dir' is not writable.  Remedy with `chmod 0707 $dir`");
}
elseif (ini_get('session.use_trans_sid')) {
 throw new Flux_Error("The 'session.use_trans_sid' php.ini configuration must be turned off for Flux to work.");
}
else {
 $sessionExpireDuration = Flux::config('SessionCookieExpire') * 60 * 60;
 session_set_cookie_params($sessionExpireDuration, Flux::config('BaseURI'));
 ini_set('session.name', $sessionKey);
 session_start();
}

if (empty($_SESSION[$sessionKey]) || !is_array($_SESSION[$sessionKey])) {
 $_SESSION[$sessionKey] = array();
}

// Initialize session data.
Flux::$sessionData = new Flux_SessionData($_SESSION[$sessionKey], $hasUpdates);

// Initialize authorization component.
$accessConfig = Flux::parseConfigFile(FLUX_CONFIG_DIR.'/access.php');

// Merge with add-on configs.
foreach (Flux::$addons as $addon) {
 $accessConfig->merge($addon->accessConfig);
}

$accessConfig->set('unauthorized.index', AccountLevel::ANYONE);
$authComponent = Flux_Authorization::getInstance($accessConfig, Flux::$sessionData);

if (!Flux::config('DebugMode')) {
 ini_set('display_errors', 0);
}
// Dispatch requests->modules->actions->views.
$dispatcher = Flux_Dispatcher::getInstance();
$dispatcher->setDefaultModule(Flux::config('DefaultModule'));
$dispatcher->dispatch(array(
 'basePath'				  => Flux::config('BaseURI'),
 'useCleanUrls'			  => Flux::config('UseCleanUrls'),
 'modulePath'			    => FLUX_MODULE_DIR,
 'themePath'				 => FLUX_THEME_DIR.'/'.Flux::config('ThemeName'),
 'missingActionModuleAction' => Flux::config('DebugMode') ? array('errors', 'missing_action') : array('main', 'page_not_found'),
 'missingViewModuleAction'   => Flux::config('DebugMode') ? array('errors', 'missing_view')   : array('main', 'page_not_found')
));
}
catch (Exception $e) {
$exceptionDir = FLUX_DATA_DIR.'/logs/errors/exceptions';
if (is_writable($exceptionDir)) {
 require_once 'Flux/LogFile.php';
 $today = date('Ymd');
 $eLog  = new Flux_LogFile("$exceptionDir/$today.log");

 // Log exception.
 $eLog->puts('(%s) Exception %s: %s', get_class($e), get_class($e), $e->getMessage());
 foreach (explode("n", $e->getTraceAsString()) as $traceLine) {
  $eLog->puts('(%s) **TRACE** %s', get_class($e), $traceLine);
 }
}

require_once FLUX_CONFIG_DIR.'/error.php';
define('__ERROR__', 1);
include $errorFile;
}
?>

Edited by Emistry
Please use CODEBOX for long content
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  62
  • Topics Per Day:  0.01
  • Content Count:  137
  • Reputation:   0
  • Joined:  04/07/12
  • Last Seen:  

http://jimro.uphero.com/fluxcp/?module=account&action=create

look at this, the image screwed up and the security code wont show up. what is the problem in here?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  633
  • Reputation:   78
  • Joined:  11/14/11
  • Last Seen:  

Modification of time limit is disabled on your webhost. FluxCP uses set_time_limit function to modify the allowed execution time of the scripts since fluxcp cant use that function some features might not be loaded properly that's why you cant see the security code.

About the screwed up images, if you get rid of the error Im sure it will return to normal

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  277
  • Reputation:   76
  • Joined:  11/23/11
  • Last Seen:  

also you might want to edit your tos.php

http://jimro.uphero.com/fluxcp/?module=service&action=tos

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  62
  • Topics Per Day:  0.01
  • Content Count:  137
  • Reputation:   0
  • Joined:  04/07/12
  • Last Seen:  

Modification of time limit is disabled on your webhost. FluxCP uses set_time_limit function to modify the allowed execution time of the scripts since fluxcp cant use that function some features might not be loaded properly that's why you cant see the security code.

About the screwed up images, if you get rid of the error Im sure it will return to normal

can you teach me any free webhosting site that i can use?

also you might want to edit your tos.php

http://jimro.uphero....vice&action=tos

yah. i can do that but for know im dealing with erros though. :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  277
  • Reputation:   76
  • Joined:  11/23/11
  • Last Seen:  

Change your host

http://www.000webhost.com/forum/customer-assistance/27231-php-set_time_limit-0-simply-more-than-10-a.html

Unfortunately, functions like exec(), shell_exec(), proc_open(), passthru(), system(), set_time_limit() and similar can not be enabled for security reasons.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  633
  • Reputation:   78
  • Joined:  11/14/11
  • Last Seen:  

sourceforge.net?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  491
  • Reputation:   19
  • Joined:  11/19/11
  • Last Seen:  

sorry i re-open this topic, I get the same problem, is there anything that can help?

I've tried the above but still no luck, maybe anyone can give clues

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/kloxo/httpd/default/fluxcp/lib/Flux/Connection/Statement.php on line 14

i'm use php 5.3

thanks for advance :)

FIXED thanks

i'm edit on config/application.php

'DateDefaultTimezone'  => 'UTC',					 // The default timezone, consult the PHP manual for valid timezones: http://php.net/timezones (null for defaut system TZ)

:) thanks

Edited by Akbare
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  236
  • Reputation:   1
  • Joined:  04/25/12
  • Last Seen:  

error : PHP Error Message

Warning: set_time_limit() has been disabled for security reasons in /home/a2870341/public_html/index.php on line 73

// Set time limit. set_time_limit((int)Flux::config('ScriptTimeLimit'));

Edited by elcontrol00
Link to comment
Share on other sites

×
×
  • Create New...