I'm doing a test install on my localhost Kubuntu linux machine. Using Open Cart 0.7.7,Apache2, Mysql 5.0.45, and PHP 5.2.3-1. I've set up a database and a user with all priveliges. When I log into the opencart setup I get all green indicators. I go through adding the database host and get to step 3 and I get these errors.
Notice: Undefined index: db_host in /home/user/public_html/install/index.php on line 345
Notice: Undefined index: db_user in /home/user/public_html/install/index.php on line 346
Notice: Undefined index: db_password in /home/user/public_html/install/index.php on line 347
Notice: Undefined index: db_name in /home/user/public_html/install/index.php on line 348
Notice: Undefined index: db_host in /home/user/public_html/install/index.php on line 389
Notice: Undefined index: db_user in /home/user/public_html/install/index.php on line 390
Notice: Undefined index: db_password in /home/user/public_html/install/index.php on line 391
Notice: Undefined index: db_name in /home/user/public_html/install/index.php on line 392
I check these lines in index.php and it looks like it's trying to define the database.
$output .= 'define(\'DB_HOST\', \'' . $_SESSION['db_host'] . '\');' . "\n";
$output .= 'define(\'DB_USER\', \'' . $_SESSION['db_user'] . '\');' . "\n";
$output .= 'define(\'DB_PASSWORD\', \'' . $_SESSION['db_password'] . '\');' . "\n";
$output .= 'define(\'DB_NAME\', \'' . $_SESSION['db_name'] . '\');' . "\n";
and
$output .= 'define(\'DB_HOST\', \'' . $_SESSION['db_host'] . '\');' . "\n";
$output .= 'define(\'DB_USER\', \'' . $_SESSION['db_user'] . '\');' . "\n";
$output .= 'define(\'DB_PASSWORD\', \'' . $_SESSION['db_password'] . '\');' . "\n";
$output .= 'define(\'DB_NAME\', \'' . $_SESSION['db_name'] . '\');' . "\n";
I've reinstalled everything about 6 times and I cannot get past this error. What's happening?
Notice: Undefined index: db_host in /home/user/public_html/install/index.php on line 345
Notice: Undefined index: db_user in /home/user/public_html/install/index.php on line 346
Notice: Undefined index: db_password in /home/user/public_html/install/index.php on line 347
Notice: Undefined index: db_name in /home/user/public_html/install/index.php on line 348
Notice: Undefined index: db_host in /home/user/public_html/install/index.php on line 389
Notice: Undefined index: db_user in /home/user/public_html/install/index.php on line 390
Notice: Undefined index: db_password in /home/user/public_html/install/index.php on line 391
Notice: Undefined index: db_name in /home/user/public_html/install/index.php on line 392
I check these lines in index.php and it looks like it's trying to define the database.
$output .= 'define(\'DB_HOST\', \'' . $_SESSION['db_host'] . '\');' . "\n";
$output .= 'define(\'DB_USER\', \'' . $_SESSION['db_user'] . '\');' . "\n";
$output .= 'define(\'DB_PASSWORD\', \'' . $_SESSION['db_password'] . '\');' . "\n";
$output .= 'define(\'DB_NAME\', \'' . $_SESSION['db_name'] . '\');' . "\n";
and
$output .= 'define(\'DB_HOST\', \'' . $_SESSION['db_host'] . '\');' . "\n";
$output .= 'define(\'DB_USER\', \'' . $_SESSION['db_user'] . '\');' . "\n";
$output .= 'define(\'DB_PASSWORD\', \'' . $_SESSION['db_password'] . '\');' . "\n";
$output .= 'define(\'DB_NAME\', \'' . $_SESSION['db_name'] . '\');' . "\n";
I've reinstalled everything about 6 times and I cannot get past this error. What's happening?
Last edited by ebtech on Mon Nov 12, 2007 8:20 am, edited 1 time in total.
are sessions working?
quick, crap test would be to paste this into 'session.php' and then visit it.
[php]
[/php]
should see:
if you don't then there's something wrong with sessions in your php setup.
quick, crap test would be to paste this into 'session.php' and then visit it.
[php]
[/php]
should see:
Code: Select all
Array ( [test] => some value )
Thx ogun but I believe you're talking over my head 
My session.php file has many lines of code. Should I overwrite the file and include only the code you posted? What do you mean by "are sessions working?"?
One thing I notice, when I go to http://localhost/install/index.php I get all green indications. When I go to
http://localhost now I get this
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'www-data'@'localhost' (using password: NO) in /home/user/public_html/library/database/database.php on line 16
Error: Could not make a database connection using @
Update: I've installed Opencart on my LinuxMint partition which was previously running zencart and it runs flawlessly. There is definitely a problem with the LAMP stack in Kubuntu 7.10.
At least now I can play with Open Cart

My session.php file has many lines of code. Should I overwrite the file and include only the code you posted? What do you mean by "are sessions working?"?
One thing I notice, when I go to http://localhost/install/index.php I get all green indications. When I go to
http://localhost now I get this
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'www-data'@'localhost' (using password: NO) in /home/user/public_html/library/database/database.php on line 16
Error: Could not make a database connection using @
Update: I've installed Opencart on my LinuxMint partition which was previously running zencart and it runs flawlessly. There is definitely a problem with the LAMP stack in Kubuntu 7.10.
At least now I can play with Open Cart

