Fatal error: Call to undefined function mb_convert_encoding() in /home/abcdef/public_html/folder_name/lib/Pelago/Emogrifier.php on line 556 - magento-1.9

Fatal error: Call to undefined function mb_convert_encoding() in
/home/abcdef/public_html/folder_name/lib/Pelago/Emogrifier.php on line
556
solve this error in magento code.
this is the code , at return line its showing error.
private function getUnifiedHtml() {
if (!empty($this->unprocessableHtmlTags)) { $unprocessableHtmlTags = implode('|', $this->unprocessableHtmlTags); $bodyWithoutUnprocessableTags = preg_replace('/<\\/?(' . $unprocessableHtmlTags . ')[^>]*>/i', '', $this->html); } else { $bodyWithoutUnprocessableTags = $this->html; }
return mb_convert_encoding($bodyWithoutUnprocessableTags, 'HTML-ENTITIES', self::ENCODING);
}

It looks like you are missing a PHP extension mbstring.
Install it and the error will be rectified.
Ubuntu/Debian
sudo apt-get install php-mbstring
In case you are using PHP 7.x.
sudo apt-get install php7.0-mbstring
For Centos
sudo yum install php-mbstring

I'm updating this thread with the instructions for GoDaddy hosted servers, as I went through a painful day trying to get this resolved. The mbstring extension is used by Magento (I needed it for 1.9) and without it installed, the checkout process will fail, with the shopping cart failing to take the user to the 'Thanks for your order screen' (although the order is sometimes created on the back-end successfully). It was also creating an issue when hitting the 'Send Email' button on the Admin panel on an Order, producing a 500 error.
In my log files, I was seeing the following error:
PHP Fatal error: Call to undefined function mb_convert_encoding() in
/home/yoursite/public_html/lib/Pelago/Emogrifier.php on line 556
Searching for this error gave results that suggested I needed to enable the mbstring extension on the server, but with a GoDaddy hosted virtual server, I ran into a wall of frustration with the package not being found via the php install search, and their tech support unable to assist. Here are the instructions for the current WHM panel (Jan 2019):
Login to your server WHM as root.
Search EasyApache or go to the Software menu on the left and select 'EasyApache 4'.
You will see a list of profiles and at the top of the list, 'Currently Installed Packages'. Select the 'Customize' button.
Select the 'PHP Extensions' link or keep hitting 'Next' until you reach the page.
In the search box, type 'string', you will see 'php56-php-mbstring' and 'php70-php-mbstring'; move the grey slider on the right to install each.
Continue to the 'Review' tab. Here you can simply hit 'Provision' to install the extension. You can also save these options as a custom profile if you'd like.
After the build has completed, the extension should be available on all your domains.
Hopefully this will save someone some time trying to figure this out!

Related

Change mysql db location when installed with homebrew using Big Sur and external hard drive

Previously I had /usr/local/var/mysql symlinked to /Volumes/External/mysql meaning all my databases were stored on the external hard drive.
I have had to reformat my machine and upgrade to BigSur. If I try to set up the symlink as before I now get the following when I try to start MySQL
brew services start mysql
Bootstrap failed: 5: Input/output error
Error: Failure while executing; `/bin/launchctl bootstrap gui/502 /Users/jamie/Library/LaunchAgents/homebrew.mxcl.mysql.plist` exited with 5.
If I try to also change the -datadir in
/usr/local/Cellar/mysql/8.0.26/homebrew.mxcl.mysql.plist
to be
<string>--datadir=/Volumes/External/mysql</string>
I get the same error
brew services start mysql
Bootstrap failed: 5: Input/output error
Error: Failure while executing; `/bin/launchctl bootstrap gui/502 /Users/jamie/Library/LaunchAgents/homebrew.mxcl.mysql.plist` exited with 5.
I have tried
launchctl unload /Users/jamie/Library/LaunchAgents/homebrew.mxcl.mysql.plist
launchctl load /Users/jamie/Library/LaunchAgents/homebrew.mxcl.mysql.plist
but that didn't work either. It's like it doesn't have the correct permissions. Looking at the privacy settings you can see httpd which is also installed by brew is allowed to see "Removable volumes".
I can't add MySQL as the + symbol is grey out even though I have unlocked the panel
The external hard drive is located at /Volumes/External/ and is APFS (Encrypted) volume.
Any help would be much appreciated
https://github.com/Homebrew/discussions/discussions/2092#discussioncomment-1286031
Select System Preferences->Security & Privacy->Full Disk Access
Click the lock to make changes
Click '+'
Press 'cmd + Shift + .' to show hidden files
select /bin/sh

Snap apps giving "error while loading shared libraries" and "cannot open shared object file: No such file or directory" when opened

