aspell/pspell installation xampp - php

i'm trying to build a web application using php in which it will determine if the entered word is valid or exists in the english library. but the instructions is unclear, and some of the questions I've seen here on stackoverflow is a bit old and i think it might be obsolete. could you guys please provide a step by step installation process for this matter. and if you ever have a better suggestion on how should i build this app thanks in advance.
any help would be appreciated.
btw my laptop has a xampp PHP: 5.4.16 version
32bit win7
thanks.

Enabling Pspell for PHP in XAMPP on Windows
PHP provides spell checking functionality through the Pspell extension. Despite its name, the extension uses the Aspell library, as development of the Pspell library ceased in 2001. Being part of the GNU Project, Aspell is part of most Linux distributions but is not supplied with Windows. This page explains how to install Aspell and enable the Pspell extension in XAMPP on Windows.
Downloading and installing Aspell
A Windows port of Aspell is available on the Aspell website. The Windows port has not been updated in several years, but still functions on recent version of Windows.
First, download and run the ‘full installer’, which installs the library itself. Then download and install at least one language’s dictionary from the same page.
Copying the library DLL
While the PHP manual states that the Aspell DLL must be available within the Windows system path, under XAMPP it must be available in Apache’s ‘bin’ directory. Find the file aspell-15.dll, which by default is installed at C:\Program Files\Aspell\bin\aspell-15.dll, and copy it to the Apache ‘bin’ directory, which by default resides at C:\xampp\apache\bin.
Enabling the Pspell extension
To enable the Pspell extension, first find the php.ini file, which, depending on the XAMPP version, is by default located at either C:\xampp\apache\bin\php.ini or C:\xampp\php\php.ini. Open it in a text editor, find the following line (which should be in a block relating to extensions about halfway down the file), and remove the semicolon:
;extension=php_pspell.dll
If the line above wasn’t present in the file, add the following line:
extension=php_pspell.dll
Finally, enable the extension by restarting Apache using the XAMPP control panel.

Related

intl extension php_intl.dll with wamp

I want to use Moodle, but I get an error during the installation process:
php_extension->intl->should be installed and enabled for best results.
Intl extension is used to improve internationalization support, such as locale aware sorting.
When I click on the link, I get the error message above: http://docs.moodle.org/24/en/admin/environment/php_extension/intl
I followed that link, but I still get the same error. If anyone has any ideas, please help me out.
I had the same problem a few days ago.
You have to copy all the files (all files starts with icu*):
icudt.dll
icudt46.dll
icuin.dll
icuin46.dll
icuio.dll
icuio46.dll
icule.dll
icule46.dll
iculx.dll
iculx46.dll
icutest.dll
icutest46.dll
icutu.dll
icutu46.dll
icuuc.dll
icuuc46.dll
From:
<wamp_installation_path>/bin/php/php5.4.3/
To:
<wamp_installation_path>/bin/apache/apache2.2.22/bin/
And you also need to enable intl in php.ini file (uncomment this line):
;extension=php_intl.dll
And restart the server. It should works fine.
Of course, you need to replace the folder names with your own.
Recently, newer versions of PHP 5.5 releases have php_intl.dll also linking (loading) MSVCP110.dll, in addition to the more common MSVCR110.dll (both are C/C++ runtime DLLs that provide common functions).
Before, you could just include file MSVCR110.dll somewhere in a directory of the PATH instead of installing the full set of VC++ 2012 Redistributable DLLs, and Apache + PHP + PHP extensions like php_intl.dll would all load.
If PHP is giving you this error:
PHP Startup: Unable to load dynamic library C:/wamp/php/ext/php_intl.dll – The specified module could not be found.
There are two things you have to do:
Instead of copying the various icu*.dll files from PHP's folder into Apache's bin folder, just include the PHP directory into the system's PATH variable.
Install the full Microsoft VC++ 2012 Runtime Redistributable package. Make sure to get the 32 bit version for 32 bit PHP builds.
See more about this issue here - Unable to load or find PHP extension php_intl.dll
Copy your icu* files to <wamp_installation_path>/bin/apache/apachexxxxx/bin/
This worked for me.
I tried many options (including the ones suggested by Moodle) to no avail; the VC++ redistributable helped me.
Please note that you may have to install x86 version even when you may be having a 64 bit OS.
https://www.microsoft.com/en-us/download/details.aspx?id=48145

Connect to RabbitMQ from PHP - Windows