Last edited by ebtech on Mon Nov 12, 2007 12:40 pm, edited 1 time in total.
Hi there,
I was trying to give Opencart a go but had a few problems with the installer.
My server fills all the prerequisites of Apache, PHP5 and MySQL.
If I stop after Step 2 (I don't submit my admin and password for Opencart)
The site is working.
But if I click Continue for Step 3 after entering my username/password for admin,
I get all these undefined index problems.
Notice: Undefined index
And "Error: Could not connect to the database please make sure the database server, username and password is correct!"
The thing is, I checked my MySQL db, and the tables and everything are there... so everything up to Step 3 was fine.
Any clues? Am eager to give Opencart a chance!
Thanks!
K
I was trying to give Opencart a go but had a few problems with the installer.
My server fills all the prerequisites of Apache, PHP5 and MySQL.
If I stop after Step 2 (I don't submit my admin and password for Opencart)
The site is working.
But if I click Continue for Step 3 after entering my username/password for admin,
I get all these undefined index problems.
Notice: Undefined index
And "Error: Could not connect to the database please make sure the database server, username and password is correct!"
The thing is, I checked my MySQL db, and the tables and everything are there... so everything up to Step 3 was fine.
Any clues? Am eager to give Opencart a chance!
Thanks!
K
Hello welcome to the Forums,
This seems to be an issue with cookies, and sessions check this thread http://forum.opencart.com/index.php?topic=615.0 and try the session test by ogun
I have merged your topic with the other as its the same issue.
This seems to be an issue with cookies, and sessions check this thread http://forum.opencart.com/index.php?topic=615.0 and try the session test by ogun
I have merged your topic with the other as its the same issue.
If your servers are running on (K)ubuntu Gutsy there seems to be an issue with the packages in the repos not installing the php5 mods correctly. Several folks are having issues on the Kubuntu forum. I still have not got it to work on Kubuntu. I had a dual boot with LinuxMint that worked for me (Feisty repos).
Sorry i'm not too sure what my server is, i'm on Mediatemple.
http://www.mediatemple.net/webhosting/gs/
Does anyone else use Mediatemple here?
http://www.mediatemple.net/webhosting/gs/
Does anyone else use Mediatemple here?
OK nevermind fellas, I think after a bit of good searching I sorted it out...
I did end up installing a full version of PEAR, but I also edited the index.php in the install directory and set the session variables myself.
If anyone else is having the same problem, add the red bit to this part in index.php in the install dir...
<?php
$content = ob_get_contents();
ob_end_clean();
break;
case '3':
if ($_POST) {
$_SESSION['db_host'] =
$_SESSION['db_user'] =
$_SESSION['db_password'] =
$_SESSION['db_name'] =
Thanks for the help guys.
I did end up installing a full version of PEAR, but I also edited the index.php in the install directory and set the session variables myself.
If anyone else is having the same problem, add the red bit to this part in index.php in the install dir...
<?php
$content = ob_get_contents();
ob_end_clean();
break;
case '3':
if ($_POST) {
$_SESSION['db_host'] =
$_SESSION['db_user'] =
$_SESSION['db_password'] =
$_SESSION['db_name'] =
Thanks for the help guys.
Once again. Sessions? What the heck is that?
Almost total noob here. I've reinstalled my whole OS and the LAMP stack. I think there is a permission problem somewhere with mysql but I can't figure out where. I'm using identical LAMP stacks from the same repo on two different distros. I tried the suggestion from 1983....nothing.
Apache2
Mysql5
PHP5
One works flawlessly (actually running both opencart and zen) and the other is kaput. I have the user setup in mysql with full rights to the database called "opencart". The user can access the DB in mysqladmin. I go to setup and get all green indicators. Input database host, user, password, database name. Input Admin name and password and I get this.
Error:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'www-data'@'localhost' (using password: NO) in /home/user/public_html/library/database/database.php on line 16
Error: Could not make a database connection using @
UPDATE: Well lightning must have struck. I deleted all files in public_html (for the 5th time) and re-extracted the 0.7.7 zip. Set permissions on files and folders and tried the install again. This time it worked

Clues anyone?
Almost total noob here. I've reinstalled my whole OS and the LAMP stack. I think there is a permission problem somewhere with mysql but I can't figure out where. I'm using identical LAMP stacks from the same repo on two different distros. I tried the suggestion from 1983....nothing.
Apache2
Mysql5
PHP5
One works flawlessly (actually running both opencart and zen) and the other is kaput. I have the user setup in mysql with full rights to the database called "opencart". The user can access the DB in mysqladmin. I go to setup and get all green indicators. Input database host, user, password, database name. Input Admin name and password and I get this.
Error:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'www-data'@'localhost' (using password: NO) in /home/user/public_html/library/database/database.php on line 16
Error: Could not make a database connection using @
UPDATE: Well lightning must have struck. I deleted all files in public_html (for the 5th time) and re-extracted the 0.7.7 zip. Set permissions on files and folders and tried the install again. This time it worked



Clues anyone?
Last edited by ebtech on Sun Nov 18, 2007 11:25 am, edited 1 time in total.
Who is online
Users browsing this forum: No registered users and 3 guests