Some snap apps (namely discord and telegram-desktop), stopped opening when I turned my laptop on this morning (Fedora 31 64bit), and when opened from terminal discord shows this:
~/ discord
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
/snap/discord/109/usr/share/discord/Discord: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory
and telegram-desktop shows this:
~/ telegram-desktop
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
/snap/telegram-desktop/1561/bin/telegram-desktop: error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory
both packages are installed, and I'm a bit stumped after searching threads and forums for most of the morning, nothing I tried worked, reinstalling them, trying different versions of the libraries and then the apps, installing 32bit versions, and on and on. Any help, prompts, ideas, or just general rambling about what the issue could be is much appreciated.
TLDR: Snap apps giving "error while loading shared libraries" and "cannot open shared object file: No such file or directory" when opened. Packages that are missing are installed correctly, so I'm stumped.
The warning is not your issue.
The real problem is simply you miss some dependencies in your snaps: for some reason snap is not installing all the requiered depdencies, while it should.
In an Ubuntu I have telegram-desktop and it works fine and I did this check:
snap list
to list the actual snaps.
And next I did check all the interdependencies by looking at the connections with:
snap connections telegram-desktop
this on my Utbuntu machine yields:
Interface Plug Slot Notes
alsa telegram-desktop:alsa - -
audio-playback telegram-desktop:audio-playback :audio-playback -
audio-record telegram-desktop:audio-record - -
content[gtk-3-themes] telegram-desktop:gtk-3-themes gtk-common-themes:gtk-3-themes -
content[icon-themes] telegram-desktop:icon-themes gtk-common-themes:icon-themes -
content[kde-frameworks-5-core18-all] telegram-desktop:kde-frameworks-5-plug kde-frameworks-5-core18:kde-frameworks-5-core18-slot -
content[sound-themes] telegram-desktop:sound-themes gtk-common-themes:sound-themes -
desktop telegram-desktop:desktop :desktop -
desktop-legacy telegram-desktop:desktop-legacy :desktop-legacy -
gsettings telegram-desktop:gsettings :gsettings -
home telegram-desktop:home :home -
network telegram-desktop:network :network -
network-manager telegram-desktop:network-manager - -
opengl telegram-desktop:opengl :opengl -
pulseaudio telegram-desktop:pulseaudio :pulseaudio -
removable-media telegram-desktop:removable-media - -
unity7 telegram-desktop:unity7 :unity7 -
wayland telegram-desktop:wayland :wayland -
x11 telegram-desktop:x11 :x11 -
next I have found that the library libQt5Widgets.so.5 you are missing is provided by kde-frameworks-5-core18
sudo find /snap -name libQt5Widgets.so
/snap/kde-frameworks-5-core18/32/usr/lib/x86_64-linux-gnu/libQt5Widgets.so
I don't know if on fedora you could use:
snap install kde-frameworks-5-core18
to fix your missing dependency.
On the other side on Fedora and similar distros you could try to use flatpak instaead of snap: flatpak comes as default app-package manager for the Fedora family.
First you need to add flathub as a flatpak remote repository:
sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
next you can search:
flatpak search discord
flatpak search telegram
and next install the apps:
sudo flatpak install com.discordapp.Discord
sudo flatpak install org.telegram.desktop
I tested this on a CentOS virtual machine (I dont' have a fedora ready to test, but CentOS is close enough) and I got them both correctly working.
Hey I'm not an expert at all, but I've been facing the same issue, and it seems that doing a "snap refresh" fixed the problem on my ubuntu. I'm not sure if it's relevant or not, but it might help

Moodle: Installation failed - Coding Error Detected

I have tried to install Moodle 3.5.1 on my development server (Apache 2.4.29 and MySQL v.5.7).
The installation process went smoothly: The MySQL database has been set up, all required PHP packages are installed, the system has been successfully installed, all file permissions are correct.
After the installation I only get the following error:
"Coding error detected, it must be fixed by a programmer: PHP catchable fatal error"
There are no further error messages. There are no error messages in Apache Error log or PHP log files. In the PHP ini file the display of error messages is activated.
So I can not figure out what did not work or how to fix it.
Put error_reporting(E_ALL); and ini_set('display_errors', 1); in the beggining of the script you see problem in for more debug info
Moodle 3.5 requires PHP 7
https://docs.moodle.org/35/en/PHP
Could that be your problem?

Xcode Server Bot, ipatool error

We have an Xcode Server bot set up for CI for our project, using Xcode 7.1. It's set to produce an IPA. We only recently noticed, but a few weeks ago, it started giving this warning every build:
Bot Issue for CareConsult Bot (develop) (build service warning)
Assertion: exportArchive: ipatool failed with an exception:
File: (null):(null)
This prevents it from producing an IPA, which is a problem.
I've tried:
- Creating a new bot
- updating gems (saw a similar issue that was resolved this way)
Doing an archive & export on my local machine gives the same error if I choose to "Export for specific device". So the problem is not specific to the build server.
Any ideas?
My suspicion is that this has to do with enabling bit code, and the build bot is using the "compile from bitcode" option by default. I'm still digging into this, but figured I'd share what I have found thus far.

How to debug the cartridge scripts in Openshift?

I want to develop a new cartridge for my own use. I use OpenShift Cartridge Development Kit to start my work. My building script is written in .openshift/action_hooks/build and it can be successfully executed.
But when I tried to use the command displayed on the homepage of the CDK project - "rhc create-app mynewcart http://##YOUR-DOMAIN##/manifest/##YOUR-COMMIT-ID##" - to create an app, I got the following error: "Unable to complete the requested operation due to: An invalid exit code (1) was returned from the server ex-std-node161.prod.rhcloud.com. This indicates an unexpected problem during the
execution of your request."
How can I trace the progress of deploying and find out where is the code that caused the problem? Is there any log file available for me to analyse?
Use the --debug option when running the command and you'll get much more detailed output:
rhc create-app mynewcart http://##YOUR-DOMAIN##/manifest/##YOUR-COMMIT-ID## --debug