|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-08-14 03:00 UTC] daniel at stonek dot com
Description:
------------
1) Php 5.1.6 (last from Centos 5 repositories
2)
pspell_suggest drives me to error 500 in few cases.
3)
'./configure' '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu'
'--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-
prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--
datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--
libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--
mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-
file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--
with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-
rpath' '--without-pear' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '-
-with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--
without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-
dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr'
'--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--
enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--
enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '-
-enable-yp' '--enable-wddx' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-
unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-
calendar' '--enable-dbx' '--enable-dio' '--with-mime-
magic=/usr/share/file/magic.mime' '--without-sqlite' '--with-libxml-dir=/usr' '-
-with-xml' '--with-system-tzdata' '--enable-force-cgi-redirect' '--enable-pcntl'
'--with-imap=shared' '--with-imap-ssl' '--enable-mbstring=shared' '--enable-
mbstr-enc-trans' '--enable-mbregex' '--with-ncurses=shared' '--with-gd=shared'
'--enable-bcmath=shared' '--enable-dba=shared' '--with-db4=/usr' '--with-
xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' '--with-
mysql=shared,/usr' '--with-mysqli=shared,/usr/lib64/mysql/mysql_config' '--
enable-dom=shared' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-
pgsql=shared' '--with-snmp=shared,/usr' '--enable-soap=shared' '--with-
xsl=shared,/usr' '--enable-xmlreader=shared' '--enable-xmlwriter=shared' '--
enable-fastcgi' '--enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--
with-pdo-mysql=shared,/usr/lib64/mysql/mysql_config' '--with-pdo-
pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr' '--enable-dbase=shared'
4)
PSpell Support enabled
5)
General php.ini
Safe Mode Off
Max Exec Time 45
Max Input Time 60
Memory Limit 64M
Register Globals Off
Post Max Size 15M
cgi.fix_pathinfo=0
extension=imagick.so
mysql.allow_persistent = off
6) PHP configured with --disable-debug
Test script:
---------------
$word = '1veja';
$pspell_config = pspell_config_create("es");
pspell_config_ignore($pspell_config, 4);
pspell_config_personal($pspell_config, "/path-to/dictionary.pws");
//dictionary.pws contains regular spanish words
$dictionary_link = pspell_new_config($pspell_config);
if (!pspell_check($dictionary_link, $word)) {
$suggestions = pspell_suggest($dictionary_link, $word);
}
Some $word examples:
1veja -> error
2veja -> error
2vejastro -> no error
5veja -> no error
12veja -> no error
veja1 -> error
veja5 -> no error
bo0las -> error
bo0las -> error
bo5las -> error
bo15las -> no error
5bolas -> error
Expected result:
----------------
If $word='5veja' pspell_suggest array is ('vieja', 'oveja', 'verja', 'ceja',
'viejo', 'veía', 'deja', 'reaja', 'teja', 'vela', 'vena', 'vera', 'veta') using my
dictionary.
I expect from '0veja', '1veja', '2veja' .... same result as '5veja'
Actual result:
--------------
Error 500. Internal server error.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 17:00:01 2025 UTC |
Hi! To be sure it is a pspell_suggest problem, I added pair of mail('me',....) just before and after this function. First mail is always received but the second one isn't in those error 500 cases. Web browsers: Internal Server Error httpd error log (my test): [Sun Aug 14 09:47:19 2011] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error. [Sun Aug 14 09:47:19 2011] [error] [client XXX.50.78.197] Premature end of script headers: file.php I think I found something like a pattern (there are inclusions and exclusions) SOME plurals and an intercalated single number in 5 letters words. '5bolas', 'bo5las' and any string with '5' in any position of 'bolas' get the error. '5vejas', '0vejas', 'vej0as', 'monos6', '3cocos', '0pitos', 'bocas6' Without the number, almost all these samples belong to my dictionary but 'vejas' Strangely, 'vejas' and 'veja' does not get any suggestion while '12vejas' shows 10 good ones like 'ovejas' (sheeps). Some exceptions: 'pinos', 'nubes'. Anywhere you add a number you get good suggestions Thank you.