ejd32 Posted December 14, 2003 Posted December 14, 2003 Hi there, I am having problems with database connections. I am a Java dev and dont know any php so am struggling a little with this one and would appreciate a little assistence if someone is so kinod to offer it ;-) I am using Red Hat 9, running Apache 2.0.4 (the default install that comes with Red Hat). php is working so I assume the libphp4.so module is all that is required. When I run /catalog/install I get the welcome screen, leave the defaults set and continue to the Database Import screen. I have mySql (version 3.23.54) setup allready for my Tomcat apps. I have set up a new user called "oscommerce" with password "oscommerce" and full grant privileges to * as follows: GRANT ALL PRIVILEGES ON *.* TO oscommerce@localhost IDENTIFIED BY 'oscommerce' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON *.* TO oscommerce@'%' IDENTIFIED BY 'oscommerce' WITH GRANT OPTION; I have tested this in my java apps really thoroughly (i.e. mispelling username or password) and the connection works fine. I have set up a new database called osCommerce in mysql. I an using the following on the Database Import screen: Database Server: localhost Username: oscommerce Password: oscommerce Database Name: osCommerce Persistant connections: left blank Session storage: files and when I click continue I only get about 1/3 of the next screen displaying. I have tried a bunch of different options and in the end decided to have a crack at the manual config as the database connections dont seem to work. So I have chmod 777'd the config files and set them up as follows (I'll only include the DB stuff here): catalog/admin/includes/configure.php: // define our database connection define('DB_SERVER', 'localhost'); define('DB_SERVER_USERNAME', 'oscommerce'); define('DB_SERVER_PASSWORD', 'oscommerce'); define('DB_DATABASE', 'osCommerce'); define('USE_PCONNECT', 'false'); define('STORE_SESSIONS', ''); catalog/includes/configure.php define('DB_SERVER', 'localhost'); define('DB_SERVER_USERNAME', 'oscommerce'); define('DB_SERVER_PASSWORD', 'oscommerce'); define('DB_DATABASE', 'osCommerce'); define('USE_PCONNECT', 'false'); define('STORE_SESSIONS', ''); I have also imported all the database as follows: mysqladmin create osCommerce mysql osCommerce < ./install/oscommerce.sql and this worked fine and I can see data when logged in as mysql user oscommerce. Now when I direct by browser at /catalog I get the following error: Fatal error: Call to undefined function: mysql_connect() in /var/www/html/catalog/includes/functions/database.php on line 19 Looking at /var/www/html/catalog/includes/functions/database.php on line 19 there is a call $$link = mysql_connect($server, $username, $password); I take it from the error message that mysql_connect is not found or defined. Doing a search for the definition of this function returns nothing: root@thor www]# find . -exec grep -il "function mysql_connect" {} \; [root@thor www]# yet is is called in four places [root@thor www]# find . -exec grep -il "mysql_connect" {} \; ./html/catalog/admin/includes/functions/database.php ./html/catalog/includes/functions/cache.php ./html/catalog/includes/functions/database.php ./html/catalog/install/includes/functions/database.php Am I missing something here? I dont know any php but it seems a bit odd calling a function that doesnt seem to exist.. So I guess I have two issues that hopefully someone can help with: 1. Any ideas why the install web app doesnt seem to work for me? 2. How come the database.php script seems to be calling a function that doesnt seem to exist? Thanks :-)
241 Posted December 14, 2003 Posted December 14, 2003 try changing this define('STORE_SESSIONS', ''); to this in the configs define('STORE_SESSIONS', 'mysql'); No longer giving free advice. Please place deposit in meter slot provided. Individual: [=] SME: [==] Corporation: [===] If deposit does not fit one of the slots provided then you are asking too much! Is your Osc dated try Phoenix raising oscommerce from the ashes.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.