I tried to work with yii basic migrations. yii migrate/create is working, yii migrate - not.
I use command php yii migrate. I get the following message:
Exception 'yii\db\Exception' with message 'could not find driver'
in ../basic/vendor/yiisoft/yii2/db/Connection.php:547
I have found advice that I need to add some files from advanced yii to my basic. I do not know what should be done exactly.
You should install extension to your php of DB, which you are using. In case it is already installed, make sure that it is properly turned on in your php-cli settings.
For example, in case you are using Ubuntu and php5-fpm you can run
sudo apt-get install php5-mysql
Related
I tried to setup my symfony project, everything was well, since I tried to create the doctrine database.
I written my DATABASE_URL in the .env file, that is correct, well I think so, but nothing works, either my local xampp server or my web server.
I get always the same error:
[critical] Error thrown while running command "doctrine:database:create". Message: "An exception occurred in the driver: could not find driver"
In ExceptionConverter.php line 119:
An exception occurred in the driver: could not find driver
In Exception.php line 30:
could not find driver
In Driver.php line 28:
could not find driver
It looks like you may have not enabled the pdo_mysql extension in your php.ini file.
Try to uncomment the ;extension=pdo_mysql line inside your php.ini.
Beware, your php console may use a different php.ini file than the one that runs your application.
I am also a beginner on Symfony and I use ubuntu.
I followed the below steps-
I first wrote in my terminal the command: symfony check:requirements to know what was wrong.
I got confirmation that my pdo_mysql had missing drivers and as I'm using php 8.2, so I installed MySQL for php8.2.
In the terminal, type the command sudo apt-get install -y php8.2-mysql
and then retype the command: php bin/console doctrine:database:create for the creation of the database.
Let me know if it works.
New to symfony, I also had this problem.
I needed to get an .env.local file from another developer, and I did not realize that the .env.local file needed to go in to the app/ directory.
So that the app/.env and app/.env.local are both in place.
It was only then that symfony was able to pick up the correct DATABASE_URL
I have an issue with connecting php(valet) and MongoDB. I tried to install MongoDB with pecl and command sudo pecl install mongodb and brew install mongodb and all time I get some errors during the install process:
In file included from /private/tmp/pear/temp/mongodb/src/MongoDB/Cursor.c:18: /opt/homebrew/Cellar/php#8.0/8.0.17/include/php/ext/spl/spl_iterators.h:151:4: error: unknown type name 'pcre_cache_entry' pcre_cache_entry *pce; ^ 1 error generated. make: *** [src/MongoDB/Cursor.lo] Error 1 ERROR: make' failed`.
But when I run mongo --version I get:
and I install MongoDB Compass and as you can see, I can connect to the database and write into it:
But when I try out to install laravel package jenssegers/mongodb I get these errors: I tried with --ignore-platform-req=ext-mongodb flag but then it install package but it didn't work, I get this error: Error: Class "MongoDB\Driver\Manager" not found.
Finally, I find out a great package that helps me in this! This repo saves me a ton of time and debugging! Thank you shivammathur!
Hey I also had the same problem. A good alternative is to also follow with this article if you want to stick with pecl https://freek.dev/2151-fixing-the-dreaded-pcre2h-file-not-found-error-when-installing-imagick
I am trying to run a new Laravel app on my sever but I am getting the following error:
QueryException (SQL) could not find driver (SQL: select * from
settings limit 1)
Using the debugbar I can see the error is for PDO: LOG.error:
PDOException: could not find driver in
/home/mysite.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:
What doesn't make sense is that I actually already have PDO installed, I know this because I ran the first php artisan migrate and it created all the tables in my MYSQL DB fine.
I have ran php -m | grep mysql to verify what mysql related PHP extensions I have:
$ php -m | grep mysql
mysqli
mysqlnd
pdo_mysql
I should note that PHP can use MySQL as I have a Wordpress blog running on the same server fine.
I have already tried clearing the cache and updating composer packages, I have also completely removed doctrine/dbal and reinstalled.
Update: If I remove the package doctrine/dbal and clear the caches, I still receive an error about PDOExceptions:
Illuminate\Database\QueryException could not find driver
/home/mysite.com/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php#68
Try this:
composer update
composer require doctrine/dbal
It looks like you have a missing dependency
Notice:
You might need to comment out the following in your php.ini file.
;extension=pdo_mysql.so
stackoverflow.com/a/42561002/2109233 source
I am receiving this error whenever I try to install Laravel Artisan Migrations. I'll tell you what I have done...
I have gone into my .bash_profile:
export PATH=/opt/local/bin:/opt/local/sbin:/Applications/MAMP/Library/bin/:/Applications/MAMP/bin/php/php5.5.3/bin:$PATH
and when I check to see which version of PHP I am using, it's the one in my MAMP folder. And it is certainly enabled! But when I type Laravel Artisan: Migrate: Install it prompts me back with MCrypt PHP extension required. Composer is functioning properly. So is Laravel 4. It's this Migrations that is giving me trouble.
Not sure that a user name like LaravelSucks is going to make it easy for you to get help from the Laravel community, but since we're generally bigger than that ... I think you'll find your answer here.
If that doesn't work for you, you may need to set it up manually, e.g.
sudo apt-get install php5-mcrypt
I've been trying to set up ninjauth but see to have run into a problem for some reason fuel doesn't seem to be recognizing the oauth package correctly and I am getting the following error
ErrorException [ Error ]: Class 'OAuth\Fuel' not found
PKGPATH/oauth/classes/request.php # line 477
I have made sure the package is installed in /fuel/packages/oauth
added it to the config file in /fuel/app/config/config.php so it looks like
'packages' => array(
'orm','ninjauth','oauth','oauth2','auth'
),
and ran a migration on it
php oil refine migrate --packages=oauth
I am developing locally on OSX(10.5.8) using MAMP as my server if that helps.
this was a namespace issue and has been fixed in this commit
https://github.com/fuel-packages/fuel-oauth/commit/57da924ffcd1f9d08fe3f2d40e4b35b0a92d8c94
I was having the same trouble and it turns out I did not have cURL as part of my php installation.
I corrected the issue on Linux by running: sudo apt-get install curl libcurl3 libcurl3-dev php5-curl