简体   繁体   中英

PHP Core Warning on Web basic after installing Yii 2 framework

After I installed Yii framework, when I access localhost/html/basic/web/ the top page says Congratulations. You have successfully created your Yii-powered application. Congratulations. You have successfully created your Yii-powered application.

The problem is the bottom page displays an error that looks like this

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' => [],
];

How can I fix this? Sorry I am just new to Yii 2.

Looks like an issue with your php config, not 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".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM