Dibi – nepripoji sa v produkcnom rezime v spolupraci s Nette
- RichardT
- Člen | 43
Nette v2.0.3, PHP v5.3.10(produkcny), PHP v5.3.5(local)
Zdravim,
neviem si rady s dibi – v produkcnom rezime sa proste nechce pripojit na db, prihlasovacie udaje su na 100% spravne a funkcie ako mysqli_connect funguju, a v pripade ze pouzijem dibi stand-alone tak funguje tiez.
Dibi stand-alone pouzitie – FUNKCNE:
require_once 'dibi.php';
try {
$options = array(
'driver' => 'mysql',
'host' => 'localhost',
'username' => '***',
'password' => '***',
'database' => '***',
);
//$connection = new DibiConnection($options);*/
dibi::connect($options);
} catch(Exception $e) {
echo '#1 ', $e->getMessage();
}
Takto vyzera moj config v Nette:
common:
php:
date.timezone: Europe/Bratislava
services:
authenticator:
class: \UsersAuthenticator
production < common:
parameters:
database:
username: ***
password: ***
database: ***
profiler: FALSE
development < production:
parameters:
database:
driver: mysql
host: localhost
username: ***
password: ***
database: ***
profiler: TRUE
lazy: TRUE
services:
connection:
class: DibiConnection
factory: dibi::connect(%database%)
run: TRUE
a tuto vynimku hadze v produkcnom rezime. Na locale ide vsetko fajn. Prosim, viete poradit, kde moze byt prosim problem? Dakujem pekne za pripadne odpovede.
DibiException: Dibi is not connected to database. in ***/libs/dibi/dibi.php:176
Editoval RichardT (23. 6. 2012 14:37)
- RichardT
- Člen | 43
Dakujem, ale ked som to zmenil, buhuzial mi stale mi to vypysuje tu istu chybu. Ta hierchia je teraz dufam v poriadku – nastavenia common sa prepisu v production a tie sa prepisu developmentom – je tak?
Upraveny config.neon:
common:
php:
date.timezone: Europe/Bratislava
services:
authenticator:
class: \UsersAuthenticator
production < common:
parameters:
database:
driver: mysql
host: localhost
username: ***
password: ***
database: ***
profiler: FALSE
development < production:
parameters:
database:
username: ***
password: ***
database: ***
profiler: TRUE
lazy: TRUE
services:
connection:
class: DibiConnection
factory: dibi::connect(%database%)
run: TRUE
- RichardT
- Člen | 43
oukej, tak som sa rozhodol ze config maximalne zjednodusim a nehcam to v common, ale stale to nejde – rovnaka chyba. Da sa niekde pozriet co mi ten neon vygeneroval? napr ako pole?
jednocuchy neon.config:
common:
php:
date.timezone: Europe/Bratislava
parameters:
database:
driver: mysql
host: localhost
username: ***
password: ***
database: ***
profiler: FALSE
services:
authenticator:
class: \UsersAuthenticator
connection:
class: DibiConnection
factory: dibi::connect(%database%)
run: TRUE