Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Page 1 of 2 12 LastLast
Results 1 to 15 of 21

This is a discussion on pspell not working from URL in the Shared & Semi-Dedicated forum
Hi I am having a strange problem, and dont know the reason. I hope somebody could help me here. I have a very small php ...

  1. #1
    JPC Member
    Join Date
    Jul 2004
    Posts
    9

    Question pspell not working from URL

    Hi
    I am having a strange problem, and dont know the reason. I hope somebody could help me here.

    I have a very small php script to test pspell. The script works fine when run on the command line and gives me expected output. But when I try to run the script from URL I dont get any response for a long time then get error page "The page cannot be displayed". I am suspecting something is missing in the configuration to make webserver aware of pspell module. Any clue will be greatly appreciated. Thanks


    Following is the script in question. The same script can be found at http://www.pakclassified.com/mt/pc_speller.php

    Code:
    <?php
        $suggestions=null;
        $word  = "tesst";
     
        $pspell_config = pspell_config_create("en","american");
        pspell_config_mode($pspell_config, PSPELL_FAST); 
        $pspell_link = pspell_new_config($pspell_config);
    
        if (pspell_check ($pspell_link, $word)) {
        } else {
            $suggestions = pspell_suggest ($pspell_link, $word);
        }
        print_r( $suggestions);
    ?>

  2. #2
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    I had the same problem about a year ago. At the time pspell wasn't even on the server. I opened a support ticket and they installed it, but I had the exact problem you described. Support said they would continue lokkinging into the problem, but I ran out of time for developing the script I was working on and kind of forgot about the whole thing. The ticket I had opened was eventually closed but never resolved.

    Sorry that I don't have an answer for you.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  3. #3
    Just Walking...
    Join Date
    Oct 2002
    Location
    England
    Posts
    436
    *Edit* Nevermind, haven't had my tea this morning ... daft suggestion. *Edit*
    Last edited by G.Bloke; 07-30-2004 at 02:57 AM.

  4. #4
    Jag Veteran
    Join Date
    Sep 2002
    Posts
    650
    Here what I would suggest you to do:

    1. Add the following line at the begin of your script:
    Code:
    error_reporting(E_ALL);
    2. Try to run the script from command line (i.e., SSH into your account and run the following command
    Code:
    php www/mt/pc_speller.php
    Let us know how it goes.

  5. #5
    JPC Member
    Join Date
    Jul 2004
    Posts
    9
    Hi
    Thanks for the suggestion, I added the

    error_reporting(E_ALL);

    but it makes no difference. The script still works fine from SSH but fails to load through URL.

  6. #6
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,306
    Now look at your error log...

  7. #7
    JPC Member
    Join Date
    Jul 2004
    Posts
    9
    Hi
    Thanks for the suggestion, But I am not sure which error log you are talking about. There is no error. It works fine from SSH account.

    It just does not work from URL. There is no error report for the domain.

    Thanks a lot

  8. #8
    Jag Veteran
    Join Date
    Sep 2002
    Posts
    650
    Log into your control panel and look at the right where Statistics section is. There is a link 'Error Log', click it just after you try to access your script via Web.

  9. #9
    JPC Member
    Join Date
    Jul 2004
    Posts
    9
    Hi Gerilya
    The error log does not show any error. In fact if I launch the script through URL it never loads. The status bar of IE shows page load in progress but never loads the page and eventually times out.

    The culprit seems to be the following line
    Code:
    $pspell_link = pspell_new_config($pspell_config);
    Once I remove this line the page gets loaded (with lot of errors). The problem seem to be unability of webserver to initialize the pspell object. Becuase the same script works well on the command line (SSH).

    Please try to launch following URL and you will see what I mean.

    http://www.pakclassified.com/mt/pc_speller.php

    If you get the output in you IE it will be a strange result for me becuase it does not work on my IE even though I have also tried changing different setting for browser.


    Thanks a lot of your efforts.

  10. #10
    Jag Veteran
    Join Date
    Sep 2002
    Posts
    650
    I think some config changes are taking place on your server because I tried that link a number of times and got different results.

    1 time it was successful:
    Code:
    [gerilya@texas ~]# curl -i http://www.pakclassified.com/mt/pc_speller.php
    HTTP/1.1 200 OK
    Date: Sun, 01 Aug 2004 21:36:35 GMT
    Server: Apache/1.3.31 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwli
    mited/1.4 PHP/4.3.8 FrontPage/5.0.2.2634a mod_ssl/2.8.19 OpenSSL/0.9.6b
    X-Powered-By: PHP/4.3.8
    Transfer-Encoding: chunked
    Content-Type: text/html
    
    Array
    (
        [0] => test
        [1] => tset
        [2] => tests
        [3] => testy
        [4] => Tessy
        [5] => Tess
        [6] => toast
        [7] => Tessa
        [8] => Tessi
        [9] => deist
        [10] => teats
        [11] => taste
        [12] => tasty
        [13] => tersest
        [14] => DST
        [15] => yeast
        [16] => teas
        [17] => teased
        [18] => teat
        [19] => tester
        [20] => toasty
        [21] => East
        [22] => east
        [23] => rest
        [24] => yest
    )
    Then it didn't even make to HTTP header few times.
    And here is the most recent result:
    Code:
    [gerilya@texas ~]# curl -i  http://www.pakclassified.com/mt/pc_speller.php
    HTTP/1.1 200 OK
    Date: Mon, 02 Aug 2004 17:18:26 GMT
    Server: Apache/1.3.31 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.8 FrontPage/5.0.2.2634a mod_ssl/2.8.19 OpenSSL/0.9.6b
    X-Powered-By: PHP/4.3.8
    Transfer-Encoding: chunked
    Content-Type: text/html
    
    <br />
    <b>Warning</b>:  PSPELL couldn't open the dictionary. reason: I'm sorry I can't find any suitable word lists for the language-tag "en".  in <b>/home/jpakclas/public_html/mt/pc_speller.php</b> on line <b>8</b><br />
    <br />
    <b>Warning</b>:  0 is not a PSPELL result index in <b>/home/jpakclas/public_html/mt/pc_speller.php</b> on line <b>10</b><br />
    <br />
    <b>Warning</b>:  0 is not a PSPELL result index in <b>/home/jpakclas/public_html/mt/pc_speller.php</b> on line <b>12</b><br />

  11. #11
    JPC Member
    Join Date
    Jul 2004
    Posts
    9
    Hi gerilya
    I think Tech Support at JPC have messed up with pspell comilation with PHP.
    Now the situation is that the scrtip works perfectly fine from command line but when lauched from URL it does not recognize any of the pspell functions. I have no idea where is the missing link.

    Following is the curl cut/paste. Any clue will be a great help

    Thanks

    $ curl -i http://www.pakclassified.com/mt/pc_speller.php
    HTTP/1.1 200 OK
    Date: Tue, 03 Aug 2004 23:58:54 GMT
    Server: Apache/1.3.31 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.8 FrontPage/5.0.2.2634a mod_ssl/2.8.19 OpenSSL/0.9.6b
    X-Powered-By: PHP/4.3.8
    Transfer-Encoding: chunked
    Content-Type: text/html

    <br />
    <b>Fatal error</b>: Call to undefined function: pspell_config_create() in <b>/home/jpakclas/public_html/mt/pc_speller.php</b> on line <b>5</b><br />

  12. #12
    the Windlord Gwaihir's Avatar
    Join Date
    Jun 2002
    Posts
    2,562
    Not finding the right included file(s)?

    Might that even explain why it can work from commandline, as you are most likely in a different folder then?
    Regards,

    Wim Heemskerk
    ---
    Visit MeCCG.net - Cardgaming in J.R.R. Tolkien's Middle-earth
    And Gwaihir.net - The Middle-earth CCG store

  13. #13
    Jag Veteran
    Join Date
    Sep 2002
    Posts
    650
    Well, if a script works from command line and doesn't work from URL, I would ask support to take care of it
    But you can help them a bit by making sure that PHP compiled as Apache module has the same options as PHP compiled as binary file:
    Create the following file (let's call it info.php)
    PHP Code:
    <?phpinfo();?>
    then run it from command line:
    Code:
    php info.php > info.html
    then compare the output of
    http://yoursite/info.php
    and
    http://yoursite/info.html

    The chances are, you answer will be there.

  14. #14
    JPC Member
    Join Date
    Jul 2004
    Posts
    9
    Hi gerilya
    Thanks for the post.

    It is getting frustrating now. The tech support is just recycling the couple of problems over and over. Now the pspell is not working with neither URL or SSH.

    I dont know how to determine the difference between apache installation and binary installation. The suggested urls are as follows

    http://www.pakclassified.com/mt/pc_info.php

    and

    http://www.pakclassified.com/mt/pc_info.php



    You can see the error message from following URL

    http://www.pakclassified.com/mt/pc_speller.php


    The pspell does not seem to locate dictionary files.

    Any help will be great

    Thanks

    Shahid

  15. #15
    JPC Member
    Join Date
    Jul 2004
    Posts
    9
    Sorry, the second URL on my previous posting was meant to be

    http://www.pakclassified.com/mt/pc_info.html

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •