Could not find driver – problém

Upozornění: Tohle vlákno je hodně staré a informace nemusí být platné pro současné Nette.
Musilda
Člen | 12
+
0
-

Mám problém s touto hláškou. Prošel jsem už fórum tam a zpět, ale řešení jsem nenašel. Mám hosting u C4 a tam je jako document_root nastavená kořenová složka domény. Požádal jsem podporu o nastavení document_rootu na složku www a po instalaci bootstrapu vše šlape jak hodinky. Pokud se však snažím mít jako document_root kořenový adresář a nastavím vše podle tohoto sandboxu pro wedos zde , laděnka hází could not driver
Zde je můj config

common:
	parameters:
		database:
			driver: mysql
			host: nastenka.musilda.cz
			dbname: nasten-musilda
			user: nasten-musilda
			password: owerdrive


	php:
		date.timezone: Europe/Prague
		# session.save_path: "%tempDir%/sessions"
		# zlib.output_compression: yes


	nette:
		session:
			autoStart: smart
			expiration: +30 days

		database:
			default:
				dsn: '%database.driver%:host=%database.host%;dbname=

%database.dbname%'
				user: %database.user%
				password: %database.password%


	services:
		database: @Nette\Database\Connection

		authenticator: Authenticator( @database::table(user) )


	factories:
		tasks: Tasks
		users: Users
		tasklists: Tasklists

production < common:


development < common:


Ten nefunguje a tento funguje

common:
	parameters:
		database:
			driver: mysql
			host: localhost
			dbname: test
			user:
			password:


	php:
		date.timezone: Europe/Prague
		# session.save_path: "%tempDir%/sessions"
		# zlib.output_compression: yes


	nette:
		session:
			autoStart: smart

		database:
			default:
				dsn: '%database.driver%:host=%database.host%;dbname=%database.dbname%'
				user: %database.user%
				password: %database.password%


	services:
		database: @Nette\Database\Connection

		authenticator: Authenticator( @database::table(users) )


	factories:


production < common:

development < common:

Ten je z toho wedos sandboxu. Nevíte čím to může být?

Edit:

tak jsem ten config přepsal a dokud nezavolám cokoliv v presenteru, tak se mi zobrazuje úvodní stránka nette
Toto vyxvolá okamžitě chybu:

public function beforeRender()
{
    $this->template->taskLists = $this->context->createTasklists()->order('title ASC');
    if ($this->isAjax()) {
        $this->invalidateControl('flashMessages');
    }

Editoval Musilda (7. 7. 2012 22:14)

jtousek
Člen | 951
+
0
-

„Could not find driver“ mi nic neříká, laděnka by nebyla?

Musilda
Člen | 12
+
0
-

Nejsem si jist,, zda je to co jsi chtěl

PDOException
could not find driver

/** @var Nette\Caching\Cache */
44:        private $cache;
45:
46:        /** @var array of function(Statement $result, $params); Occurs after query is executed */
47:        public $onQuery;
48:
49:
50:
51:        public function __construct($dsn, $username = NULL, $password  = NULL, array $options = NULL, $driverClass = NULL)
52:        {
53:            parent::__construct($this->dsn = $dsn, $username, $password, $options);
54:            $this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
55:            $this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('Nette\Database\Statement', array($this)));
56:
57:            $driverClass = $driverClass ?: 'Nette\Database\Drivers\\' . ucfirst(str_replace('sql', 'Sql', $this->getAttribute(PDO::ATTR_DRIVER_NAME))) . 'Driver';
.../libs/Nette/Database/Connection.php:53	 source ►  PDO->	 __construct (arguments ►)

.../temp/cache/_Nette.Configurator/_-cc623972b37d03cae9876a030a184807.php:252	 source ►  Nette\Database\Connection->	 __construct (arguments ►)

242:            $service = new Nette\DI\NestedAccessor($this, 'nette.database');
243:            return $service;
244:        }
245:
246:
247:        /**
248:         * @return Nette\Database\Connection
249:         */
250:        protected function createServiceNette__database__default()
251:        {
252:            $service = new Nette\Database\Connection('mysql:host=nastenka.musilda.cz;dbname=nasten-musilda', 'nasten-musilda', 'owerdrive', NULL);
253:            $service->setCacheStorage($this->cacheStorage);
254:            Nette\Diagnostics\Debugger::$blueScreen->addPanel('Nette\\Database\\Diagnostics\\ConnectionPanel::renderException');
255:            $service->setDatabaseReflection(new Nette\Database\Reflection\DiscoveredReflection($this->cacheStorage));
256:            $service->onQuery[] = array(
.../libs/Nette/DI/Container.php:155	 source ►  SystemContainer->	 createServiceNette__database__default ()

.../libs/Nette/DI/Container.php:312	 source ►  Nette\DI\Container->	 getService (arguments ►)

.../temp/cache/_Nette.Configurator/_-cc623972b37d03cae9876a030a184807.php:435	 source ►  Nette\DI\Container->	 __get (arguments ►)

.../app/presenters/BasePresenter.php:17	 source ►  SystemContainer->	 createTasklists ()

.../libs/Nette/Application/UI/Presenter.php:196	 source ►  BasePresenter->	 beforeRender ()

.../libs/Nette/Application/Application.php:131	 source ►  Nette\Application\UI\Presenter->	 run (arguments ►)

.../app/bootstrap.php:38	 source ►  Nette\Application\Application->	 run ()

.../www/index.php:16	 source ►  require (arguments ►)
Musilda
Člen | 12
+
0
-

No já jsem teda idiot, hlavně, že hledám všude možně a na hostingu si musím pro každou subdoménu nechat aktivovat PDO. Opět chyba mezi židlí a klávesnicí.

jtousek
Člen | 951
+
0
-

Stane se. :-)

Marax
Člen | 28
+
0
-

Btw možná by sis měl změnit heslo… možná i zakázat tu laděnku na live serveru. :-D