Hi all,
We're running FCK on two servers. On one server FCK's SpellerPages works fine. On the other server it doesn't. When I click the spell check button, my browser reports JavaScript errors in the SpellChecker.php file. When I view the source of the served page, I get the following:
-----------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../spellerStyle.css" />
<script language="javascript" src="../wordWindow.js"></script>
<script language="javascript">
var suggs = new Array();
var words = new Array();
var textinputs = new Array();
var error;
<br />
<b>Warning</b>: Invalid argument supplied for foreach() in <b>E:\MWEB\wwwroot\MyWebsite\fckeditor\editor\dialog\fck_spellerpages\spellerpages\server-scripts\spellchecker.php</b> on line <b>25</b><br />
<br />
<b>Warning</b>: shell_exec() [<a href='function.shell-exec'>function.shell-exec</a>]: Unable to execute '"C:\Program Files\Aspell\bin\aspell.exe" -a --lang=en_US --encoding=utf-8 -H --rem-sgml-check=alt < E:\TEMP\aspCB8.tmp 2>&1' in <b>E:\MWEB\wwwroot\MyWebsite\fckeditor\editor\dialog\fck_spellerpages\spellerpages\server-scripts\spellchecker.php</b> on line <b>98</b><br />
error = 'System error: Aspell program execution failed (`"C:\Program Files\Aspell\bin\aspell.exe" -a --lang=en_US --encoding=utf-8 -H --rem-sgml-check=alt < E:\TEMP\aspCB8.tmp 2>&1`)';
var wordWindowObj = new wordWindow();
wordWindowObj.originalSpellings = words;
wordWindowObj.suggestions = suggs;
wordWindowObj.textInputs = textinputs;
function init_spell() {
// check if any error occured during server-side processing
if( error ) {
alert( error );
} else {
// call the init_spell() function in the parent frameset
if (parent.frames.length) {
parent.init_spell( wordWindowObj );
} else {
alert('This page was loaded outside of a frameset. It might not display properly');
}
}
}
</script>
</head>
<!-- <body onLoad="init_spell();"> by FredCK -->
<body onLoad="init_spell();" bgcolor="#ffffff">
<script type="text/javascript">
wordWindowObj.writeBody();
</script>
</body>
</html>
-----------------------
I looked in the source of the PHP file to see what happens at line 25, and we're in the middle of this function:
function print_textinputs_var() {
global $textinputs;
foreach( $textinputs as $key=>$val ) {
# $val = str_replace( "'", "%27", $val );
echo "textinputs[$key] = decodeURIComponent(\"" . $val . "\");\n";
}
}
I don't normally work in PHP, so please excuse my ignorance, but I'm guessing that the $textinputs variable has not been populated correctly.
Does anyone have any suggestions as to why it works on one server but not on the other? I'm using FCKEditor version 2.5 (within the FCKeditor.Net control). I've configured FCKEditor to use the PHP version of SpellerPages. PHP is installed and working. ASpell works fine from the command line. As far as I can see, file permissions are set the same on both servers.
Any help would be much appreciated.
Tue, 01/08/2008 - 11:58
#1