PDA

View Full Version : Affiliates Pro v3 php error



alsonkimichi
02-26-2009, 02:46 PM
Hi all,
need some help from you, i upload the php scripts to the server and when i click on my link: http://www.cozyfeel.com/tracker/install/install.php, it gives me this error of Error: file /install/tree.chk is missing. Hope to get some solutions oon..

thanks

Nile
02-26-2009, 10:54 PM
Can we see the code please?

alsonkimichi
02-27-2009, 01:55 AM
the codes are:

install.php
PHP script text
--------------------------------------------------------------------------------

<?php
/**,,`,o.O-(`-----2007-----)-O.o,`,,*\
| |
| ::: :::. .,-:::::/ |
| SoftService.org ;;; ;;`;; ,;;-'````' Always a Pleasure |
| Affiliate.PRO.v3.0 [[[ ,[[ '[[, [[[ [[[[[[/ Serving the Scene |
| -------------------- $$$ c$$$cc$$$c "$$c. "$$ ----------------- |
| Checked.&.Cleared BY 888 888 888, `Y8bo,,,o88o Greetz to WST|GTT |
| MMM YMM [IAG] Null Group |
| |
\*,,`,o.O-(`---September--)-O.o,`,,**/
?>

<?php
// $Id: install.php 236 2007-09-17 08:21:46Z adgar $

error_reporting(0);
if (0 == intval(ini_get('safe_mode'))) set_time_limit(0);
ini_set('memory_limit', '16M');
session_start();
ob_start();

$flagfile = '../config/instflag';
$finalstep = 4;
$configfile = '../config/config.php';

if (!file_exists($flagfile)) {
if ((isset($_GET['step'])))
$_SESSION['step']=$_GET['step'];
elseif (!isset($_SESSION['step']))
$_SESSION['step'] = 1;

} else {
$_SESSION['step'] = 4;
}

if (1 == $_SESSION['step']) {
$tree = unserialize(file_get_contents('tree.chk'));
if (false === $tree) {
echo "<strong>Error:</strong> file /install/tree.chk is missing";
exit();
}
$is_iis = (boolean) preg_match("/IIS/i", $_SERVER['SERVER_SOFTWARE']);
$corrupt_files = array();
foreach ($tree as $file => $size) {
if (!($is_iis && false !== strstr($file, '.htaccess'))) {
if (!file_exists('..' . $file)) $corrupt_files[] = $file;
}
}
if (0 != count($corrupt_files)) {
echo "<br>AffiliatePro distribution is incomplete, following files were not found:</strong><br>";
echo implode("<br>", $corrupt_files);
echo "<br>Please make sure all files from distribution on your server.";
exit();
}
unset($tree, $is_iss, $corrupt_files);
}

if (file_exists($configfile)) {
require_once('../affiliate/cfg.php');
} else {
$include_path=array(
'./',
realpath('../config'),
realpath('../lib'),
realpath('../include')
);
ini_set('include_path', implode(PATH_SEPARATOR, $include_path));
}

require_once('xtemplate.class.php');

$filename='templates/main.html';
$xtpl=new XTemplate($filename);

/* BEGIN: step_menu*/
$stepmenu[]=array('number'=>'1', 'description'=>'Create Database', 'link'=>'install.php?step=1');
$stepmenu[]=array('number'=>'2', 'description'=>'Primary Admin Setup', 'link'=>'install.php?step=2');
$stepmenu[]=array('number'=>'3', 'description'=>'Site Setup', 'link'=>'install.php?step=3');


for ($i=0; $i<count($stepmenu); $i++) {

$xtpl->assign('curentstep',($_SESSION['step']==($i+1))?'<img src="images/li.png" border="0">':'&nbsp;');
$xtpl->assign('stepnumber', $stepmenu[$i]['number']);
$xtpl->assign('stepdescription', ($_SESSION['step']==($i+1))?'<strong>'.$stepmenu[$i]['description'].'</strong>':$stepmenu[$i]['description']);

// $xtpl->assign('steplink', $stepmenu[$i]['link']);
$xtpl->parse('main.step_menu.loop');
}
$xtpl->parse('main.step_menu.');

if ($_SESSION['step']!=$finalstep)
$xtpl->parse('main.step_menu');
/* END: step_menu*/

/* BEGIN: current_template*/
$filename='step' . $_SESSION['step'];
$xtpl->assign_file('CURRENTTEMPLATE','templates/' . $filename . '.html');
require_once('php/' . $filename . '.php');
/* END: current_template*/

$xtpl->parse('main.template');
/* BEGIN: buttonts_panel*/

