2016-09-19 130 views
0

這工作正常,然後我切換到與godaddy cpanel。如果我用我的PHP信息運行測試,它說pspell已啓用。有誰知道一種方法來測試錯誤,甚至可能是一個修復?我該如何測試pspell?

$pspell_config = pspell_config_create("en"); 
pspell_config_personal($pspell_config, "/home/user/public_html/custom.pws"); 
pspell_config_repl($pspell_config, "/home/user/public_html/custom.repl"); 
$pspell_link = pspell_new_config($pspell_config); 

我已經在測試我的代碼與下面的代碼。這讓我知道,如果它工作或沒有,但不會引發錯誤!

$pspell_link = pspell_new("en"); 
$word = "color"; 
if (pspell_check($pspell_link, $word)) { 
echo "Found a fix."; 
} else { 
echo "Sorry we are working on our search engines, please bare with us!"; 
} 

回答

0

我發現這個代碼來做伎倆。

error_reporting(E_ALL); 
@ini_set('display_errors', 1); 

// Call it once first because of a bug in Windows' Aspell. 
pspell_new('en'); 

$test = pspell_new('en'); 

echo ' 
    Testing pspell.... ', pspell_check($test, 'thisisnotawordandyouknowit') ? 'failure' : 'pass', '.<br /> 
    If no error messages were displayed, Aspell is installed and working properly.'; 

這顯示錯誤的pspell而不需要通過php.ini中運行錯誤檢查