Posted on 2011-05-09
Last Modified: 2012-05-11

I'm having a difficult time running this script to remove any words not recognized.

The error I get is: Fatal error: call to undefined function pspell_new() in /home/directory/pspell.php on line 2.

Thank you

$pspell_link = pspell_new("en");
foreach ($lines as $line)
        $words=preg_split('/[ \s]+/',trim($line));
        foreach ($words as $word)
                        echo $word,' ';
        echo "\n";
Question by:faithless1
    LVL 107

    Expert Comment

    by:Ray Paseur
    Fatal error: call to undefined function -- that is pretty unambiguous.  Maybe you want new Pspell() instead?  You do not have a function named pspell in the script and that is why there is an error message.
    LVL 15

    Expert Comment

    by:Jagadishwor Dulal
    You are calling a function which is not defined. If you have created function in a separate page then include it to this current page to call the function pspell_new("en")
    LVL 12

    Expert Comment

    I read the following on
    As of php 5.3. Pspell is no longer supported/bundled. Instead you can use the enchant which is bundled by default in 5.3.

    Perhaps pspell is no longer supported by your hosting company?
    LVL 107

    Accepted Solution

    @zappafan2k2: I read that, too, but it is a user-contributed note and not part of the PHP documentation.  And I don't believe it.  My PHP version is 5.3.6 and the configure command '--with-pspell' worked perfectly.  I added a fact-check note to the PHP man page, but did not bother to add anything about enchant which is missing from my PHP installation (and I bet from a lot of others, too).  The dearth of user-contributed notes is a clue about the marginal nature of enchant.

    It is possible that the hosting company did not include PSpell support, but it sounds like it would make more sense to include it in the build.

    As you can see from those pages, it ain't that hard!  @faithless1: As your hosting provider to install PSpell support and try it again.

    Author Comment

    I wanted to clarify... I'm trying to run this script through the gnome terminal in Ubuntu... I'm not using a server for this and this is not a hosted version. Thank you

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
    Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now