I am working on a zend framework 2 application, and I am working with port 8080. My main probleme in the begining is that i couldn't retrieve or add data from database in the views (probably, a probleme with connection with database). It didn't show any error, but data couldn't be retrieved or added. I tried to specify the port in global.php:
<?php
return array(
'db' => array(
'driver' => 'Pdo',
'dsn' => 'mysql:dbname=pizza;host=localhost',
'driver_options' => array(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES\'UTF8\''
),
),
'service_manager' => array(
'factories' => array(
'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory'
)
),
);
After that, I got this error:
Warning: PDO::__construct(): MySQL server has gone away in
I looked for a solution, and I found one. I commented a line in php.ini:
extension=php_pdo_mysql.dll
It solved the probleme, but now Im stuck with another probleme:
Fatal error: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' in C:\wamp\www\pizza\config\autoload\global.php on line 18
I found some suggestions on how to fix this probleme by Linux command:
apt-get install php5-mysql /etc/init.d/apache2 restart
But i want a solution for windows 7, or any other you may find useful. Thanks for your time.