WAMP: Fatal error: Call to undefined function mb_detect_encoding() .... When going to localhost/phpmyadmin - wampserver

I have enabled the mbstring extension by removing the ';':
extension=php_mbstring.dll
I am using the correct php.ini file, checked by using phpinfo().
Extension dir specified in php.ini: extension_dir = "c:/wamp/bin/php/php5.5.12/ext/"
Indeed, when I go there, I find 'php_mbstring.dll'
I've restarted wamp multiple times.
What else can be wrong here?
UPDATE:
seems, my whole wamp installation is fd up with respect to mysql:
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
I do have mysql installed and everything though...module is also enabled etc.

This sounds like you have a rouge php.ini file somewhere and it is loading the wrong one.
There are actually 2 php.ini files in WAMPServer as in most PHP/Apache installations.
One is called \wamp\bin\php\{phpversion}\php.ini and this is only used by the PHP CLI
The other is called \wamp\bin\php\{phpversion}\phpForApache.ini and is used when you are running PHP through Apache.
If you use the wampmanager menus you will edit the one used by Apache/PHP i.e.
wampmanager => PHP -> php.ini
However if you have actually edited the correct php.ini then it is likely you have a rouge version of php.ini somewhere on your system.
Run the phpinfo() link again from the wampmanager homepage and check this parameter which is shown on the first section of the output.
Loaded Configuration File
It should be pointing to \wamp\bin\php\php5.5.12\phpForApache.ini in your case.
If its pointing somewhere else then you probably tried to install PHP and Apache manually before finding WAMPServer and that has left a php.ini file somewhere where Apache is finding it.
Here is the PHP Manual page that defines the search path order used by Apache when looking for a php.ini file. This may help you find and remove any rouge versions of php.ini

Install the gd library also.
check this link http://www.php.net/manual/en/mbstring.installation.php
or
There's a much easier way than recompiling PHP. Just yum install the required mbstring library:
Example: How to install PHP mbstring on CentOS 6.2
yum --enablerepo=remi install php-mbstring
Oh, and don't forget to restart apache afterward.

Related

What is the difference between Imagemagick and Imagick?

What is the difference between Imagemagick and Imagick ?
How do I configure Imagick to work with IIS and php 5.4.14?
Side-note, ImageMagick is not a "PHP Utility" it's a command line utility that existed before PHP. It can be used by many programs, or by people directly, to manipulate images.
Wherea Imagick is a native implementation of the ImageMagick API for PHP -- https://www.php.net/manual/en/intro.imagick.php
I know my answers are trivially different, but when it comes to a lot of things (including programming), the devil is in the details.
I unfortunately have no reference for installing PHP with Imagick/ImageMagick on Windows/IIS But I assume the DLL answer to be the correct one.
Imagick is a php API for Imagemagick.
Find the correct dll, uncomment imagick in php.ini and prepare to spend some time getting it working.
ImageMagick is a PHP utility, a command line tool for image manipulation.
For further details, see this.
Imagick is an API or a class that performs the function same as ImageMagick. It provides numerous functions for image manipulation in PHP. Refer to this for more details.
For imagick, you need ImageMagick as well. Run the following command for the same.
sudo apt-get install imagemagick php5-imagick
The installation is well explained with requirements in PHP manual.
ImageMagick vs Imagick
ImageMagick® is a free and open-source software suite for displaying, converting, and editing raster image and vector image files. It can read and write over 200 image file formats, and can support a wide range of image manipulation operations, such as resizing, cropping, and color correction. -- excerpt from the publisher's site.
ImageMagick may or may not be installed on your system, and was independent of PHP and IIS. While it is a popular image editing program, windows users may be uncomfortable with the absence of a gui; it is mostly run from the command line.
Imagick is the name given by PHP to its extension to ImageMagick. Imagick extends PHP by wrapping or using much of the source code of ImageMagick, but not necessarily the files installed with ImageMagick.
Install Imagick Extension
To enable PHP's Imagick extension for use by a FastCGI module and the PHP CLI, the Imagick PECL package had to be installed. Caveat: instructions herein apply to webservers that use a FastCGI module to call PHP, not a sapi (server) module.
You can start with PHP's windows site, which links to PECL extensions
Use search, or browse >> 'Images', for Imagick, for the link to the Imagick PECL package.
On the PECL package page, links to the windows packages were labelled 'DLL.' Follow the link to the latest package. If you're on the DLL version page, select for your PHP, architecture (x86 32-bit or x64), and thread safety (TS or NTS). FastCGI PHP always needed NTS (non-thread safe). Confirm your requirements with phpinfo.
Download the PECL package and extract it to a folder of your choice, like imagick_php. On windows, it could be 'c:\imagick_php'. Also on windows, imagick_php size could be reduced by 2/3 by moving out or deleting all *.pdb files.
Make imagick_php available to Imagick, by adding the path to imagick_php to a PATH environment variable.
Options:
Set system environment PATH variable; makes imagick_php available to software on your system that refers to the PATH variable, including PHP CLI and FastCGI, but requires a reboot.
If you use IIS much more than PHP's CLI, you can share Imagick only with PHP as FastCGI, and without a reboot.
In Administrative Tools > IIS Manager > Server > FastCGI Settings, find the 'application' that corresponds to the site's > Handler Mappings > PHP-FastCGI > Executable.
Editing that 'application,' add a variable to the Environment Variables collection: Name path, Value c:\imagick_php;%path%.
Copy the php_imagick.dll from imagick_php to PHP's extension_dir. On windows, it could be 'c:\php\ext'
Instruct PHP to load the Imagick extension on start up. In php.ini, add the line extension = imagick, PHP 7.2+ figures out the path and .dll file name.
Confirm PHP loads Imagick without error. Either browse to a phpinfo file and look for an imagick section, or if your PHP's CLI is setup, set path=c:\imagick_ph;%path% followed by php -d extension=imagick -m, and look for imagick in the list of loaded modules.
Confirm Imagick extension functionality:
Copy examples/captcha.php from imagick_php folder to the webserver site. If on Windows, edit captcha.php, update setFont('Tahoma') or another font on your system.
Finally, browse to the url of captcha.php. Expect a captcha image to be displayed.
For the first question, I think you are asking the difference between ImageMagick (not Image magick) and imagick. PHP Manual gives an explanation http://php.net/manual/en/intro.imagick.php.
For the second question, it is too broad to answer. Maybe you could ask one specific aspect or problem you met.

Wampserver sql dump

I know this has been asked many times before. But I am getting a:
The mbstring extension is missing. Please check your PHP configuration.
First off I am using WanmpServer3.0.0 64 on a Win7 64 VM.
-I tried editing the php.ini file to give an absolute path to no avail
-made sure that the extension=phpmbstring.dll is uncommented
Another problem is that i noticed that whenever i load a php page it has fatal errors for my mysql commands.
When I use the wampmanager from the tray to open the php.ini file instead of through windows explorer I get:
Cannot find the C:\wamp64\bin\apache\apache2.4.17\bin\php.ini file. Do you want to create a new file?
So now I'm thinking something has gone drastically wrong and would like to uninstall/reinstall Wamp. I attempt to use the mysql console to save my databases before deleting the wamp directory. However when I run a mysqldump -all-databases > all_database.sql it just drops down to an empty line and nothing happens.
mysql console screenshot
If I browse around in the C:\wamp64 directory i find the "data" directory within \bin\mysql where it seems all of my databases reside but not in readable form.
Is there anyway to save my databases??
BTW: This whole setup was working fine previously, so I'm not sure what caused the crash and burn.
Was able to figure it out.
I opened the php.ini file from the PHP bin folder and copied all of the contents into a new php.ini file to reside in the apache bin file.
Now everything works again.
I'm not sure this is how wampserver is supposed to work or what changed to start the problem but it's pseudo-resolved now.

Install ruby using rbenv's downloaded file

I need to install ruby 2.0.0-p645 and I use rbenv. I tried downloading it by running
rbenv install 2.0.0-p645
But the internet in my college keeps dropping every few minutes, so the transfer was always closing with some 11MB remaining.
To counter that, I saw the url from where rbenv was downloading, and used wget to download the source file that rbenv was downloading. (using wget -c for resuming every time the connection closed).
Now I have the file, is there a way to install that ruby version now?
The file's link on cloudfront that I have on my machine.
Yes. Put the downloaded file into ~/.rbenv/cache. You might need to create the directory first. Then run your rbenv install command again. Here is the link to the documentation for this: https://github.com/rbenv/ruby-build#package-download-caching
To summarize, for future reference:
Download the file using wget
Create a cache folder in ~/.rbenv/ if it doesn't exist already.
Rename the downloaded file to ruby-x.y.z-pabc.tar.gz. Extract it and move it to ~/.rbenv/cache/
Run rbenv install x.y.z-pabc
For me, the following steps work.
1 Download the file using `wget/curl or any other way`
2. Create a `cache` folder in `~/.rbenv/` if it doesn't exist already.
3. Move the downloaded file to `~/.rbenv/cache/`
4. Run `rbenv install x.y.z` (ex. rbenv install 2.7.1`)
The difference from the above answer was,
- do not need to change file name
- do not need to extract
- if file rename to something random (ex. x.y.z-pabc) it show ruby-build: definition not found: x.y.z-pabc
Hope this can help someone.

install of shindig:error in wampserver

I want install shindig in WampServer ,i uncomment always_populate_raw_post_data' to 'On' in php.ini but not work :
Your environment does not have always_populate_raw_post_data enabled which will interfere with Shindig. Please set 'always_populate_raw_post_data' to 'On' in php.ini
You have probably edited the wrong php.ini file, there are 2 ( at least )
If you want to edit the php.ini file that is used by Apache, then use the menus on the wampmanager icon that sits in the system tray, this will edit the correct file.
wampmanager -> PHP -> PHP.INI
If you want to use the PHP CLI (Command Line Interface) then edit the php.ini that lives in the \wamp\bin\php\phpx.y.z\php.ini
They both have different and unique uses.
ADDITIONAL INFO ON CURL
For curl to work you also need to uncomment these extensions :-
extension=php_curl
You also need these dll's libeay32.dll and ssleay32.dll which are in the phpx.y.z folder to be on your path. Avoid advice to copy these files to any \windows\?? folders.
It may be easier to just create a simple windows command file that sets the path up so your php folder is on the path.
This is what I use :-
Filename = phppath.cmd
echo off
PATH=%PATH%;C:\wamp\bin\php\php5.3.22
echo ---------------------------------------------------------------
php -v
echo ---------------------------------------------------------------
Change the php5.3.22 folder name to the version of PHP you are using.
Store this file in a folder that is already on your PATH and then you can run it from anywhere in any folder. Once it has been run PHP will be available to you by just running
phppath
php script.php
It should also be able to find libeay32.dll and ssleay32.dll because they are in the php folder which is now in a folder on your PATH.

How to install ImageMagick on Windows 7 (2)

Hopefully, despite similar question titles, this isn't a duplicate issue.
I've installed ImageMagick-6.7.5-6-Q16-windows-dll.exe.
I have php_imagick_dyn-Q16.dll renamed to php_imagick.dll in PHP's ext directory.
I have extension=php_imagick.dll in my php.ini.
I try to run a basic test: php -r "var_dump(class_exists('Imagick'));".
I get this error:
PHP Startup: imagick: Unable to initialise module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options must match.
CLI has stopped working.
Windows can check online for a solution to the problem.
> Check online for a solution and close the program
> Close the program
What have I done wrong?
First install :
Link
Download :
http://www.sk89q.com/2010/03/vc6-windows-binaries-for-imagick-2-3-0/
Choose the TS one
Open your php.ini file
Add this line :
extension=php_imagick.dll
Restart your apache server
open php_info()
Now your imagick lib is ready to use.
This works for me.

Resources