Yii Framework Forum: [solved]eror gara2 migrasi ke ubuntu - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[solved]eror gara2 migrasi ke ubuntu Rate Topic: -----

#1 User is offline   ressaince 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 163
  • Joined: 10-January 11
  • Location:Jakarta

Posted 16 January 2011 - 07:15 AM

im migrating from windows to ubuntu..
i installed my yii and run my program.it is ok until i try to login / perform action which is related to models
i found this error ...
PHP Error
Description

PDO::__construct() [<a href='pdo.--construct'>pdo.--construct</a>]: [2002] Invalid argument (trying to connect via unix://)
Source File

/opt/lampp/htdocs/yii-1.1.5.r2654/framework/db/CDbConnection.php(310)

00298:      * @since 1.0.4
00299:      */
00300:     protected function createPdoInstance()
00301:     {
00302:         $pdoClass='PDO';
00303:         if(($pos=strpos($this->connectionString,':'))!==false)
00304:         {
00305:             $driver=strtolower(substr($this->connectionString,0,$pos));
00306:             if($driver==='mssql' || $driver==='dblib')
00307:                 $pdoClass='CMssqlPdoAdapter';
00308:         }
00309:         return new $pdoClass($this->connectionString,$this->username,
00310: $this->password,$this->_attributes);
00311:     }
00312: 
00313:     /**
00314:      * Initializes the open db connection.
00315:      * This method is invoked right after the db connection is established.
00316:      * The default implementation is to set the charset for MySQL and PostgreSQL database connections.
00317:      * @param PDO $pdo the PDO instance
00318:      */
00319:     protected function initConnection($pdo)
00320:     {
00321:         $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
00322:         if($this->emulatePrepare && constant('PDO::ATTR_EMULATE_PREPARES'))

Stack Trace

#0 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/db/CDbConnection.php(310): PDO->__construct()
#1 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/db/CDbConnection.php(261): CDbConnection->createPdoInstance()
#2 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/db/CDbConnection.php(242): CDbConnection->open()
#3 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/db/CDbConnection.php(221): CDbConnection->setActive()
#4 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/base/CModule.php(372): CDbConnection->init()
#5 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/base/CApplication.php(406): CWebApplication->getComponent()
#6 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/db/ar/CActiveRecord.php(589): CWebApplication->getDb()
#7 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/db/ar/CActiveRecord.php(2167): ProductIntegration->getDbConnection()
#8 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/db/ar/CActiveRecord.php(353): CActiveRecordMetaData->__construct()
#9 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/web/CActiveDataProvider.php(63): model()
#10 /opt/lampp/htdocs/integrated_system/protected/controllers/ProductIntegrationController.php(147): CActiveDataProvider->__construct()
#11 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/web/actions/CInlineAction.php(57): ProductIntegrationController->actionIndex()
#12 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/web/CController.php(300): CInlineAction->run()
#13 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/web/filters/CFilterChain.php(133): ProductIntegrationController->runAction()
#14 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/web/filters/CFilter.php(41): CFilterChain->run()
#15 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/web/CController.php(1084): CAccessControlFilter->filter()
#16 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/web/filters/CInlineFilter.php(59): ProductIntegrationController->filterAccessControl()
#17 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/web/filters/CFilterChain.php(130): CInlineFilter->filter()
#18 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/web/CController.php(283): CFilterChain->run()
#19 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/web/CController.php(257): ProductIntegrationController->runActionWithFilters()
#20 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/web/CWebApplication.php(324): ProductIntegrationController->run()
#21 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/web/CWebApplication.php(121): CWebApplication->runController()
#22 /opt/lampp/htdocs/yii-1.1.5.r2654/framework/base/CApplication.php(135): CWebApplication->processRequest()
#23 /opt/lampp/htdocs/integrated_system/index.php(13): CWebApplication->run()



i don't know how to fix this,i think yii can't open connection
please help me
thanks

maap yak pake bahasa inggris,hehe
take it or leave it
0

#2 User is offline   nasrul 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 98
  • Joined: 14-April 09
  • Location:Sorowako - Indonesia

Posted 16 January 2011 - 10:21 AM

mungkin bisa attach sreenshoot yii requirementnya? http://localhost/pat...i/requirements/

coba cek apa udah install pdo?

kalau di ubuntu saya biasa pake Synaptic Package Manager:
- pilih menu system pada taskbar
- pada submenu Administration, pilih Synaptic Package Manager
- masukkan password root
- ketikkan pdo pada Quick search
- centang item pdo yang sesuai database yang mas pakai, misal php5-mysql.
- kemudian pilih apply
1

#3 User is offline   -=YiieRz=- 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 177
  • Joined: 27-October 10
  • Location:Jakarta

Posted 16 January 2011 - 09:20 PM

View Postnasrul, on 16 January 2011 - 10:21 AM, said:

mungkin bisa attach sreenshoot yii requirementnya? http://localhost/pat...i/requirements/

coba cek apa udah install pdo?

kalau di ubuntu saya biasa pake Synaptic Package Manager:
- pilih menu system pada taskbar
- pada submenu Administration, pilih Synaptic Package Manager
- masukkan password root
- ketikkan pdo pada Quick search
- centang item pdo yang sesuai database yang mas pakai, misal php5-mysql.
- kemudian pilih apply


Setuju ane dengan jawaban bang nasrul.
belajar itu modal utama, tanpa percobaan itu tak akan berhasil. berdoa itu membuat kita percaya diri. YiieRz-SdgBlajar
www.yiiframework.com
0

#4 User is offline   ressaince 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 163
  • Joined: 10-January 11
  • Location:Jakarta

Posted 17 January 2011 - 12:37 AM

udah ke solve bang..
makasih yee bang..

jadi di konfigurasi dbconnectionya tambahin socket mysql
atau hostnya dii ganti ke 127.0.0.1

makasih balasannya


respect bro
take it or leave it
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users