ZF3 Getting started tutorial : 404 error at Db conf

For programming and general questions on Zend Framework
Post Reply
Posts: 1
Joined: Fri Feb 24, 2017 9:24 am
Location: Toulouse, France

ZF3 Getting started tutorial : 404 error at Db conf

Post by phil5973 » Fri Feb 24, 2017 2:48 pm


I have a 404 error on the Getting Started tutorial on ZF3, at the step "Database and models / Listing albums".

The only thing I have changed is the database configuration from sqlite to MySQL :

Code: Select all

return [
		'db' => [
				'driver' => 'Pdo_Mysql',
				//'dsn'    => sprintf('sqlite:%s/data/zftutorial.db', realpath(getcwd())),
				'dsn'    => 'mysql:dbname=zf_tutorial;host=mon.ip;charset=utf8;username=monuser;password=monpassword',
There is also something that I haven't understood in the tutorial :
Configuring the default adapter

Within your service factories, you may retrieve the default adapter from your application container using the class name Zend\Db\Adapter\AdapterInterface:

Code: Select all

use Zend\Db\Adapter\AdapterInterface;
function ($container) {
    return new SomeServiceObject($container->get(AdapterInterface::class));
Do I have to enter this code somewhere or is it just an example ?

I obtain a 404 error whith the URL : http://zf-tutorial.localhost/album/
Of course, the main page http://zf-tutorial.localhost is OK.

Is there a way to detect the source of the error ?

I have activated the development bar of ZF3 and the PHP errors. I just have a warning about the usage of date() function in module/Application/view/layout/layout.phtml, a file that I haven't modified.

Post Reply