how can I install pspell in php5/ubuntu?
Asked Answered
F

4

17

I am trying to install pspell for PHP 5 in Ubuntu. I have installed the aspell library which is required to run pspell as shown here

I am not sure if there are any settings I need to change, etc.

When I try to execute the below mentioned line of code

$pspell_link = pspell_new("en");

I get an error

Fatal error: Call to undefined function pspell_new()

Any idea on what could be wrong ?

Any help greatly appreciated.

Frutescent answered 24/12, 2009 at 10:41 Comment(2)
Should this be on Server fault?Gallagher
Definitely not Server Fault, since I don't think it deals with "networking, servers, or maintaining other people's PCs." It might be answered on Super User, but I think the best fit is here on SO.Ardrey
S
38

just do

sudo apt-get install libpspell-dev 
sudo apt-get install php5-pspell
sudo apt-get install aspell-en

then restart your apache2 server with the following command

sudo service apache2 restart 

it will be added automatically to your php.ini

you can try this example

Socialistic answered 25/12, 2009 at 10:2 Comment(4)
You may need to replace "services" with just "service" as I did.Indisposition
For PHP7, change to php7-pspellDressler
@KohjahBreese on v16.04 this covers php7 as well: apt install php-pspell -> The following NEW packages will be installed: php-pspell php7.0-pspellTyrolienne
I have PHP 5.6 and I got E: Package 'php5-pspell' has no installation candidate and then I run sudo apt-get install php5.6-pspell command and it workedBallottement
S
1

For those using PHP 7.2 / Ubuntu 18.10, here is what I did to get PSPELL working:

sudo apt-get install php5-pspell
sudo apt-get install php-pspell
sudo apt-get install aspell-en
sudo apt-get install aspell-fr
sudo apt-get install aspell-de
sudo apt-get install aspell-es
sudo service apache2 restart 

I use multiple languages, so included some of them in the example above. I believe EN is included by default.

Silsby answered 17/3, 2019 at 1:43 Comment(0)
C
0

"I have installed the aspell library which is required to run pspell as shown here"

  • that's if you compile your own PHP - did you recompile with pspell?

Note that this package just provides the API and data, you are getting an error becuase your PHP doesn't know how to interface with it.

If you're not into building your own code, the PHP extension is available as a package:

(NB this is JUST the PHP side of the service)

http://packages.ubuntu.com/source/dapper/php-pspell

C.

Cassandra answered 24/12, 2009 at 12:24 Comment(0)
S
0

Have you configured php.ini to load the extension?

Sternpost answered 24/12, 2009 at 17:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.