Yii2 'Your system does not support any of these drivers: gmagick,imagick,gd2' - yii2

The problem is like this : i am following a yii tutorial in order to learn more about the framework, the tutorial is https://www.youtube.com/watch?v=whuIf33v2Ug&t=11365s and i found myself strugalling at 2:55:31 ( thumbnail resize ) , i installed the necesary dependencie using composer require yiisoft/yii2-imagine and i wrote the code.
Image::getImagine()
->open($thumbnailPath)
->thumbnail(new Box(1280, 1280))
->save();
but for some reason i encountered this error and i can't figure out how to resolve it :
"Your system does not support any of these drivers: gmagick,imagick,gd2"
image of the error in question

that one is not a yii2 error. you will need to enable one of that extension in you php.ini
if you are a windows user:
i would suggest to start with gd2 that one does not need any extra installation, only you will need to uncomment following line in your php.ini
extension=gd2
if you are linux user:
sudo apt-get install php-gd
will solve your problem. (you will need root permissions to the system)

Related

Composer init (new project) Aborted with Symfony RuntimeException

In a new folder completely empty :
composer init
i have :
Welcome to the Composer config generator
This command will guide you through creating your composer.json config.
Package name (<vendor>/<name>) [slordef/test-composer]:
[Symfony\Component\Console\Exception\RuntimeException]
Aborted
init [--name NAME] [--description DESCRIPTION] [--author AUTHOR] [--type [TYPE]] [--homepage HOMEPAGE] [--require REQUIRE] [--require-dev REQUIRE-DEV] [-s|--stability STABILITY] [-l|--license LICENSE] [--repository REPOSITORY]
Composer is up to date...
Dont know how it append
This is probably a problem with PHP version 7.4, had to switch to version 7.3 to make it work
by running :
composer init -vvv
get :
Exception trace:
() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Helper/QuestionHelper.php:148
Symfony\Component\Console\Helper\QuestionHelper->doAsk() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Helper/QuestionHelper.php:75
Symfony\Component\Console\Helper\QuestionHelper->Symfony\Component\Console\Helper{closure}() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Helper/QuestionHelper.php:404
Symfony\Component\Console\Helper\QuestionHelper->validateAttempts() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Helper/QuestionHelper.php:78
Symfony\Component\Console\Helper\QuestionHelper->ask() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/IO/ConsoleIO.php:291
Composer\IO\ConsoleIO->askAndValidate() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Command/InitCommand.php:240
Composer\Command\InitCommand->interact() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Command/Command.php:230
Symfony\Component\Console\Command\Command->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Application.php:835
Symfony\Component\Console\Application->doRunCommand() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Application.php:185
Symfony\Component\Console\Application->doRun() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Console/Application.php:267
Composer\Console\Application->doRun() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Console/Application.php:106
Composer\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/bin/composer:61
require() at C:\ProgramData\ComposerSetup\bin\composer.phar:24
i had the same bug, but I after all I realized that it happens in the last version of php. Example: I am now using PHP 7.4 but when I switched to PHP 7.3.12 the bug was solved! So I could dare saying that for that specific bug the first thing to check is the version of PHP you're using whether is it stable of not..
Uninstall and reinstall Composer. Note that when installing, set php version 7.0. * To environment variables. So your problem will be solved

While running oracle Goldengate for mysql version 19.1 getting warning--> !!! WARNING !!! --> libssl-2.17.0-stub.so

I am using oracle goldengate for mysql version 19.1. While login to mysql DB from ggsci I am getting below warning. I have checked file libssl-2.17.0-stub.so, this file is not
present in LD_LIBRARY_PATH also not present in my linux machine. Due to this warning login not happening hence extract is not starting. Also did set up environment variables like-
MYSQL_UNIX_PORT
MYSQL_HOME
OGG_MYSQL_OPT_SSL_CA
OGG_MYSQL_OPT_SSL_CERT
OGG_MYSQL_OPT_SSL_KEY
GGSCI > dblogin SOURCEDB DB#host:3306, USERID XXX PASSWORD XXXX
Getting below error-
!!! WARNING !!! --> libssl-2.17.0-stub.so
This is a stub library which can be used for linking only. It must not
be used as a runtime library. Please make sure this library is not found
in LD_LIBRARY_PATH.
Can someone please help me with this.
Can you follow the steps from this doc link, and install OpenSSL and set the PATH as needed:
Check out this topic:
6.4 Other Programs and Settings for MySQL
Doc link: https://docs.oracle.com/en/middleware/goldengate/core/19.1/installing/installing-mysql1.html#GUID-14BA87AB-194B-483C-AECF-151A31F4AFC1
Let us know if that resolves it.

PDO Exception : Could not find driver. [duplicate]

Does the MySQL-server and PHP5-MySQLi version have to match in order for a connection to be possible? I'm currently receiving the error below: I am running BSD.
"Fatal error: Uncaught exception 'PDOException' with message 'could not find driver'..."
Here is the the connection info:
$info = "mysql:dbname=myDB;host=localhost";
$user = "dbUser";
$pw = "somePW";
return(new PDO($info, $user, $pw));
Here is my MySQL information:
mysql-server-5.5.24
php5-mysqli-5.4.3
I had this same issue on my CentOS install. I had tried to install imagick and hosed my install. When I removed all of my php files and reinstalled something wasn't working right.
I ran:
yum install php-pdo
yum install php-pdo_mysql
After doing those two lines I ran
service httpd restart
and everything came back up and running.
PDO uses database specific drivers to connect to database systems. It looks like you are missing the pdo_mysql driver that is required to connect to a MySQL database. There is some details on installing the driver on the pdo_mysql manual page, or there may be a BSD package that you can use (I am afraid I'm not familiar enough with BSD to offer specific advice).
Thanks to zerkms and John C for pointing me in the right direction. Below are the commands I used to install the driver:
#cd /usr/ports/databases/php5-pdo_mysql
#make install clean
#apachectl restart

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

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!

xcode: Mysql connector library not work on iphone5 (armv7s) ,any solution?

I built my App using Mysql Connector/C to connect a remote Mysql database, its works fine on the simulator (no errors, no warnings) but when i try to run it on my device (iphone5) i got this error:
No architectures to compile for (ARCHS=armv7 armv7s, VALID_ARCHS=armv7 armv7s)
i tried -as in some answers- to change setting (Architectures - Build Active Architectures- Valid Architectures) but the error still, only when i change the setting (Architectures & Valid Architectures) to "armv6" its build without error but many warnings appears says:
warning: no rule to process file '(my App dir)/main.m' of type sourcecode.c.objc for architecture armv6
and also for all .m files, when i tried to start the App i got message:
Xcode cannot run using selected device
I know that the Connector library need to update , but are there any solution ?
your need compile the connector lib in xcode for iOS (armv6, armv7, armv7s, i386), then use lipo tool to combine output libs.
direct connect your mysql in app is not safe, a suggest way is setup a Apache+PHP+MySQL server, then on iPhone useing ASIHTTPRequest to connect your server.