PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, March 14, 2022

[FIXED] How to Install pspell with MAMP

 March 14, 2022     aspell, mamp, php, pspell     No comments   

Issue

I use MAMP for local php development and recently needed to use php's pspell functions for a project. I found little help with this specific scenario (short of recompiling php, yuck) so this post explains how I got it done.


Solution

  1. I am not positive but you may need xcode and xcode command line tools installed for this to work. This article might be helpful.

  2. Install MacPorts if you don't have it already

  3. Install aspell and the dictionary of your choice (I used "en"):

    sudo port install aspell aspell-dict-en

  4. note: for the next commands, you need to know the version of php you're running on MAMP. You can find this in the MAMP preferences under the PHP tab. For me it's 5.5.18

    Download the php source for the version of php you are running, unarchive it, and move into the pspell source directory:

    cd ~/Downloads/php-5.5.18/ext/pspell

  5. Now (being sure to use the proper phpize binary for your php version) do:

    /Applications/MAMP/bin/php/php5.5.18/bin/phpize

You should see something like:

 Configuring for:
 PHP Api Version:         20121113
 Zend Module Api No:      20121212
 Zend Extension Api No:   220121212

Next:

./configure --with-php-config=/Applications/MAMP/bin/php/php5.5.18/bin/php-config --with-pspell=/opt/local/

And finally, build the module file:

make
  1. You should now have two files inside the ./modules/ directory: aspell.so and aspell.la - copy them into your php's extensions directory:

    cp ./modules/* /Applications/MAMP/bin/php/php5.5.18/lib/php/extensions/no-debug-non-zts-20121212

  2. Now add the extension to your configuration file in /Applications/MAMP/bin/php/php5.5.18/conf/php.ini

    extension=pspell.so

  3. Finally, restart your MAMP servers and (hopefully) you are good to go!



Answered By - Marty Mulligan
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing