I have contacted my host to make sure they have aspell installed and the version is above 0.50, both of which they have. Now, I went into the editor settings and put in the aspellpath to /usr/bin/aspell <--which is what my hoster gave me. I turn editorspelling "Yes" and click save. Now, under where it says "yes" I believe im suppose to get a list of dictionaires to choose from, but what I get is "Error! Check your aspell installation!". I did a search for anyone else who is getting the that error but have not been able to find any? Any help would be GREAT!
Thanks!
Anybody? Please?
Have you checked (editor settings page) that the spelling buttong isn't hidden?
- Janne -
Hi Janne,
First, thanks for responding!!!
I just checked again, and they are all unchecked, including the icon for the spellcheck feature. I've also did a complete refresh, deleted my cache files, everything. Still no luck. The aspell directory works as it gives me the option to choose the dictionary I want to use and moodle doesn't complain about the directory.
Thats where im currently at.
The spellcheck button should appear if these tree conditions are met:
- Aspellpath is set
- Aspell program is found at provided location (aspellpath)
- Editorspelling is enabled (aka editorspelling is set to yes in editor settings).
Since in your case all these three are set, only reasons why spellcheck button doesn't appear could be:
- htmlarea.php is cached. The button should appear when browsers cache is cleared (also offline).
- Some of those variables above didn't get into config table (prefix_config), thus some of those tree conditions aren't met. Check prefix_config table is aspellpath set (the path should be in value field) and editorspelling is set (there should be 1 (one) in value field).
Hi Janne,
Again, thanks for responding. I cleared by cache out and also tried it on a computer that has never been to my site. Still no icon. IN another thread on this discussion, a person recommened I add
echo $CFG->aspellpath."<br />".file_exists($CFG->aspellpath)."<br />".$CFG->editorspelling;
to the bottom of the admin page; in which it gave me the reply of
/usr/bin/aspell
1
I believe this to be normal? I tried a simple php spellcheck script to see if aspell is even and working and the script worked fine and spellchecked the word. I'm in a bit of a rut I believe.
Output should be (if aspell is under /usr/bin directory):
/usr/bin/aspell
1
1
If aspell executable is in /usr/bin -directory then I'm really confused...
Could you add this at the end of your admin page:
clearstatcache();
echo $CFG->aspellpath."<br />".file_exists($CFG->aspellpath)."<br />".$CFG->editorspelling;
- Janne -
I added clearstatcache();
echo $CFG->aspellpath."<br />".file_exists($CFG->aspellpath)."<br />".$CFG->editorspelling;
to the bottom of the admin page and received the following.
/usr/bin/aspell
1
Another poster (Daniel) posted this after he seen what I just posted you about having only one "1"
"Yes, that's make a difference. It means that the PHP function file_exists is not able to locate the file /usr/bin/aspell. I don't know why it is so. The PHP Manual says this could be due to Safe Mode restrictions (further info).
At the Moodle admin page, the mechanism for checking the path to (and function of) aspell is different, that's why everything seems OK there, and then there is no icon in the editor.
I'm not a Linux guy so I'm not able to say what you should do in order to get the file_exists function to operate accordingly in you Moodle installation. What you can use as an immediate hack/test is to disable the file_exists check in the code of the editor and see whether the spell-checker will run without it, or not. If not, you have to find out how to tell the file_exists function that the file /usr/bin/aspell is at its place. It yes, you can leave it as it is, or pursue the same path as in the former case.

