php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33095 pspell stops working under increased load
Submitted: 2005-05-21 19:40 UTC Modified: 2005-05-23 22:09 UTC
From: mkellogg at wordreference dot com Assigned:
Status: Not a bug Package: Pspell related
PHP Version: 4.3.11 OS: Windows 2003
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
34 - 28 = ?
Subscribe to this entry?

 
 [2005-05-21 19:40 UTC] mkellogg at wordreference dot com
Description:
------------
I have tried this under IIS and Apache on Windows 2003.  The script works fine in testing, but once I put it in production on the server, it stops working within a few minutes.

Using latest version of Aspell 0.50.3


Reproduce code:
---------------
<?php
// my code was longer than this, but this is the jist of it. 
// Original code: http://forum.wordreference.com/wr_spelling/iframe5.txt

pspell_config_create("en");
$pspell_link = pspell_new("en","","","", PSPELL_FAST);

if (!pspell_check($pspell_link, $_GET['word'])) {
$suggestions = pspell_suggest($pspell_link, $_GET['word']);

foreach ($suggestions as $key => $suggestion)	{
echo "$suggestion<br />"; 
						}
						}

?>

Expected result:
----------------
Spelling suggestions. :)


Actual result:
--------------
User: A page that hangs.

Apache's error message:
PHP Warning:  PSPELL couldn't open the dictionary. reason: No word lists can be found for the language "en".  in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\iframe5.php on line 4

Apache often crashes as a result, too.

IIS error message as seen by Firefox users:
PHP has encountered an Access Violation at ...


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-23 09:12 UTC] sniper@php.net
Have you tried it under Linux/anything else bug windows?

 [2005-05-23 15:18 UTC] mkellogg at wordreference dot com
I don't have a Linux server to test it on.  If you want to put my original code on a Linux server, I would be happy to put the exact same load on it.

Even if it works under Linux, it might be good if it works on all platforms.
 [2005-05-23 18:02 UTC] sniper@php.net
Try with this script:

<?php
$pspell_config = pspell_config_create("en");
pspell_config_mode($pspell_config, PSPELL_FAST);
$pspell_link = pspell_new_config($pspell_config);
if (!pspell_check($pspell_link, $_GET['word'])) {
$suggestions = pspell_suggest($pspell_link, $_GET['word']);
foreach ($suggestions as $key => $suggestions)
  echo "$suggestion<br />"; 
?>

(calling pspell_config_create() and not using the value it returns anywhere is not very useful)

 [2005-05-23 18:49 UTC] mkellogg at wordreference dot com
First I had to close the if conditional with a "}".

This script wouldn't even work once, while the old scripts worked in testing, confirming that the "en" dictionary is installed. (I did not try either one in production this time.)

The error I received was the same:
[client xxx.xxx.xxx.xxx] PHP Warning:  PSPELL couldn't open the dictionary. reason: No word lists can be found for the language "en".  in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\iframe5t2.php on line 4
[client xxx.xxx.xxx.xxx] PHP Warning:  0 is not a PSPELL result index in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\iframe5t2.php on line 5
[client xxx.xxx.xxx.xxx] PHP Warning:  0 is not a PSPELL result index in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\iframe5t2.php on line 6

The end user sees a blank page.

Thanks.
PS.  Wed. night I leave for a two week vacation, so I will be unable to help during that time period.
 [2005-05-23 21:51 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Works fine here. You just haven't installed aspell + dictionaries correctly.

 [2005-05-23 22:09 UTC] mkellogg at wordreference dot com
I repeat that Aspell is installed.  
Aspell works on the command line just fine.  
pspell even works some of the time!  But not all of the time.  If Aspell were installed incorrectly, then  it would not work at all right?  But it does.

But I will look to see if PHP needs Aspell to be installed differently...

Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 20:01:31 2024 UTC