Bonjour à tous,
je viens de migrer mon serveur web vers un PHP5.3.3 car le 5.2 me poser des soucis au niveau exploitation.
Je développe l'ensemble de mes applications (intranet pour gestion) sous Zend (j'en ai profité pour passer au ZF1.11.1).
Le soucis est que pour l'une de mes applications je récupérais mes informations depuis une base SQLServer avec le PDO_MSSQL qui dans les version de php que j'utilise aujourd'hui n'est plus disponible.
Je me suis donc tourné vers SQLSRV.DLL de PHP et l'adapter SQLSRV sou ZF. Après avoir adapter mes fichier de configuration je ne parviens plus à travailler avec mes modèles faisant référence au bases MSSql alors qu'executer des requêtes directement dans mon code fonctionne.
Voici l'erreur retournée :
Voici mon controleur:An error occurred
Erreur dans l'application
Exception information:
Message: The mssql driver is not currently installed
Stack trace:
#0 C:\Zend\Apache2\htdocs\consultdsp\library\Zend\Db\Adapter\Pdo\Mssql.php(137): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 C:\Zend\Apache2\htdocs\consultdsp\library\Zend\Db\Adapter\Abstract.php(448): Zend_Db_Adapter_Pdo_Mssql->_connect()
#2 C:\Zend\Apache2\htdocs\consultdsp\library\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('exec sp_columns...', Array)
#3 C:\Zend\Apache2\htdocs\consultdsp\library\Zend\Db\Adapter\Pdo\Mssql.php(237): Zend_Db_Adapter_Pdo_Abstract->query('exec sp_columns...')
#4 C:\Zend\Apache2\htdocs\consultdsp\library\Zend\Db\Table\Abstract.php(823): Zend_Db_Adapter_Pdo_Mssql->describeTable('TBL_PORTS', NULL)
#5 C:\Zend\Apache2\htdocs\consultdsp\library\Zend\Db\Table\Abstract.php(845): Zend_Db_Table_Abstract->_setupMetadata()
#6 C:\Zend\Apache2\htdocs\consultdsp\library\Zend\Db\Table\Abstract.php(885): Zend_Db_Table_Abstract->_getCols()
#7 C:\Zend\Apache2\htdocs\consultdsp\library\Zend\Db\Table\Abstract.php(969): Zend_Db_Table_Abstract->_setupPrimaryKey()
#8 C:\Zend\Apache2\htdocs\consultdsp\library\Zend\Db\Table\Select.php(100): Zend_Db_Table_Abstract->info()
#9 C:\Zend\Apache2\htdocs\consultdsp\library\Zend\Db\Table\Select.php(78): Zend_Db_Table_Select->setTable(Object(Tblports))
#10 C:\Zend\Apache2\htdocs\consultdsp\library\Zend\Db\Table\Abstract.php(1005): Zend_Db_Table_Select->__construct(Object(Tblports))
#11 C:\Zend\Apache2\htdocs\consultdsp\library\Zend\Db\Table\Abstract.php(1303): Zend_Db_Table_Abstract->select()
#12 C:\Zend\Apache2\htdocs\consultdsp\application\controllers\BateauController.php(45): Zend_Db_Table_Abstract->fetchAll(NULL, 'po_id')
#13 C:\Zend\Apache2\htdocs\consultdsp\library\Zend\Controller\Action.php(513): BateauController->portAction()
#14 C:\Zend\Apache2\htdocs\consultdsp\library\Zend\Controller\Dispatcher\Standard.php(295): Zend_Controller_Action->dispatch('portAction')
#15 C:\Zend\Apache2\htdocs\consultdsp\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#16 C:\Zend\Apache2\htdocs\consultdsp\index.php(44): Zend_Controller_Front->dispatch()
#17 {main}Request Parameters:
array(3) {
["controller"]=>
string(6) "Bateau"
["action"]=>
string(4) "port"
["module"]=>
string(7) "default"
}
sachant que l'erreur à lieu sur cette ligne :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65 public function acheteurAction(){ $this->view->title=utf8_encode("Liste des acheteurs"); $montri=""; if ($this->_getParam('tri')!=null) { $montri=$this->_getParam('tri'); if($montri=="ac_type"){ $tri=array("ac_type","ac_entite","ac_nom"); $listetri=array("ac_type","ac_entite","ac_nom"); } if($montri=="ac_entite"){ $tri=array("ac_entite","ac_nom"); $listetri=array("ac_entite","ac_nom"); } if($montri=="ac_nom"){ $tri="ac_nom"; $listetri="ac_nom"; } }else{ $tri=array("ac_type","ac_entite","ac_nom"); $listetri=array("ac_type","ac_entite","ac_nom"); } if ($this->_getParam('filtre')!=null && $this->_getParam('filtre')!="" ) { $where="ac_type=".$this->_getParam('filtre')." "; $filtre=$this->_getParam('filtre'); }else{ $where="1=1"; $filtre=""; } if ($this->_getParam('filtre2')!=null && $this->_getParam('filtre2')!="" ) { if($this->_getParam('filtre2')==0) $where2=" and ac_date_fermeture IS NULL"; if($this->_getParam('filtre2')==1) $where2=" and ac_date_fermeture IS NOT NULL"; $filtre2=$this->_getParam('filtre2'); }else{ $where2=""; $filtre2=""; } $dbmssql = Zend_Registry::get('dbmssql'); $requete2 = $dbmssql->query('SELECT distinct(ac_type), ta_nom FROM dbo.TBL_ACHETEUR WITH(NOLOCK) INNER JOIN dbo.TBL_TYPE_ACHETEUR WITH(NOLOCK) ON ac_type=ta_code ORDER BY ta_nom;'); $resultat2=$requete2->fetchAll(); $this->view->types=$resultat2; $requete3 = $dbmssql->query('SELECT distinct(ac_entite)FROM dbo.TBL_ACHETEUR WITH(NOLOCK);'); $resultat3=$requete3->fetchAll(); $this->view->entites=$resultat3; $this->view->tri=$montri; $this->view->filtre=$filtre; $this->view->filtre2=$filtre2; $acheteurs=new Tblacheteur(); $acheteurs=$acheteurs->fetchAll($where.$where2,$listetri); $page = Zend_Paginator::factory($acheteurs); $page->setPageRange(5); $page->setCurrentPageNumber($this->_getParam('page', 1)); $page->setItemCountPerPage($this->_getParam('par', 25)); $this->view->acheteurs = $page; $this->render(); }Tout ceci fonctionné avant la migration de PHP lorsque j'utilisais PDO_MSSQL donc je pense que cela vient du fait que maintenant j'utilise SQLSRV. Je répéte que des requetes directes dans mon controleur fonctionnent ma configuration est donc ok.
Code : Sélectionner tout - Visualiser dans une fenêtre à part $acheteurs=$acheteurs->fetchAll($where.$where2,$listetri);
Si quelqu'un aurait des solution à me fournir pour que mes objets refonctionnent car j'ai le même problème sur une dizaine de pages.
Merci d'avance
Partager