Re: can't connect to db
I hope its ok that I poste here instead of opening a new question. I also can't connect to the (mysql) db. I can login via mysql command line tool, so the user rights are ok. I checked phpinfo(); - mysql_pdo is installed with version 5.5.14 and enabled. Am I missing something? -flosky On 6 Nov., 03:02, Sandy Wilkins sandy.wilkins...@gmail.com wrote: Is the DocumentRoot of your http.conf pointing to the webroot folder? On Nov 5, 7:55 pm, bluethundr bluethu...@gmail.com wrote: ## cake cannot connect to the databse Your tmp directory is writable. The FileEngine is being used for caching. To change the config edit APP/config/core.php Your database configuration file is present. Cake is NOT able to connect to the database. ## database config file class DATABASE_CONFIG { var $default = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cake', 'prefix' = '', 'port' = '/var/lib/mysql/mysql.sock', //'encoding' = 'utf8', ); var $test = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cakeblog', 'prefix' = '', 'port' = '/var/lib/mysql/mysql.sock', //'encoding' = 'utf8', ); } ## user can connect to (and use) database on the command line [root@cloud cake]# mysql -uadmin -psecret Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.5.17-log MySQL Community Server (GPL) by Remi Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql use cake Database changed thank you! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: can't connect to db
I just tried to set the db config via the cake shell and got this error message at the end: Fatal error: Class 'DATABASE_CONFIG' not found in /home/flosky/ Workspace/wtg2/lib/Cake/Console/Command/Task/DbConfigTask.php on line 262 Does anyone know what that means? -flosky -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: can't connect to db
Ok, got it now. When I deleted the comments header of the database.php file I also deleted the '?php'. Silly me. -flosky -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: can't connect to db
Is the DocumentRoot of your http.conf pointing to the webroot folder? On Nov 5, 7:55 pm, bluethundr bluethu...@gmail.com wrote: ## cake cannot connect to the databse Your tmp directory is writable. The FileEngine is being used for caching. To change the config edit APP/config/core.php Your database configuration file is present. Cake is NOT able to connect to the database. ## database config file class DATABASE_CONFIG { var $default = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cake', 'prefix' = '', 'port' = '/var/lib/mysql/mysql.sock', //'encoding' = 'utf8', ); var $test = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cakeblog', 'prefix' = '', 'port' = '/var/lib/mysql/mysql.sock', //'encoding' = 'utf8', ); } ## user can connect to (and use) database on the command line [root@cloud cake]# mysql -uadmin -psecret Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.5.17-log MySQL Community Server (GPL) by Remi Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql use cake Database changed thank you! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: can't connect to db
Most likely you need to leave the port section empty in your db configuration On Sat, Nov 5, 2011 at 9:55 PM, bluethundr bluethu...@gmail.com wrote: ## cake cannot connect to the databse Your tmp directory is writable. The FileEngine is being used for caching. To change the config edit APP/config/core.php Your database configuration file is present. Cake is NOT able to connect to the database. ## database config file class DATABASE_CONFIG { var $default = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cake', 'prefix' = '', 'port' = '/var/lib/mysql/mysql.sock', //'encoding' = 'utf8', ); var $test = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cakeblog', 'prefix' = '', 'port' = '/var/lib/mysql/mysql.sock', //'encoding' = 'utf8', ); } ## user can connect to (and use) database on the command line [root@cloud cake]# mysql -uadmin -psecret Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.5.17-log MySQL Community Server (GPL) by Remi Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql use cake Database changed thank you! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: can't connect to db
Hello and thanks for your reply.. I tried removing the port setting as you've suggested and moved from cake 1.3 to cake 2.0 but the result was the same! class DATABASE_CONFIG { public $default = array( 'datasource' = 'Database/Mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cake', 'prefix' = '', //'encoding' = 'utf8', ); public $test = array( 'datasource' = 'Database/Mysql', 'persistent' = false, 'host' = 'admin', 'login' = 'root', 'password' = 'secret', 'database' = 'cakeblog', 'prefix' = '', //'encoding' = 'utf8', ); } On Sat, Nov 5, 2011 at 10:03 PM, Ma'moon phpir...@gmail.com wrote: Most likely you need to leave the port section empty in your db configuration On Sat, Nov 5, 2011 at 9:55 PM, bluethundr bluethu...@gmail.com wrote: ## cake cannot connect to the databse Your tmp directory is writable. The FileEngine is being used for caching. To change the config edit APP/config/core.php Your database configuration file is present. Cake is NOT able to connect to the database. ## database config file class DATABASE_CONFIG { var $default = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cake', 'prefix' = '', 'port' = '/var/lib/mysql/mysql.sock', //'encoding' = 'utf8', ); var $test = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cakeblog', 'prefix' = '', 'port' = '/var/lib/mysql/mysql.sock', //'encoding' = 'utf8', ); } ## user can connect to (and use) database on the command line [root@cloud cake]# mysql -uadmin -psecret Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.5.17-log MySQL Community Server (GPL) by Remi Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql use cake Database changed thank you! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- GPG me!! gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: can't connect to db
Maybe php5-mysql support not enabled ? You could try a plain php file to test without cakephp ?php mysql_connect(localhost, admin, secret) or die(mysql_error()); echo Connected to MySQLbr /; mysql_select_db(cake) or die(mysql_error()); echo Connected to Database; ? 'Andras Kende http://www.kende.com On Nov 5, 2011, at 10:25 PM, Tim Dunphy wrote: Hello and thanks for your reply.. I tried removing the port setting as you've suggested and moved from cake 1.3 to cake 2.0 but the result was the same! class DATABASE_CONFIG { public $default = array( 'datasource' = 'Database/Mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cake', 'prefix' = '', //'encoding' = 'utf8', ); public $test = array( 'datasource' = 'Database/Mysql', 'persistent' = false, 'host' = 'admin', 'login' = 'root', 'password' = 'secret', 'database' = 'cakeblog', 'prefix' = '', //'encoding' = 'utf8', ); } On Sat, Nov 5, 2011 at 10:03 PM, Ma'moon phpir...@gmail.com wrote: Most likely you need to leave the port section empty in your db configuration On Sat, Nov 5, 2011 at 9:55 PM, bluethundr bluethu...@gmail.com wrote: ## cake cannot connect to the databse Your tmp directory is writable. The FileEngine is being used for caching. To change the config edit APP/config/core.php Your database configuration file is present. Cake is NOT able to connect to the database. ## database config file class DATABASE_CONFIG { var $default = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cake', 'prefix' = '', 'port' = '/var/lib/mysql/mysql.sock', //'encoding' = 'utf8', ); var $test = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cakeblog', 'prefix' = '', 'port' = '/var/lib/mysql/mysql.sock', //'encoding' = 'utf8', ); } ## user can connect to (and use) database on the command line [root@cloud cake]# mysql -uadmin -psecret Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.5.17-log MySQL Community Server (GPL) by Remi Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql use cake Database changed thank you! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- GPG me!! gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: can't connect to db
Thanks for that! It seems that php can't find it's pdo librarries [root@cloud cake]# php mysql.php PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_mysql.so' - /usr/lib64/php/modules/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: Module 'PDO' already loaded in Unknown on line 0 PHP Fatal error: Call to undefined function mysql_connect() in /var/www/cakephp-cakephp-73205dc/mysql.php on line 2 I can't ls the module file [root@cloud cake]# ls -l /usr/lib64/php/modules/pdo_mysql.so ls: /usr/lib64/php/modules/pdo_mysql.so: No such file or directory But the rpm database tells me that php-pdo is already installed. [root@cloud cake]# rpmquery php-pdo php-pdo-5.3.8-5.el5.remi.1 so what gives? :) On Sat, Nov 5, 2011 at 11:38 PM, Andras Kende and...@kende.com wrote: Maybe php5-mysql support not enabled ? You could try a plain php file to test without cakephp ?php mysql_connect(localhost, admin, secret) or die(mysql_error()); echo Connected to MySQLbr /; mysql_select_db(cake) or die(mysql_error()); echo Connected to Database; ? 'Andras Kende http://www.kende.com On Nov 5, 2011, at 10:25 PM, Tim Dunphy wrote: Hello and thanks for your reply.. I tried removing the port setting as you've suggested and moved from cake 1.3 to cake 2.0 but the result was the same! class DATABASE_CONFIG { public $default = array( 'datasource' = 'Database/Mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cake', 'prefix' = '', //'encoding' = 'utf8', ); public $test = array( 'datasource' = 'Database/Mysql', 'persistent' = false, 'host' = 'admin', 'login' = 'root', 'password' = 'secret', 'database' = 'cakeblog', 'prefix' = '', //'encoding' = 'utf8', ); } On Sat, Nov 5, 2011 at 10:03 PM, Ma'moon phpir...@gmail.com wrote: Most likely you need to leave the port section empty in your db configuration On Sat, Nov 5, 2011 at 9:55 PM, bluethundr bluethu...@gmail.com wrote: ## cake cannot connect to the databse Your tmp directory is writable. The FileEngine is being used for caching. To change the config edit APP/config/core.php Your database configuration file is present. Cake is NOT able to connect to the database. ## database config file class DATABASE_CONFIG { var $default = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cake', 'prefix' = '', 'port' = '/var/lib/mysql/mysql.sock', //'encoding' = 'utf8', ); var $test = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cakeblog', 'prefix' = '', 'port' = '/var/lib/mysql/mysql.sock', //'encoding' = 'utf8', ); } ## user can connect to (and use) database on the command line [root@cloud cake]# mysql -uadmin -psecret Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.5.17-log MySQL Community Server (GPL) by Remi Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql use cake Database changed thank you! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- GPG me!! gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new
Re: can't connect to db
ok, update. so I decided to ls the php modules directory [root@cloud cake]# ls -l /usr/lib64/php/modules/ total 2392 -rwxr-xr-x 1 root root 63008 Sep 30 14:14 curl.so -rwxr-xr-x 1 root root 1838496 Sep 30 14:14 fileinfo.so -rwxr-xr-x 1 root root 32984 Sep 30 14:14 json.so -rwxr-xr-x 1 root root 98312 Sep 30 14:14 pdo.so -rwxr-xr-x 1 root root 24264 Sep 30 14:14 pdo_sqlite.so -rwxr-xr-x 1 root root 257440 Sep 30 14:14 phar.so -rwxr-xr-x 1 root root 15416 Mar 30 2011 phpcups.so -rwxr-xr-x 1 root root 82112 Sep 30 14:14 zip.so and saw that pdo.so was there. so I got rid of pdo_mysql.so from the extension=php.ini file and left extension=pdo.so in there. then I restarted apache. and now this is what happens when I run the mysql connect script you've provided: [root@cloud cake]# php mysql.php PHP Warning: Module 'PDO' already loaded in Unknown on line 0 PHP Fatal error: Call to undefined function mysql_connect() in /var/www/cakephp-cakephp-73205dc/mysql.php on line 2 any thoughts? thanks! On Sat, Nov 5, 2011 at 11:48 PM, Tim Dunphy bluethu...@gmail.com wrote: Thanks for that! It seems that php can't find it's pdo librarries [root@cloud cake]# php mysql.php PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_mysql.so' - /usr/lib64/php/modules/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: Module 'PDO' already loaded in Unknown on line 0 PHP Fatal error: Call to undefined function mysql_connect() in /var/www/cakephp-cakephp-73205dc/mysql.php on line 2 I can't ls the module file [root@cloud cake]# ls -l /usr/lib64/php/modules/pdo_mysql.so ls: /usr/lib64/php/modules/pdo_mysql.so: No such file or directory But the rpm database tells me that php-pdo is already installed. [root@cloud cake]# rpmquery php-pdo php-pdo-5.3.8-5.el5.remi.1 so what gives? :) On Sat, Nov 5, 2011 at 11:38 PM, Andras Kende and...@kende.com wrote: Maybe php5-mysql support not enabled ? You could try a plain php file to test without cakephp ?php mysql_connect(localhost, admin, secret) or die(mysql_error()); echo Connected to MySQLbr /; mysql_select_db(cake) or die(mysql_error()); echo Connected to Database; ? 'Andras Kende http://www.kende.com On Nov 5, 2011, at 10:25 PM, Tim Dunphy wrote: Hello and thanks for your reply.. I tried removing the port setting as you've suggested and moved from cake 1.3 to cake 2.0 but the result was the same! class DATABASE_CONFIG { public $default = array( 'datasource' = 'Database/Mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cake', 'prefix' = '', //'encoding' = 'utf8', ); public $test = array( 'datasource' = 'Database/Mysql', 'persistent' = false, 'host' = 'admin', 'login' = 'root', 'password' = 'secret', 'database' = 'cakeblog', 'prefix' = '', //'encoding' = 'utf8', ); } On Sat, Nov 5, 2011 at 10:03 PM, Ma'moon phpir...@gmail.com wrote: Most likely you need to leave the port section empty in your db configuration On Sat, Nov 5, 2011 at 9:55 PM, bluethundr bluethu...@gmail.com wrote: ## cake cannot connect to the databse Your tmp directory is writable. The FileEngine is being used for caching. To change the config edit APP/config/core.php Your database configuration file is present. Cake is NOT able to connect to the database. ## database config file class DATABASE_CONFIG { var $default = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cake', 'prefix' = '', 'port' = '/var/lib/mysql/mysql.sock', //'encoding' = 'utf8', ); var $test = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cakeblog', 'prefix' = '', 'port' = '/var/lib/mysql/mysql.sock', //'encoding' = 'utf8', ); } ## user can connect to (and use) database on the command line [root@cloud cake]# mysql -uadmin -psecret Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.5.17-log MySQL Community Server (GPL) by Remi Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may
Re: can't connect to db
I think you need mysql.so extension for the cake 1.3 and pdo_mysql.so for cake 2.0 Just paste the errors into google, the answer should be there somewhere... http://www.somacon.com/p109.php Andras Kende http://www.kende.com On Nov 5, 2011, at 10:52 PM, Tim Dunphy wrote: ok, update. so I decided to ls the php modules directory [root@cloud cake]# ls -l /usr/lib64/php/modules/ total 2392 -rwxr-xr-x 1 root root 63008 Sep 30 14:14 curl.so -rwxr-xr-x 1 root root 1838496 Sep 30 14:14 fileinfo.so -rwxr-xr-x 1 root root 32984 Sep 30 14:14 json.so -rwxr-xr-x 1 root root 98312 Sep 30 14:14 pdo.so -rwxr-xr-x 1 root root 24264 Sep 30 14:14 pdo_sqlite.so -rwxr-xr-x 1 root root 257440 Sep 30 14:14 phar.so -rwxr-xr-x 1 root root 15416 Mar 30 2011 phpcups.so -rwxr-xr-x 1 root root 82112 Sep 30 14:14 zip.so and saw that pdo.so was there. so I got rid of pdo_mysql.so from the extension=php.ini file and left extension=pdo.so in there. then I restarted apache. and now this is what happens when I run the mysql connect script you've provided: [root@cloud cake]# php mysql.php PHP Warning: Module 'PDO' already loaded in Unknown on line 0 PHP Fatal error: Call to undefined function mysql_connect() in /var/www/cakephp-cakephp-73205dc/mysql.php on line 2 any thoughts? thanks! On Sat, Nov 5, 2011 at 11:48 PM, Tim Dunphy bluethu...@gmail.com wrote: Thanks for that! It seems that php can't find it's pdo librarries [root@cloud cake]# php mysql.php PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_mysql.so' - /usr/lib64/php/modules/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: Module 'PDO' already loaded in Unknown on line 0 PHP Fatal error: Call to undefined function mysql_connect() in /var/www/cakephp-cakephp-73205dc/mysql.php on line 2 I can't ls the module file [root@cloud cake]# ls -l /usr/lib64/php/modules/pdo_mysql.so ls: /usr/lib64/php/modules/pdo_mysql.so: No such file or directory But the rpm database tells me that php-pdo is already installed. [root@cloud cake]# rpmquery php-pdo php-pdo-5.3.8-5.el5.remi.1 so what gives? :) On Sat, Nov 5, 2011 at 11:38 PM, Andras Kende and...@kende.com wrote: Maybe php5-mysql support not enabled ? You could try a plain php file to test without cakephp ?php mysql_connect(localhost, admin, secret) or die(mysql_error()); echo Connected to MySQLbr /; mysql_select_db(cake) or die(mysql_error()); echo Connected to Database; ? 'Andras Kende http://www.kende.com On Nov 5, 2011, at 10:25 PM, Tim Dunphy wrote: Hello and thanks for your reply.. I tried removing the port setting as you've suggested and moved from cake 1.3 to cake 2.0 but the result was the same! class DATABASE_CONFIG { public $default = array( 'datasource' = 'Database/Mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cake', 'prefix' = '', //'encoding' = 'utf8', ); public $test = array( 'datasource' = 'Database/Mysql', 'persistent' = false, 'host' = 'admin', 'login' = 'root', 'password' = 'secret', 'database' = 'cakeblog', 'prefix' = '', //'encoding' = 'utf8', ); } On Sat, Nov 5, 2011 at 10:03 PM, Ma'moon phpir...@gmail.com wrote: Most likely you need to leave the port section empty in your db configuration On Sat, Nov 5, 2011 at 9:55 PM, bluethundr bluethu...@gmail.com wrote: ## cake cannot connect to the databse Your tmp directory is writable. The FileEngine is being used for caching. To change the config edit APP/config/core.php Your database configuration file is present. Cake is NOT able to connect to the database. ## database config file class DATABASE_CONFIG { var $default = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cake', 'prefix' = '', 'port' = '/var/lib/mysql/mysql.sock', //'encoding' = 'utf8', ); var $test = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cakeblog', 'prefix' = '', 'port' = '/var/lib/mysql/mysql.sock', //'encoding' = 'utf8', ); } ## user can connect to (and use) database on the command line [root@cloud cake]# mysql -uadmin
Re: can't connect to db
whoops! silly me! I forgot to install the php-mysql extension! I did that and now it's working. So thanks for your help! tim On Sun, Nov 6, 2011 at 12:04 AM, Andras Kende and...@kende.com wrote: I think you need mysql.so extension for the cake 1.3 and pdo_mysql.so for cake 2.0 Just paste the errors into google, the answer should be there somewhere... http://www.somacon.com/p109.php Andras Kende http://www.kende.com On Nov 5, 2011, at 10:52 PM, Tim Dunphy wrote: ok, update. so I decided to ls the php modules directory [root@cloud cake]# ls -l /usr/lib64/php/modules/ total 2392 -rwxr-xr-x 1 root root 63008 Sep 30 14:14 curl.so -rwxr-xr-x 1 root root 1838496 Sep 30 14:14 fileinfo.so -rwxr-xr-x 1 root root 32984 Sep 30 14:14 json.so -rwxr-xr-x 1 root root 98312 Sep 30 14:14 pdo.so -rwxr-xr-x 1 root root 24264 Sep 30 14:14 pdo_sqlite.so -rwxr-xr-x 1 root root 257440 Sep 30 14:14 phar.so -rwxr-xr-x 1 root root 15416 Mar 30 2011 phpcups.so -rwxr-xr-x 1 root root 82112 Sep 30 14:14 zip.so and saw that pdo.so was there. so I got rid of pdo_mysql.so from the extension=php.ini file and left extension=pdo.so in there. then I restarted apache. and now this is what happens when I run the mysql connect script you've provided: [root@cloud cake]# php mysql.php PHP Warning: Module 'PDO' already loaded in Unknown on line 0 PHP Fatal error: Call to undefined function mysql_connect() in /var/www/cakephp-cakephp-73205dc/mysql.php on line 2 any thoughts? thanks! On Sat, Nov 5, 2011 at 11:48 PM, Tim Dunphy bluethu...@gmail.com wrote: Thanks for that! It seems that php can't find it's pdo librarries [root@cloud cake]# php mysql.php PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_mysql.so' - /usr/lib64/php/modules/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: Module 'PDO' already loaded in Unknown on line 0 PHP Fatal error: Call to undefined function mysql_connect() in /var/www/cakephp-cakephp-73205dc/mysql.php on line 2 I can't ls the module file [root@cloud cake]# ls -l /usr/lib64/php/modules/pdo_mysql.so ls: /usr/lib64/php/modules/pdo_mysql.so: No such file or directory But the rpm database tells me that php-pdo is already installed. [root@cloud cake]# rpmquery php-pdo php-pdo-5.3.8-5.el5.remi.1 so what gives? :) On Sat, Nov 5, 2011 at 11:38 PM, Andras Kende and...@kende.com wrote: Maybe php5-mysql support not enabled ? You could try a plain php file to test without cakephp ?php mysql_connect(localhost, admin, secret) or die(mysql_error()); echo Connected to MySQLbr /; mysql_select_db(cake) or die(mysql_error()); echo Connected to Database; ? 'Andras Kende http://www.kende.com On Nov 5, 2011, at 10:25 PM, Tim Dunphy wrote: Hello and thanks for your reply.. I tried removing the port setting as you've suggested and moved from cake 1.3 to cake 2.0 but the result was the same! class DATABASE_CONFIG { public $default = array( 'datasource' = 'Database/Mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cake', 'prefix' = '', //'encoding' = 'utf8', ); public $test = array( 'datasource' = 'Database/Mysql', 'persistent' = false, 'host' = 'admin', 'login' = 'root', 'password' = 'secret', 'database' = 'cakeblog', 'prefix' = '', //'encoding' = 'utf8', ); } On Sat, Nov 5, 2011 at 10:03 PM, Ma'moon phpir...@gmail.com wrote: Most likely you need to leave the port section empty in your db configuration On Sat, Nov 5, 2011 at 9:55 PM, bluethundr bluethu...@gmail.com wrote: ## cake cannot connect to the databse Your tmp directory is writable. The FileEngine is being used for caching. To change the config edit APP/config/core.php Your database configuration file is present. Cake is NOT able to connect to the database. ## database config file class DATABASE_CONFIG { var $default = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cake', 'prefix' = '', 'port' = '/var/lib/mysql/mysql.sock', //'encoding' = 'utf8', ); var $test = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'admin', 'password' = 'secret', 'database' = 'cakeblog', 'prefix' =