Php 找不到驱动程序Yii2迁移
我是Yii2新手,因此在迁移到XAMPP服务器时遇到问题。我的PHP版本是7.1.11。我正在使用Yii2高级模板,这就是我的Php 找不到驱动程序Yii2迁移,php,database,yii2,xampp,migration,Php,Database,Yii2,Xampp,Migration,我是Yii2新手,因此在迁移到XAMPP服务器时遇到问题。我的PHP版本是7.1.11。我正在使用Yii2高级模板,这就是我的common/config/main local.php文件的样子 <?php return [ 'components' => [ 'db' => [ 'class' => 'yii\db\Connection', 'dsn' => 'mysql:host=127.0.
common/config/main local.php
文件的样子
<?php
return [
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=127.0.0.1;dbname=hopordrop',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
],
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure a transport
// for the mailer to send real emails.
'useFileTransport' => true,
],
],
];
运行php-m
命令时:
[PHP Modules]
bcmath
calendar
Core
ctype
date
dom
filter
hash
iconv
json
libxml
mbstring
mysqlnd
openssl
pcre
PDO
Phar
readline
Reflection
session
SimpleXML
SPL
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
zip
zlib
[Zend Modules]
你知道怎么解决这个问题吗?我已经试过了以前问过的问题中所有类似的解决方案
Name Result Required By Memo
PHP version Passed Yii Framework PHP 5.4.0 or higher is required.
Reflection extension Passed Yii Framework
PCRE extension Passed Yii Framework
SPL extension Passed Yii Framework
Ctype extension Passed Yii Framework
MBString extension Passed Multibyte string processing Required for multibyte encoding string processing.
OpenSSL extension Passed Security Component Required by encrypt and decrypt methods.
Intl extension Passed Internationalization support PHP Intl extension 1.0.2 or higher is required when you want to use advanced parameters formatting in Yii::t(), non-latin languages with Inflector::slug(), IDN-feature of EmailValidator or UrlValidator or the yii\i18n\Formatter class.
ICU version Passed Internationalization support ICU 49.0 or higher is required when you want to use # placeholder in plural rules (for example, plural in Formatter::asRelativeTime()) in the yii\i18n\Formatter class. Your current ICU version is 57.1.
ICU Data version Passed Internationalization support ICU Data 49.1 or higher is required when you want to use # placeholder in plural rules (for example, plural in Formatter::asRelativeTime()) in the yii\i18n\Formatter class. Your current ICU Data version is 57.1.
Fileinfo extension Passed File Information Required for files upload to detect correct file mime-types.
DOM extension Passed Document Object Model Required for REST API to send XML responses via yii\web\XmlResponseFormatter.
PDO extension Passed All DB-related classes
PDO SQLite extension Passed All DB-related classes Required for SQLite database.
PDO MySQL extension Passed All DB-related classes Required for MySQL database.
PDO PostgreSQL extension Passed All DB-related classes Required for PostgreSQL database.
Memcache extension Warning MemCache
APC extension Warning ApcCache
GD PHP extension with FreeType support Passed Captcha Either GD PHP extension with FreeType support or ImageMagick PHP extension with PNG support is required for image CAPTCHA.
ImageMagick PHP extension with PNG support Warning Captcha Either GD PHP extension with FreeType support or ImageMagick PHP extension with PNG support is required for image CAPTCHA.
Expose PHP Warning Security reasons "expose_php" should be disabled at php.ini
PHP allow url include Passed Security reasons "allow_url_include" should be disabled at php.ini
PHP mail SMTP Passed Email sending PHP mail SMTP server required
正如您在上看到的,您需要安装pdo,在您的情况下,pdo_mysql。您缺少最后一个。正如您在上看到的,您需要安装pdo,在您的情况下,pdo_mysql。您缺少最后一个。尝试在web或控制台中运行
requirements.php
文件,检查您的DB相关PDO是否为绿色。如果没有,那么XAMPP配置可能有问题。请尝试在web或控制台中运行requirements.php
文件,检查与DB相关的PDO是否为绿色。如果没有,那么XAMPP配置可能有问题。谢谢,但我已经安装了pdo,这是我的需求文件。我刚刚看到你更新了你的答案是pdo mysql扩展已加载。确切的错误是什么?找不到驱动程序Yii迁移?你能发布application.log中的完整错误,而不仅仅是堆栈跟踪吗?谢谢各位,我在php的环境变量中指出了错误的路径,我有2个phpinstalled@MilošVukadinović有时会发生;)很高兴我能帮忙!谢谢,但是我已经安装了pdo,这是我的需求文件我刚刚看到你更新了你的答案是pdo mysql扩展已经加载。确切的错误是什么?找不到驱动程序Yii迁移?你能发布application.log中的完整错误,而不仅仅是堆栈跟踪吗?谢谢各位,我在php的环境变量中指出了错误的路径,我有2个phpinstalled@MilošVukadinović有时会发生;)很高兴我能帮忙!
Name Result Required By Memo
PHP version Passed Yii Framework PHP 5.4.0 or higher is required.
Reflection extension Passed Yii Framework
PCRE extension Passed Yii Framework
SPL extension Passed Yii Framework
Ctype extension Passed Yii Framework
MBString extension Passed Multibyte string processing Required for multibyte encoding string processing.
OpenSSL extension Passed Security Component Required by encrypt and decrypt methods.
Intl extension Passed Internationalization support PHP Intl extension 1.0.2 or higher is required when you want to use advanced parameters formatting in Yii::t(), non-latin languages with Inflector::slug(), IDN-feature of EmailValidator or UrlValidator or the yii\i18n\Formatter class.
ICU version Passed Internationalization support ICU 49.0 or higher is required when you want to use # placeholder in plural rules (for example, plural in Formatter::asRelativeTime()) in the yii\i18n\Formatter class. Your current ICU version is 57.1.
ICU Data version Passed Internationalization support ICU Data 49.1 or higher is required when you want to use # placeholder in plural rules (for example, plural in Formatter::asRelativeTime()) in the yii\i18n\Formatter class. Your current ICU Data version is 57.1.
Fileinfo extension Passed File Information Required for files upload to detect correct file mime-types.
DOM extension Passed Document Object Model Required for REST API to send XML responses via yii\web\XmlResponseFormatter.
PDO extension Passed All DB-related classes
PDO SQLite extension Passed All DB-related classes Required for SQLite database.
PDO MySQL extension Passed All DB-related classes Required for MySQL database.
PDO PostgreSQL extension Passed All DB-related classes Required for PostgreSQL database.
Memcache extension Warning MemCache
APC extension Warning ApcCache
GD PHP extension with FreeType support Passed Captcha Either GD PHP extension with FreeType support or ImageMagick PHP extension with PNG support is required for image CAPTCHA.
ImageMagick PHP extension with PNG support Warning Captcha Either GD PHP extension with FreeType support or ImageMagick PHP extension with PNG support is required for image CAPTCHA.
Expose PHP Warning Security reasons "expose_php" should be disabled at php.ini
PHP allow url include Passed Security reasons "allow_url_include" should be disabled at php.ini
PHP mail SMTP Passed Email sending PHP mail SMTP server required