ispCP - Board - Support
editing system created admin give data base error - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Development Area (/forum-1.html)
+--- Forum: Tickets / Roadmap / Timeline (/forum-50.html)
+--- Thread: editing system created admin give data base error (/thread-14102.html)



editing system created admin give data base error - eagles051387 - 06-02-2011 12:58 AM

hey guys im having an issue with ispcp 1.0.7 on centos 5.6. i had to make a few modifications to 3 installation scripts which were giving me grief on centos 5.6 and version 5.8 of perl. without those modifications installation woudl not have been successful.

the error im getting is

Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. - Query: SELECT `admin_id`, `created_by`, `admin_type` FROM `admin` WHERE `admin_id` = ? ;

what needs to be done to remedy the situation?


RE: editing system created admin give data base error - kilburn - 06-07-2011 04:14 AM

See this thread for a possible fix.


RE: editing system created admin give data base error - eagles051387 - 06-07-2011 05:06 AM

(06-07-2011 04:14 AM)kilburn Wrote:  See this thread for a possible fix.

i found that but what file should i be touching to fix the issue as it doesnt specify what file needs to be modified.


RE: editing system created admin give data base error - kilburn - 06-07-2011 04:21 PM

(05-15-2011 05:53 PM)kilburn Wrote:  I don't really understand the problem, but I think you can work-around it by searching for
Code:
$this->_db->setAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY, false);
in the ispcp gui sources (/var/www/ispcp/gui/include) and replacing it by
Code:
$this->_db->setAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY, true);
.

So you just had to search for that:
Code:
horus ~ # cd /var/www/ispcp/gui/include/
horus include # grep -R '$this->_db->setAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY, false);' *
ispCP/Database.php:                $this->_db->setAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY, false);

There you go, the file is "/var/www/ispcp/gui/include/ispCP/Database.php".


RE: editing system created admin give data base error - eagles051387 - 06-07-2011 04:29 PM

(06-07-2011 04:21 PM)kilburn Wrote:  
(05-15-2011 05:53 PM)kilburn Wrote:  I don't really understand the problem, but I think you can work-around it by searching for
Code:
$this->_db->setAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY, false);
in the ispcp gui sources (/var/www/ispcp/gui/include) and replacing it by
Code:
$this->_db->setAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY, true);
.

So you just had to search for that:
Code:
horus ~ # cd /var/www/ispcp/gui/include/
horus include # grep -R '$this->_db->setAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY, false);' *
ispCP/Database.php:                $this->_db->setAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY, false);

There you go, the file is "/var/www/ispcp/gui/include/ispCP/Database.php".


Mine is already set right but in that file it seems like there is an if else statement with thwhat you have above and the else returns a false, which seems to be where I end up.

to be honest im not 100% what that does, and what the ramifications would be if i were to set that to true.


RE: editing system created admin give data base error - kilburn - 06-08-2011 07:06 PM

I'm not 100% sure of what it does either, but it fixed the problem for another user (yes, you should change the else part, that is giving you the error). Furthermore, according to the error itself, it is safe to enable query buffering if you only run queries against mysql (and the panel does precisely that).


RE: editing system created admin give data base error - eagles051387 - 06-08-2011 07:07 PM

(06-08-2011 07:06 PM)kilburn Wrote:  I'm not 100% sure of what it does either, but it fixed the problem for another user (yes, you should change the else part, that is giving you the error). Furthermore, according to the error itself, it is safe to enable query buffering if you only run queries against mysql (and the panel does precisely that).

the only false statement there is i tested it and changed to true this morning and it wouldnt let me login. its like it cant query the database

is there a particular version of mysql i should be using im using 5.0.67 on centos 5.6


RE: editing system created admin give data base error - eagles051387 - 06-08-2011 11:36 PM

I have a strange fix. I managed to get ispcp successfully installed by excluding all 32bit apps via an exclude in yum. also i installed 5.5.13 mysql out of remi repo. the next major hack involved setting up a perlbrew environment and installing perl 5.14.0 and setting that in the .bashrc to start each time you login or reboot. i installed the necessary perl modules that ISPCP needs and then installed from there successfully.

Its a very nasty hack but you avoid the database issue above all together and no modifications to the installation scripts need to occur.