安装Yii2框架后,Web basic上的PHP核心警告


PHP Core Warning on Web basic after installing Yii 2 framework

安装Yii框架后,当我访问localhost/html/basic/web/时,首页显示Congratulations. You have successfully created your Yii-powered application.

问题是底部页面显示了一个错误,看起来像这个

PHP Core Warning – yii'base'ErrorException
Module 'mysql' already loaded
2. yii'base'ErrorHandler::handleFatalError()
$_SERVER = [
    'HTTP_HOST' => 'localhost',
    'HTTP_CONNECTION' => 'keep-alive',
    'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
    'HTTP_UPGRADE_INSECURE_REQUESTS' => '1',
    'HTTP_USER_AGENT' => 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',
    'HTTP_ACCEPT_ENCODING' => 'gzip, deflate, sdch',
    'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.8',
    'HTTP_COOKIE' => '_csrf=f85409642b77bad50690d972a497f64ff6904dfe5503dff60053c82b25b1ae9da%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%22ixW-YN54kOWQFRW4yXmZSXgGDOQ4eLjL%22%3B%7D; PHPSESSID=airgk9lps3lsg261pps59bos40',
    'PATH' => '/usr/local/bin:/usr/bin:/bin',
    'SERVER_SIGNATURE' => '
Apache/2.4.6 (Ubuntu) Server at localhost Port 80
',
    'SERVER_SOFTWARE' => 'Apache/2.4.6 (Ubuntu)',
    'SERVER_NAME' => 'localhost',
    'SERVER_ADDR' => '127.0.0.1',
    'SERVER_PORT' => '80',
    'REMOTE_ADDR' => '127.0.0.1',
    'DOCUMENT_ROOT' => '/var/www',
    'REQUEST_SCHEME' => 'http',
    'CONTEXT_PREFIX' => '',
    'CONTEXT_DOCUMENT_ROOT' => '/var/www',
    'SERVER_ADMIN' => 'webmaster@localhost',
    'SCRIPT_FILENAME' => '/var/www/html/basic/web/index.php',
    'REMOTE_PORT' => '57773',
    'GATEWAY_INTERFACE' => 'CGI/1.1',
    'SERVER_PROTOCOL' => 'HTTP/1.1',
    'REQUEST_METHOD' => 'GET',
    'QUERY_STRING' => '',
    'REQUEST_URI' => '/html/basic/web/',
    'SCRIPT_NAME' => '/html/basic/web/index.php',
    'PHP_SELF' => '/html/basic/web/index.php',
    'REQUEST_TIME_FLOAT' => 1449020549.364,
    'REQUEST_TIME' => 1449020549,
];
$_COOKIE = [
    '_csrf' => 'f85409642b77bad50690d972a497f64ff6904dfe5503dff60053c82b25b1ae9da:2:{i:0;s:5:"_csrf";i:1;s:32:"ixW-YN54kOWQFRW4yXmZSXgGDOQ4eLjL";}',
    'PHPSESSID' => 'airgk9lps3lsg261pps59bos40',
];
$_SESSION = [
    '__flash' => [],
];

我该怎么解决这个问题?对不起,我只是Yii 2的新手。

看起来是php配置的问题,而不是yii

try this steps it may help you , i search and found these solutions:<br>
1. may be problem in the cached version of the request data. You could try clearing the folder under @runtime/debug.
2. Use PHP 5.5 for developing the website.<br>
3. Disable the "varnish cache" by adding this line of code to your .htaccess
 Header add "disablevcache" "true".