- Find the file lib/editor/htmlarea.php.
- Around line no. 150 find this bit of code:
<?php if (!empty($CFG->aspellpath) && file_exists($CFG->aspellpath) && !empty($CFG->editorspelling)) {
echo '"separator","spellcheck",';
} ?> - Delete the highlighted part, save the file and try to use the editor somewhere.
Tested just now: At my site, if I use the file_exists function in a place where the Safe Mode restrictions apply, it returns FALSE, when used in a place with Safe Mode off, it returns TRUE."
I posted the following
" I went and deleted the && file_exists($CFG->aspellpath)
from the htmlarea.php file and went to the editor in the moodle and received the following error "Error [createSelect]: Can't find the requested dropdown definition" and also "FIXME: Unknown toolbar item: spellcheck" After I click ok on both of these popup windows the toolbar loads with all icons except the spellcheck. It must be due to the file_exists fuction as you stated above."
And this is now where I sit. Confused!;)
You must remove && file_exists($CFG->aspellpath) from line 232 also. After that you should see spell-check button. Now the downside
The spell-check popup opens but spelling does not take place.
At this point seems like "we're screwed"
- Janne -
Don't know if this will help in your situation, but we were having similar problems trying to get the spell check working. We're running Windows 2003 server with Apache 1.3.x, PHP 4.1...
We made sure, first of all, that the path to aspell was not in the config file (config php). We then moved aspell to C:\Aspell (previously in program file, which seemed to be the problem because there were spaces in the file name). You may want to make sure you clear your cache before you check to see if the button appears.
If you try this, it may cause the administration section (especially Editor Settings) to freeze or be caught in an endless loop. You will need to stop and start your Apache server, and then all should be well ... at least is was for us. We tried this on both our test and production servers and it worked for both.
Also, in the read me files of aspell, it mentions that it is happiest running from C:\Aspell
Hope that helps.
- Heather
p.s. By the way, I just tried a spell check from this Moodle forum and I received the following error ... hmmm ... looks like the settings here need to be updated.
error = 'No suitable dictionary found installed on your server!';
Jim


the next step is that i gave IIS_WGP rights to read and write and execute.
I put the path in moodle >> aspellpath: C:\Aspel
From the Admin account, when i click on the spell check, i get this error: error = 'Couldn\'t create handle!';
In the drop down menu in the editor settings, editorspelling: couldn't create handle
I appreciate your help
Amer
I am replying to the above solution suggested by Heather Jackson (me and Heather worked on this together). Well, since then I have installed MOODLE 1.6 Beta 5 on our test server and yep... you guessed it the spell checker failed. I tried various solutions that had worked for us in the past but no go.After numerous attempts to solve the problem I gave up ... but then me being the obsessive person that I am (and it was Friday afternoon) I decided to go for broke and dig deep into the MOODLE db and the "admin\editor.php" file. Here's what I found; the value for "editordictionary" (in the db) was empty.
Here's what I did:
- Open http://127.0.0.1:8900/mysql/ (this the local MYSQL data administrator)
- Go to MOODLE db
- Locate the table ''mdl_config''
- Locate ''editordictionary''
- set value to en_US (or preferred dictionary)
The spell checker then worked but I still had this error "Error! Check your aspell installation!" in the editor.php page. So, I made a backup copy of the editor.php and proceeded to open the original and look for any indications of dictionary (by the way, I know next to nothing about .php -- I'm an .asp guy). Well, what I found found was this line:
line 241: $dicts = array();
Yep, no values, that's why the above errors keep appearing even if the spell checker works. I adjusted line 241 to look like this:
$dicts = array('en_US','en_CA');
All seems to be well now -- AND -- I can now choose different dictionaries.
I hope this helps those that may be having Aspell problems. My question I have is: Why does the default installation of MOODLE set the values to nothing in the editor.php file --- why not at least include one language like en_US or en_CA -- something, anything?
NOTE: I guess this means if you want several different languages to choose from in the dictionary drop down list you must enter them manually. Also, keep in mind this is on a Windows install so things may be completely different in the *NIX world.
the line of code you have changed in the .php file is an initialisation of the array. That is not where the trouble comes from.
A few lines further, the programmer uses ...
====================================================================
if(!($handle = @popen(escapeshellarg($cmd) .' dump dicts', 'r'))) {
return $strerror = "Couldn't create handle!";
exit;
====================================================================
This is the line where he gets all the present dictionaries. I guess that the dump dicts command does not work under windows, that's why you get an empty list of dictionaries and that's why the error message shows.
In other words - some adjustments have to be made here - I'll try and look into it.
Frank
Here's where I think the problem lies in lib/adminlib.php but everything I tried did not work:
$cmd = $CFG->aspellpath;
$output = '';
$dictionaries = array();
$dicts = array();
if(!($handle = @popen(escapeshellarg($cmd) .' dump dicts', 'r'))) {
return 'Couldn\'t create handle!';
}
while(!feof($handle)) {
$output .= fread($handle, 1024);
}
@pclose($handle);
$dictionaries = explode(chr(10), $output);
// Get rid of possible empty values
if (is_array($dictionaries)) {
$cnt = count($dictionaries);
for ($i = 0; $i < $cnt; $i++) {
if (!empty($dictionaries[$i])) {
$dicts[$dictionaries[$i]] = $dictionaries[$i];
}
}
}
if (count($dicts) >= 1) {
return $dicts;
I tried $dicts = array("en", "fr"); but it is still does shows english only.
Any help is appreciated. I'm runnung Mac OS X, so it should be identical to any *nix build.
The aspell dump is below:
$ aspell dump dicts
en
en-variant_0
en-variant_1
en-variant_2
en-w_accents
en-wo_accents
en_CA
en_CA-w_accents
en_CA-wo_accents
en_GB
en_GB-ise
en_GB-ise-w_accents
en_GB-ise-wo_accents
en_GB-ize
en_GB-ize-w_accents
en_GB-ize-wo_accents
en_GB-w_accents
en_GB-wo_accents
en_US
en_US-w_accents
en_US-wo_accents
fr-40
fr
fr-60
fr-80
fr-lrg
fr-med
fr-sml
fr_CH-40
fr_CH
fr_CH-60
fr_CH-80
fr_CH-lrg
fr_CH-med
fr_CH-sml
fr_FR-40
fr_FR
fr_FR-60
fr_FR-80
fr_FR-lrg
fr_FR-med
fr_FR-sml
larry
The outstanding issue is how to resolve this.
Could a line be entered so that if the current_lang is fr_utf8, use fr for the dictionary?
Help with this line is needed.
L
After line 40 in spellchecker.php
$current_lang = current_language();
The following line was added
$current_lang = substr($current_lang,0,2);
and it works!
larry
In order to get the spellcheck button to appear on our site, we had to have the following line in the vhost.conf configuration (to override httpd.conf settings on our shared virtual server):
php_admin_value open_basedir /usr/bin/aspell:/path/to/httpdocs
(of course the bit after the ":" is the correct path to whence the webserver is serving the pages)
But now we get the error message "System error: Could not open file 'tmp/aspell_data_<random string>' for writing". Another permissions problem...but we're getting there!
We need /tmp in the list of accessible directories (open_basedir) as well, of course!
All seems to work now.
I have gotten this error since switching to a new host. They have reintalled Aspell, but I still get the error. They replied with these messages:
First...
root@freeville [~]# aspell -v
@(#) International Ispell Version 3.1.20 (but really Aspell .33.7.1 alpha)
root@freeville [~]# whereis aspell
aspell: /usr/bin/aspell /usr/lib/aspell /usr/include/aspell /usr/share/aspell
root@freeville [~]#
Second...
I have reinstalled aspell with EN dictionaries, paths are :
root@freeville [~]# whereis aspell
aspell: /usr/bin/aspell /usr/lib/aspell /usr/include/aspell /usr/share/aspell
What should I do?
Marc
Here is an update...
The host updated to Aspell .60 and the "Check your Aspell installation" error is gone. However, the spell check icon does not appear in my tool bar and there is not a check mark in the icons deletion box.
Any ideas?
Marc
I have got the same problem. I have read something that Aspell do not read properly Unicode chars. I have Moodle 1.6 and any idea how to turn this icon on .
Lukasz