-
Notifications
You must be signed in to change notification settings - Fork 67
Zend\Db\Adapter\Exception\RuntimeException #103
Comments
That means that the required PHP extension (used to connect to your target
DB) is not installed.
…On Sat, 27 Oct 2018, 09:53 mcl12345, ***@***.***> wrote:
Hi,
I have an error when I followed the tutorial
https://docs.zendframework.com/tutorials/getting-started/database-and-models/
[image: capture d ecran de 2018-10-27 09-49-04]
<https://user-images.githubusercontent.com/24854693/47601227-b439a580-d9cd-11e8-9b78-eee036b251ef.png>
#0
/var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-db/src/Adapter/Driver/Pdo/Pdo.php(255):
Zend\Db\Adapter\Driver\Pdo\Connection->connect()
#1 <#1>
/var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-db/src/Sql/Sql.php(138):
Zend\Db\Adapter\Driver\Pdo\Pdo->createStatement()
#2 <#2>
/var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-db/src/TableGateway/AbstractTableGateway.php(238):
Zend\Db\Sql\Sql->prepareStatementForSqlObject(Object(Zend\Db\Sql\Select))
#3 <#3>
/var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-db/src/TableGateway/AbstractTableGateway.php(209):
Zend\Db\TableGateway\AbstractTableGateway->executeSelect(Object(Zend\Db\Sql\Select))
#4 <#4>
/var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-db/src/TableGateway/AbstractTableGateway.php(196):
Zend\Db\TableGateway\AbstractTableGateway->selectWith(Object(Zend\Db\Sql\Select))
#5 <#5>
/var/www/html/progressive_app/zf-tutorial/module/Album/src/Model/AlbumTable.php(22):
Zend\Db\TableGateway\AbstractTableGateway->select()
#6 <#6>
/var/www/html/progressive_app/zf-tutorial/module/Album/src/Controller/AlbumController.php(22):
Album\Model\AlbumTable->fetchAll()
#7 <#7>
/var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78):
Album\Controller\AlbumController->indexAction()
#8 <#8>
/var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-eventmanager/src/EventManager.php(322):
Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#9 <#9>
/var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-eventmanager/src/EventManager.php(179):
Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent),
Object(Closure))
#10 <#10>
/var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(105):
Zend\EventManager\EventManager->triggerEventUntil(Object(Closure),
Object(Zend\Mvc\MvcEvent))
#11 <#11>
/var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-mvc/src/DispatchListener.php(119):
Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request),
Object(Zend\Http\PhpEnvironment\Response))
#12 <#12>
/var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-eventmanager/src/EventManager.php(322):
Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#13 <#13>
/var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-eventmanager/src/EventManager.php(179):
Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent),
Object(Closure))
#14 <#14>
/var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-mvc/src/Application.php(332):
Zend\EventManager\EventManager->triggerEventUntil(Object(Closure),
Object(Zend\Mvc\MvcEvent))
#15 <#15>
/var/www/html/progressive_app/zf-tutorial/public/index.php(40):
Zend\Mvc\Application->run()
#16 <#16> {main}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#103>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AAJakPUNUF3EhqasEtYGDhvwibdjdv1zks5upBEDgaJpZM4X9TWO>
.
|
I tried to uncomment in /etc/php/7.2/apache2/php.ini But it doesn't work |
I am getting same error. Any luck? |
@niners52 |
@mcl12345 |
This is what I get when I type in sqlite3- These were added to my php.ini file- Is there something else I am missing? It looks like it is enabled. |
MySQL is not needed for the Getting Started tutorial, only Sqlite! |
I ran the installation for Sqlite and didn't get any errors. |
You can test your Sqlite installation with a simple PHP script: $db = new PDO('sqlite::memory:');
$db->query('CREATE TABLE `foobar` (`id` INTEGER)')->execute();
$stmt = $db->query("SELECT * FROM sqlite_master WHERE type='table'");
$stmt->execute();
var_dump($stmt->fetchAll()); The result is an If this does not work, then unfortunately I can not help you either. I have never had a PHP installation without Sqlite and therefore I do not know how to configure it. If you have other database support available in your PHP installation, then you should use it. |
PHP Warning: Uncaught PDOException: could not find driver in php shell code:1 When I try and run the code you gave me. However I recently installed sqlite and below is what I got Reading package lists... Done |
@niners52 Shouldn't you install something like |
Question seems to be answered. Closing. |
Hi,
I have an error when I followed the tutorial https://docs.zendframework.com/tutorials/getting-started/database-and-models/
#0 /var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-db/src/Adapter/Driver/Pdo/Pdo.php(255): Zend\Db\Adapter\Driver\Pdo\Connection->connect()
#1 /var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-db/src/Sql/Sql.php(138): Zend\Db\Adapter\Driver\Pdo\Pdo->createStatement()
#2 /var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-db/src/TableGateway/AbstractTableGateway.php(238): Zend\Db\Sql\Sql->prepareStatementForSqlObject(Object(Zend\Db\Sql\Select))
#3 /var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-db/src/TableGateway/AbstractTableGateway.php(209): Zend\Db\TableGateway\AbstractTableGateway->executeSelect(Object(Zend\Db\Sql\Select))
#4 /var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-db/src/TableGateway/AbstractTableGateway.php(196): Zend\Db\TableGateway\AbstractTableGateway->selectWith(Object(Zend\Db\Sql\Select))
#5 /var/www/html/progressive_app/zf-tutorial/module/Album/src/Model/AlbumTable.php(22): Zend\Db\TableGateway\AbstractTableGateway->select()
#6 /var/www/html/progressive_app/zf-tutorial/module/Album/src/Controller/AlbumController.php(22): Album\Model\AlbumTable->fetchAll()
#7 /var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): Album\Controller\AlbumController->indexAction()
#8 /var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#9 /var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#10 /var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(105): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#11 /var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-mvc/src/DispatchListener.php(119): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#12 /var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#13 /var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#14 /var/www/html/progressive_app/zf-tutorial/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#15 /var/www/html/progressive_app/zf-tutorial/public/index.php(40): Zend\Mvc\Application->run()
#16 {main}
The text was updated successfully, but these errors were encountered: