[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1443
  • Last Modified:

Pspell related: !!PHP Warning: PSPELL couldn't open the dictionary. reason: No word lists can be found for the language "en".

Hi Xperts,


Platform Details

 PHP: PHP-4.4.2 (Downloaded zip file from us2.php.net)
 OS:Win2k
 WebServer: IIS5

 Also installed these..downloaded from
     aspell.net/win32(C:/Aspell)

 Aspell-0-50-3-3-Setup.exe
 Aspell-en-0.50-2-3.exe

 my phpinfo() shows

           pspell
 PSpell Support  enabled

 When I try to run PHP script contaning below code(partial)

 $path_to_personal_dictionary = dirname(__FILE__) .
 "/personal_dictionary/MPWordS.txt";

 //If pspell doesn't exist, then include the pspell wrapper for
     >     aspell.
 if(!function_exists('pspell_suggest'))
 {
 // Set the path to aspell if you need to use it.
 define('ASPELL_BIN','/usr/bin/aspell');
 require_once ("pspell_comp.php");
 }

 // Create and configure a link to the pspell module.

 $pspell_config = pspell_config_create("en");
 pspell_config_mode($pspell_config, PSPELL_FAST);

 if($usePersonalDict)
 {
 // Allows the use of a custom dictionary (Thanks to Dylan
          Thurston for
 this addition).
 pspell_config_personal($pspell_config,
          $path_to_personal_dictionary);
 }

 $pspell_link = pspell_new_config($pspell_config); //Here
     comes the
 error...

 Getting below error..

 !!PHP Warning: PSPELL couldn't open the dictionary. reason: No
     >     word lists
 can be found for the language "en". in
 c:inetpubwwwrootspell_checkerspell_checker.php on line 76


 Pls suggest the possible fix here..
0
Umesh
Asked:
Umesh
  • 2
1 Solution
 
VIkasumitCommented:
Hi,

I am not sure of the error but I found this

 if(!function_exists('pspell_suggest'))
 {
 // Set the path to aspell if you need to use it.
 define('ASPELL_BIN','/usr/bin/aspell');

you define the path of aspell in unix style and you are using windows server so this path is invalid.  :o)
use C:\\ some thing as your path

and check that there exist an "en" folder somewhere in your aspell folder installation or not.

hope that sort your problem..

VIkasumit
0
 
UmeshAuthor Commented:
Thanks for the reply.. I have checked this option yesterday & found same results..

//If pspell doesn't exist, then include the pspell wrapper for aspell.
if(!function_exists('pspell_suggest'))
{
      // Set the path to aspell if you need to use it.
      define('ASPELL_BIN','C:/Aspell/bin'); // also this one define('ASPELL_BIN','C:\\Aspell\\bin');
      require_once ("pspell_comp.php");
}

anything else..?
0
 
UmeshAuthor Commented:
This aspell+pspell module works properly when php installed as module..earlier it was CGI...so had to run php as module..
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now