I have RabbitMQ running on one of our servers and am trying to connect to it via PHP. I am developing on a Windows7 machine and my first line of code reads:
$cnn = new AMQPConnection();
It gives me the error:
Fatal error: Class 'AMQPConnection' not found in
I know that it is something that I need to install but what is it ? I am new to PHP so a little help would be nice.
Ps: I can connect to the RMQ server via the RabbitMQ admin web interface.
Thank you
Jack
Installation guide for php_amqp 1.4.0 (Stable version):
Download proper package for your php version from https://pecl.php.net/package/amqp/1.4.0/windows
Unpack php_amqp.dll to X:/php/ext/ directory
Unpack rabbitmq.1.dll to X:/Windows/system (not system32) directory
Modify php.ini file and add "extension=php_amqp.dll" line at the end of extensions list
Verify module installation by executing command "X:/php/php.exe -m" in command line
Restart webserver
I am developing on a Windows7 machine
You may be out of luck using that specific code. That class is from the PECL aqmp extension. Inside the installation instructions, it states:
Note to Windows users: This extension does not currently support Windows since the librabbitmq library does not yet support Windows.
You will want to use another library to speak to your message queue instead.
The rabbitmq-c library supports windows now, and the php_amqp pecl extension builds on windows as well. The documentation just hasn't been updated, nor are there any official binary builds in the wild. However, I managed to get them to build and have some 32 bit dll's available for download here:
http://www.nathanjohnson.info/?p=77
# AMQP installation php.net:
Note to Windows users: This extension does not currently support Windows since the librabbitmq library does not yet support Windows.
But here at RabbitMQ website is a windows installer...
Apparently this php.net page is outdated
To install do like this:
Download the correct package for your php from this official PECL amqp 1.4.0 page
unzip
add amqp.dll to your php ext folder
add rabbitmq.1.dll to your windows system 32 folder.
This according to the post on the blog I found here i think it is from the same #NathanJohnson who posted also here.
How I got it working:
My System Config: Win 7 Pro, (x64) XAMPP running PHP 5.6(x86)
Follow instruction from here to install RabbitMQ:
https://www.rabbitmq.com/install-windows.html
Now download compatible extension from here
https://pecl.php.net/package/amqp/1.4.0/windows
in my case it is "5.6 Thread Safe (TS) x86"
Now from zip file (php_amqp-1.4.0-5.6-ts-vc11-x86.zip) downloaded copy dll "php_amqp.dll" to your php extension folder in my case it is "xampp/php/ext" and copy dll "rabbitmq.1.dll" to "Windows\system" directory.
now register your php_amqp dll in php.ini file as
"extension=php_amqp.dll"
now restart apache.
Done. Now you should not get AMQPConnection not found exception.

Compiling a PHP extension as non-thread-safe

