Elakdtam a Yiiki2-vel, segitseg kene
#1
Posted 19 July 2011 - 09:02 PM
Itt olyanoknak próbalok/próbalunk segítséget nyújtani, akik valamilyen oknál fogva elakadtak a Yiiki2 sorozat példa-alkalmazásával.
--iM
The maker rests. The wheel’s in motion.
-- Imre Madách
check out Yii Themes at http://yiithemes.mehesz.net
#2
Posted 29 July 2011 - 06:15 AM
én bizony elakadtam az adatbázis tábla migrációjánál
Ubuntu-t használok Oracle Virtuális gépen (VirtualBox), xampp-vel
a tbl_user-es alap tutorialt sikerült megcsinálnom
az adatbázisnak testdrive nevet adtam, ahogy a main.php-ban alapból be van állítva
az itteni sorozatban a migrációnál addig jutottam, hogy létrehoztam a m.....pages_tabla_letrehozasa.php fájlt
majd a ./protected/yiic migrate parancsnál ezt a hibaüzenetet kapom:
exception(CDbException) with message 'CDbConnection failed to open the DB connection could not find driver' in /opt/lampp/htdocs/yii/framework/db/CDbConnection.php:364
megnéztem, a YII_DEBUG változóval lehet a gond
az index.php-t pedig, ahol a YII_DEBUG definiálva van, a leírt módon átírtam
ha még valamit nem írtam le légyszi szólj
köszönöm: Laci
#3
Posted 29 July 2011 - 08:07 AM
tihanyilaci, on 29 July 2011 - 06:15 AM, said:
...
ha még valamit nem írtam le légyszi szólj
köszönöm: Laci
haho,
megmutatnad, hogy is nez ki a protected/config/console.php file-od?
(persze a jelszot meg a felh. nevet ne ird ide
--iM
The maker rests. The wheel’s in motion.
-- Imre Madách
check out Yii Themes at http://yiithemes.mehesz.net
#4
Posted 29 July 2011 - 08:26 AM
// This is the configuration for yiic console application.
// Any writable CConsoleApplication properties can be configured here.
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'My Console Application',
// application components
'components'=>array(
'db'=>array(
'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
),
// uncomment the following to use a MySQL database
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=testdrive',
'emulatePrepare' => true,
'username' => '',
'password' => '',
'charset' => 'utf8',
),
),
);
#5
Posted 29 July 2011 - 11:34 AM
tihanyilaci, on 29 July 2011 - 06:15 AM, said:
exception(CDbException) with message 'CDbConnection failed to open the DB connection could not find driver' in /opt/lampp/htdocs/yii/framework/db/CDbConnection.php:364
Két lehetséges hibaforrás:
- A parancssorból futtattott php scripteket nem a XAMPP php értelmezője dolgozza fel, hanem egy másik php executable. Ezt a "which php" paranccsal könnyen tudod ellenőrízni, ha nem stimmel, akkor a PATH-hez add hozzá a XAMPP megfelelő könyvtárát.
- A megfelelő php értelmező indul el, de parancssorból indítva nem ugyanazt a php.ini fájlt tölti be, mint amikor Apache alatt fut, és a parancssori php.ini-ben nincs engedélyezve a pdo_mysql extension. Ezt "php --ini" -vel ellenőrízheted.
#6
Posted 29 July 2011 - 01:04 PM
tihanyilaci, on 29 July 2011 - 08:26 AM, said:
// This is the configuration for yiic console application.
// Any writable CConsoleApplication properties can be configured here.
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'My Console Application',
// application components
'components'=>array(
'db'=>array(
'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
),
...
);
az adatbazis nevet meghagytad testdrive.db-nek? (mondjuk meg igy is mennie kene)
sajna nekem nincs Windows-os gepem, remelem sikerul kitalalni es akkor frissitenem a cikket, hogy a Windows-zal rendelkezok is hasznalni tudjak ...
--iM
The maker rests. The wheel’s in motion.
-- Imre Madách
check out Yii Themes at http://yiithemes.mehesz.net
#7
Posted 29 July 2011 - 01:05 PM
The maker rests. The wheel’s in motion.
-- Imre Madách
check out Yii Themes at http://yiithemes.mehesz.net
#9
Posted 31 July 2011 - 06:06 PM
tihanyilaci, on 30 July 2011 - 11:48 AM, said:
helló
mysql-t használok
igazából lampp (ha jól tudom, ugyanaz, mint az xampp)
akkor a virtuális gépen futtatott linuxom nem ugyanaz, mintha linux lenne telepítve a gépemre?
haho,
na akkor az a bibi, mert a console.php-ba meg mindig az sqlite-ot probalod elerni, es MySQL-t kell, ha inkabb azt akarod. (a peldaban azert hasznaltam sqlite-ot, mert nincs vele sok macera, de MySQL-lel is siman mennie kell.)
--iM
The maker rests. The wheel’s in motion.
-- Imre Madách
check out Yii Themes at http://yiithemes.mehesz.net
#10
Posted 03 October 2011 - 02:28 AM
nincs sqlite driver telepitve.
Ubuntun:
sudo apt-get install php5-sqlite
imehesz, on 31 July 2011 - 06:06 PM, said:
na akkor az a bibi, mert a console.php-ba meg mindig az sqlite-ot probalod elerni, es MySQL-t kell, ha inkabb azt akarod. (a peldaban azert hasznaltam sqlite-ot, mert nincs vele sok macera, de MySQL-lel is siman mennie kell.)
--iM

Help













