Fatal error: Function name must be a string in public_html/install/index.php on line 1296
Warning: Please contact support about failure in /public_html/install/index.php on line 1295
Fatal error: Function name must be a string in /public_html/install/index.php on line 1296
Okay so I did bad at explaining the whole thing. So Basically I'm trying to install Boonex Dolphin 7.0.6 (Social Networking CMS) on my Web site. I installed all the files correctly. I went to the install page. Went to the second page where I had to make all the files Writable. Once I made all the files Writable I went on to the next page called "Paths". And this is where it gave me the error above. The file has over 1483 Lines. Here is the Code Below.
Where it says $func = create_function("", $funcbody);
Thats Line 1295
Lines 1281 - 1350
function printInstallError($sText) {
$sRet = (strlen($sText)) ? '<div class="error">' . $sText . '</div>' : '';
return $sRet;
}
function createTable($arr) {
$ret = '';
$i = '';
foreach($arr as $key => $value) {
$sStyleAdd = (($i%2) == 0) ? 'background-color:#ede9e9;' : 'background-color:#fff;';
$def_开发者_开发百科exp_text = "";
if (strlen($value['def_exp'])) {
$funcbody = $value ['def_exp'];
$func = create_function("", $funcbody);
$def_exp = $func();
if (strlen($def_exp)) {
$def_exp_text = " <font color=green>found</font>";
$value['def'] = $def_exp;
} else {
$def_exp_text = " <font color=red>not found</font>";
}
}
$st_err = ($error_arr[$key] == 1) ? ' style="background-color:#FFDDDD;" ' : '';
$ret .= <<<EOF
<tr class="cont" style="{$sStyleAdd}">
<td>
<div>{$value['name']}</div>
<div>Description:</div>
<div>Example:</div>
</td>
<td>
<div><input {$st_err} size="30" name="{$key}" value="{$value['def']}" /> {$def_exp_text}</div>
<div>{$value['desc']}</div>
<div style="font-style:italic;">{$value['ex']}</div>
</td>
</tr>
EOF;
$i ++;
}
return $ret;
}
function rewriteFile($sCode, $sReplace, $sFile) {
$ret = '';
$fs = filesize($sFile);
$fp = fopen($sFile, 'r');
if ($fp) {
$fcontent = fread($fp, $fs);
$fcontent = str_replace($sCode, $sReplace, $fcontent);
fclose($fp);
$fp = fopen($sFile, 'w');
if ($fp) {
if (fputs($fp, $fcontent)) {
$ret .= true;
} else {
$ret .= false;
}
fclose ( $fp );
} else {
$ret .= false;
}
} else {
$ret .= false;
}
return $ret;
}
If you need more code please let me know so I can help also thanks for reading this ^_^ and re helping as well. I also tried what the last person said with the adding "$a" and ";" but it did not help. Just got me more errors.
What can be stored in $value['def_exp']
?
As it is your create_function
call is not returning a value. Or so it seems. I did a simple mock up to show an example:
$funcbody = 'hello';
$func = create_function('$a', 'return $a;');
$def_exp = $func($funcbody);
This works as expected. Depending on what is in $funcbody
you either need to add a ;
after it IE:
$func = create_function('$a', $funcbody . ';');
A return
before it and ;
after it:
$func = create_function('$a', 'return ' . $funcbody . ';');
Or pass it as a parameter as I did in the first example. Not sure which you require, as I do not know what is stored in the $value['def_exp']
but hopefully that gets you rolling.
create_function() is probably failing. try
var_dump( $func );
if its false
, then that is why and you should look at $funcbody
精彩评论