I am trying to compile the imagemagick (imagick) extension to use in a non-thread-safe environment on windows.
I am using PHP 5.3.10 and have set up Visual C++ express as my compiling environment.
The problem is that I am using a non-thread-safe version of PHP as a FCGI module in Apache 2.2.
Thus, my PHP is supplied with a php5.lib and not a php5ts.lib. I believe this is the reason why I am getting these errors:
imagick.obj : error LNK2019: unresolved external symbol __imp__tsrm_mutex_alloc referenced in function _zm_startup_imagick
I have only ever built and compiled things on linux, so am not too sure how to do this on a windows environment.
How can I compile the extension so that it is non-thread-safe?
I downloaded the threadsafe binary of PHP 5.3.10 to get a copy of php5ts.lib. I was then able to compile the extension.
I am guessing that setting the ZTS preprocessor directive to either 1 or 0 would cause the extension to compile as either threadsafe or non-thread-safe. (Not too sure about this, so if someone could let me know if this is correct or not, it would be much appreciated. :) )
I then set up a virtual machine running Windows 7 and installed the latest version of WAMP. Reason being that it used a threadsafe version of PHP.
I placed the dll in the ext folder in the PHP installation and enabled it in php.ini. However, even after trying both the ts and nts version in WAMP, I would get:
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.3.10/ext/imagick.dll' - The specified module could not be found.
in Unknown on line 0
But the thing is that c:/wamp/bin/php/php5.3.10/ext/imagick.dll' does exist, and yes I have checked this a lot of times.
I then downgraded ImageMagick to 6.6.2-10-Q16, but still see the same problem.
The same issue occurs on my dev machine running a nts version of PHP 5.3.10 on Apache 2.2 (all installed manually).
Looks like I could be wrong regarding the ZTS preprocessor. If I set ZTS=0 and compile, using dependency walker on the compiled dll still shows that it requires php5ts.dll which is only present on threadsafe versions of PHP.
I did more tinkering with dependency walker and found that I had to statistically link to msvc100d.dll. I then removed ZTS in the preprocessor definition and was able to compile using php5.lib instead of php5ts.dll. I think this should get me a non-ts dll.
However, when loading the extension, I am still getting:
PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) 'imagick.dll' in Unknown on line 0
And errors from dependency walker:
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
Installed visual c++ express 2008 and compiled using platform toolkit v90, but still facing the same issues.
Any tips appreciated :)
Solution Found! See my answer.
Got it! I hope this can help those compiling php extensions on windows in the future. What I have done is based on: https://wiki.php.net/internals/windows/stepbystepbuild
Note: I read an answer on this site that said compiling PHP extensions by itself on windows is unsupported. Based on my experiments yesterday, it seems to be a lot of work as well, so I am using the PHP build process.
The best way is to use the PHP build process.
Install Visual C++ Express 2008 (any version will do, but express is free) and Windows SDK 6.1 (note that we want the 6.1 version not anything older or newer).
Install the SVN client tools if you haven't done so and restart for your PATH variable to take effect.
Get the PHP SDK binary tools and extract it to C:\php-sdk.
Start the CMD Shell under Microsoft Windows SDK v6.1 in your start menu and run cd C:\php-sdk.
Run setenv /x86 /xp /release this creates a 32-bit release. You can use /x64 to build a 64-bit release (I have not tried this).
run bin\phpsdk_setvars.bat
run bin\phpsdk_buildtree.bat php53dev
Download the PHP source code and extract it to C:\php-sdk\php53dev\vc9\x86 so that you end up with C:\php-sdk\php53dev\vc9\x86\php5.3-xyz
Download the latest deps and extract everything to C:\php-sdk\php53dev\vc9\x86. You may be prompted to overwrite any existing folders, so press yes.
run cd C:\php-sdk\php53dev\vc9\x86
Check out the latest version of your extension from the svn repository: svn co http://svn.php.net/repository/pecl/imagick/trunk pecl/imagick I am checking out imagick here.
Install any dependencies. In my case, I need to install ImageMagick, so I downloaded the latest recommended windows binary. You will need to restart after installation to update your PATH variable, but you can do this after you have compiled. Make sure you install the C/C++ headers and includes as well.
Copy the contents of the includes directory from the ImageMagick install directory to C:\php-sdk\php53dev\vc9\x86\deps\include.
Copy the contents of the lib directory from the ImageMagick install directory to C:\php-sdk\php53dev\vc9\x86\deps\lib
Now, let's build: run cd C:\php-sdk\php53dev\vc9\x86\php5.3-xyz then buildconf then configure --help. Look at the help properly. It will show you all config flags and any avaliable extensions to enabled. In my case, since I added imagick, I had an option called --with-imagick
Run config: configure --enable-cli --with-imagick=shared --disable-zts If you want to build a non-thread-safe binary use --disable-zts, otherwise remove that configuration flag. I am not sure why, but sometimes extensions use the --with-myextension flag and sometimes --enable-myextension, so check configure --help for the flag to use. If you add =shared after the extension flag, it will be compiled as a separate DLL, which si what we want.
Compile: run nmake then nmake snap.
Done :) Check C:\php-sdk\php53dev\vc9\x86\php-5.3.10\Release (non-thread-safe) or C:\php-sdk\php53dev\vc9\x86\php-5.3.10\Release_TS (thread-safe). Your compiled binaries should be in there. The compiled extensions (pecl), should be in a ZIP file similiar to pecl-5.3.10-nts-Win32-VC9-x86.zip. Open this file and extract the extensio DLL to your ext folder in your PHP installation.
Enable the PHP extension and restart your webserver. Run phpinfo() and check that the extension is enabled.
If the extension does not work properly, make sure you reboot to update your PATH variable. In my case, I need to have the imagemagick install directory in my PATH variable.
???
Profit!
Is there a reason you need to compile? Why not download? It's usually much simpler/quicker on Windows.
VC6: http://www.sk89q.com/2010/03/vc6-windows-binaries-for-imagick-2-3-0/
VC9: http://valokuva.org/builds/

install crypt blowfish on xampp on windows

I have a module for a zencart which requires Blowfish Encryption on my server. At the moment I'm just testing on my localhost which is xampp on a windows machine.
Ive googled and looked on stackoverflow but can't find any instructions (at least that I understand) on how to do it.
Is it even possible?
thanks :)
Actually, if you use the latest XAMPP, mcrypt is installed by default. According to the PHP website:
PHP 5.3 Windows binaries uses the static version of the MCrypt
library, no DLL are needed.
If you use PHP 5.2.x:
Download the Win32 binaries from http://windows.php.net/download/. Ensure which PHP version you have, as you can see there are different ones.
Copy php_mcrypt.dll to PHP's ext directory, and libmcrypt.dll to Apache's bin directory.
Add the following line to the extensions section in php.ini: extension=php_mcrypt.dll.
Finally, restart Apache.
It should work okay. :)

step-by-step instructions for installing IMAGEMAGICK on WAMP?

There don't seem to be any concise tutorials/walk throughs for installing ImageMagick on WAMP for use with PHP.
I've tried dozens of combinations of their binary releases with different php extension dll files. I can get imagemagick working fine from the command line, and I can get it to show as ticked in the WAMP extensions, but can't actually use it.
Has anyone come across a good guide for installing this ball ache piece of software?
I've followed http://www.knowledge-transfers.com/it/installing-imagemagick-on-windows-setup-imagick-on-php with no luck...
Update: this is what happens when I follow the steps in PHP farmer's answer on windows7. My php.ini is setup as follows:
extension_dir = "c:/wamp/bin/php/php5.3.0/ext/"
extension=php_imagick.dll
I reboot and get these two errors in this order
and here is the dll file where it should be:
I know this is old post but I spend my all day to make it work, so here are the steps that helped me:
Download ImageMagick Binary Release - http://www.imagemagick.org/script/download.php
Install in C:\imagemagick, on last step check "Add application directory to your system path"
Download Imagick DLL: PHP5.6.x version from http://www.peewit.fr/imagick/ (I have 5.6+ version installed on my localhost
Copy php_imagick.dll to C:\wamp\bin\php\ext
Download PHP 5.6 Thread Safe (TS) x86 version from http://pecl.php.net/package/imagick/3.1.2/windows
Copy CORE_RL_* files to C:\wamp\bin\apache\bin\
Edit php.ini file in C:\wamp\bin\apache\bin\php.ini, add extension=php_imagick.dll line in extensions section
Copy all files from C:\imagemagick\modules\coders and C:\imagemagick\modules\filters to C:\imagemagick to load ImageMagick supported formats
Go to Control Panel -> System -> Advanced Settings -> Environment Variables -> New System Variable -> MAGICK_HOME = C:\imagemagick
Restart Wamp server and check phpinfo() for imagick plugin
If last step does not work, restart Windows
I have improved fsasvari answer to cater general scenarios and versions. All credits to him.
Install Imagick in WAMP
Open your phpinfo() page
Check the below
PHP version (mine : 5.5.12)
Compiler (mine : MSVC11 (Visual C++ 2012) )
Architecture : (mine : x64)
Thread Safety : enabled
Loaded Configuration File (mine : C:\wamp\bin\apache\apache2.4.9\bin\php.ini)
extension_dir : (mine : c:/wamp/bin/php/php5.5.12/ext/)
Apache Bin (Not in phpinfo() page) : C:\wamp\bin\apache\apache2.4.9\bin\
Get the latest release match to your architecture from here (for me it was ImageMagick-x86_64-pc-windows.exe).
Copy all files from C:\imagemagick\modules\coders and C:\imagemagick\modules\filters to C:\imagemagick to load ImageMagick supported formats
Install in C:\imagemagick, on last step check "Add application directory to your system path"
Download the PECL matching to your architecture
http://pecl.php.net/package/imagick/3.1.2/windows
(for me : 5.5 Thread Safe (TS) x64)
Extract it and copy all the CORE_RL_* files to apache bin folder (mine : C:\wamp\bin\apache\apache2.4.9\bin)
Copy php_imagick.* files to extension dir (mine : c:/wamp/bin/php/php5.5.12/ext/)
Edit php.ini file (mine : C:\wamp\bin\apache\apache2.4.9\bin\php.ini)
add extension=php_imagick.dll line in extensions section
Go to Control Panel -> System -> Advanced Settings -> Environment Variables -> New System Variable -> MAGICK_HOME = C:\imagemagick
Restart Wamp server and check phpinfo() for imagick plugin
If last step does not work, restart Windows (Specially if you have previously installed imagemagick in different folder/version)
For WAMPSERVER 3.1.9 64bit, PHP Version: 7.3.5
I had a lot of trouble with this as well and some things I did wrong was that I doubted ImageMagick would load on my new php version. But you have to believe it will work and don't try with older php versions :)
So this was my approach, remember to follow it with your own settings and versions/folders.
Before you start, make sure you running the php version you want to run. If you installed Wampserver 3, you may click the wamp icon and go to php version and activate the one you want to run.
1
Get latest ImageMagick version for your system here: http://ftp.icm.edu.pl/packages/ImageMagick/binaries/
(I got the ImageMagick-x86_64-pc-windows.exe in the bottom)
2
Install ImageMagick in C:/imagemagick (I put it in lower cases),
You will be asked for some stuff during install, just make sure the path thingy is ticked.
You should also tick the convert thingy if it allows you.
Then after install you can run CMD and type convert -version to see if imagick is installed.
3
Run <?php phpinfo(); ?> And find out these settings:
PHP Version: 7.3.5
System: Windows
Compiler: MSVC15 (Visual C++ 2017) ([VC15])
Architecture: x64 (or maybe you have x86)
Thread Safety: enabled ([TS] else [NTS])
You probably have other settings, but you need to remember yours to download the proper php_imagick.dll
4
Get the php_imagick.dll you want for your php version from here: http://pecl.php.net/package/imagick
I got mine from here: http://pecl.php.net/package/imagick/3.4.4/windows for php 7.3
Remember your info from the phpinfo(), it has to match, else it won't work.
5
After you unzip it, copy the php_imagick.dll and paste it in C:/wamp64/bin/php/php7.3.5/ext/
Then copy all the other .dll files from that folder into C:/wamp64/bin/apache/apache2.4.39/bin/
Yes it's dirty but you will get it working like this.
6
Add extension=php_imagick.dll in C:/wamp64/bin/php/php7.3.5/phpForApache.ini
I added it after the other extensions in the file.
7
Restart all Wamp services.
If you been messing around earlier with installs, you might have to restart the computer due to some weird cache stuff.
8
Check phpinfo() again if imagick shows up and try something like $im = new Imagick();
9
Click the Wamp icon -> php -> extensions, php_imagick should be listed.
Good luck! :)
PHP 5.4 php_imagick.dll is here: http://www.peewit.fr/imagick/ .
I read somewhere that 64bit php doesnt work with php_imagick. That might be the case when you get this error in apache_error.log
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.3/ext/php_imagick.dll' -
%1 is not a valid Win32 application.\r\n in Unknown on line 0
As mentioned above, it was also necessary to add this into httpd.conf (also, i read you cant have spaces/dashes/dots):
SetEnv MAGICK_HOME C:/imagemagick"
If you dont, you might get this error:
"PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.3/ext/php_imagick.dll' -
The specified procedure could not be found. in Unknown on line 0"
In the end, this article might partially help: http://www.elxsy.com/2009/07/installing-imagemagick-on-windows-and-using-with-php-imagick/
This was a headache for me as well, but unfortunately I installed this quite awhile ago. The instructions from that link you posted seem accurate. Have you ran phpinfo(); to see if it is installed in the Apache Environment? It should be listed as MAGICK_HOME.
Make sure "SetEnv MAGICK_HOME C:/imagemagick" is set at the end of your httpd.conf file. Assuming imagemagick is installed in that directory.
Be sure that you have the extension "php_imagick.dll" in your php.ini file as well.
It should work just fine if you have all those set.
On another note, here is a nice little library someone built to make imagick easier to use. https://github.com/francodacosta/phmagick
I hope that helps! Good luck!
I've never used WAMP but I have found that sometimes installing PHP extensions on Windows I need to ensure that any dll's that the extension relies on is in the Windows system PATH. If there is more than the one dll packaged with the imagemagick extension, try adding the directory that the dll's reside in to the Windows system PATH then REBOOT (to ensure that the web server gets a copy of the NEW environment).
I know this is an old question but i guess this will help someone someday out there....
If you are on WAMPP and have PHP 5.4.x installed , go here http://www.peewit.fr/imagick/
and download appropriate files as instructed. It will work.
Please see this answer already on StackOverflow:
Installing ImageMagick extension with php/windows
I answered this question some time ago. This solves the DLL mismatch error.

Categories