//prev button
if (!in_array($_SESSION['step'], array(1, 2, $finalstep))) {
$xtpl->assign('ONCLICK1', "onClick=\"window.location.href='install.php?step=".($_SESSION['step']-1)."';\"");
} else {
$xtpl->assign('DISABLE1', 'disabled="disabled"');
}
//next button
if (!in_array($_SESSION['step'], array($finalstep-1, $finalstep))) {
$xtpl->assign('ONCLICK2', "onClick=\"javascript:document.getElementById('dataform').submit();\"");
} else {
$xtpl->assign('DISABLE2', 'disabled="disabled"');
}
//finish button
if (in_array($_SESSION['step'], array($finalstep-1))) {
$xtpl->assign('ONCLICK3', "onClick=\"javascript:document.getElementById('dataform').submit();\"");
} else {
$xtpl->assign('DISABLE3', 'disabled="disabled"');
}

if ($_SESSION['step'] != ($finalstep)) {
$xtpl->parse('main.buttonts_panel');
}

/* END: buttonts_panel*/
$xtpl->parse('main');
$xtpl->out('main');
?>

?foru
02-27-2009, 02:14 AM
Hi,

In your install.php script look down at around line 38 in the code


if (1 == $_SESSION['step']) {
$tree = unserialize(file_get_contents('tree.chk'));
if (false === $tree) {
echo "<strong>Error:</strong> file /install/tree.chk is missing";
exit();
}

in $tree = unserialize(file_get_contents('tree.chk')); you might try changing the path as that assumes tree.chk is in the same directory as install.php (or double check to see if tree.chk and install.php are in the same directory)

for instance if tree.chk is in the includes directory you would have $tree = unserialize(file_get_contents('includes/tree.chk'));

That might at least get you past the "install" portion of the script.

Nile
02-27-2009, 02:21 AM
It is in the same directory:
http://www.cozyfeel.com/tracker/install/tree.chk

The reason this is happening (i think) is because it's to long to unserialize.

?foru
02-27-2009, 02:25 AM
:D Nice catch Nile.....been in front of a computer way too long today. Not sure on that then, since you disproved anything directory wise.

Nile
02-27-2009, 02:32 AM
Yeah - it has to do with the serialize function.. :/

alsonkimichi
02-27-2009, 02:43 AM
both the file are in the same directory, which means from th install.php file to change the
$tree = unserialize(file_get_contents('tree.chk')); to
$tree = unserialize(file_get_contents('http://www.cozyfeel.com/tracker/install/tree.chk'));

please advice

magicyte
02-27-2009, 02:46 AM
No, you don't need to do that. They are already in the same directory, so that directory is set as a default for files in that directory. The first example you gave is valid. Nile just thinks that unserialize can't parse such long file- i think...

alsonkimichi
02-27-2009, 02:50 AM
sorry for that, cos im not too sure about the php scripts, would you mind to explain what the serialize. what should i do ??

thanks

alsonkimichi
02-27-2009, 02:51 AM
or is there anyway i let you access to my server side, take a look ??

i will create a temp id and username>>???

magicyte
02-27-2009, 03:22 AM
sorry for that, cos im not too sure about the php scripts, would you mind to explain what the serialize. what should i do ??

thanks

Sorry- I meant unserialize, not serialize. I'm not a master at PHP, but ask Nile or someone else- they're good.

Nile
02-27-2009, 03:49 AM
Actually... I dont think unserialize can turn a string that long into an array... Not a file that long. The string holds to much data.

?foru
02-27-2009, 04:06 AM
Poor developing? If the developer knows the length of the tree file I wonder why they would use it? I had a problem one time with a script only to find out later that the function being used in the script wasn't enabled on the server.

They could put the following in a file to check...

func_test.php

<?php
if(function_exists('unserialize')) {
echo "unserialize function is enabled";
}
else {
echo "unserialize is NOT enabled";
}
?>

Upload to your server and visit that file in the browser to see the result.

unserialize might be a very common function(which I'm not familiar with), but Nile might be able to give you more info on it.

alsonkimichi
02-27-2009, 05:03 AM
ok , i try it out and let you all know the status

thanks

alsonkimichi
02-27-2009, 05:20 AM
for this script where should i put into the install.php or have to create a new one??

?foru
02-27-2009, 03:54 PM
for this script where should i put into the install.php or have to create a new one??

You can just create a new file with that code in it and name it whatever you want like test.php After you upload the file go to that page in your browser to see the result.

handyman
03-12-2009, 05:51 PM
Was this resolved I have the same problem but another file installing this software.

The support of the software just say they will do the install but I'm not in the routine of allowing outsiders on my servers so if I don't sort this myself I'll have move on and use another Afiliate software package.