Zen Cart Logo
Forums / Installing on a Linux/Unix Server / "Unable to connect to database" when pressing Save System Settings

"Unable to connect to database" when pressing Save System Settings

Views: 3,607

Results 1 to 20 of 26
29 Sep 2012, 12:08 PM
#1
tmdea avatar

tmdea

New Zenner

Join Date:
Sep 2012
Posts:
20
Plugin Contributions:
0

"Unable to connect to database" when pressing Save System Settings

Installing 1.5.1 on a linux machine. Install goes smoothly thru Database setup. It is able to connect to the database at that point and I can see in phpMyAdmin that all the tables are created in my database after hitting save. It then moves to System Setup tab and I leave the defaults which all match ok and leaves SSL off. When I hit save I get an all white page with nothing but the words

Unable to connect to database

in the upper left corner. When I hit back it goes to a page cannot be displayed and hitting refresh takes me to a page that says the following:

Problem Detected

Sorry, a problem has been detected.

This installer needs to be able to start a PHP session in order to complete installation.

Possible causes of this page being displayed include:
•
Perhaps a timeout has occurred
If you left the installation unattended more than 20 minutes, then the information you entered on previous screens is no longer available. In this case, you will need to begin the installation process again.

Please do not leave the installation process unattended for long lengths of time. Installation should only take 5 minutes under normal circumstances.

•
The server has no place to write its session files.
If you have not already made the "cache" folder writable, please do so now so the installer can continue. Details on making the files writable can be found in the Installation Instructions or in the online FAQs.

•
PHP sessions might not be functional on your server
In order to use Zen Cart®, you will need to be able to use the "session" capabilities of PHP. It could be that your server configuration is not currently allowing PHP sessions to start and interact properly. Also, if you have session cookies disabled in your browser, you will not be able to use PHP session support. Please turn off cookie-blocking tools in your browser and firewall as a precaution.

You may need to talk to your webserver administrator for assistance in ensuring that PHP sessions can be configured and used on your site.

None of the items in the checklist apply.

Any ideas? TIA

29 Sep 2012, 5:22 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: "Unable to connect to database" when pressing Save System Settings

Maybe it wasn't able to write to the /includes/configure.php file correctly, or cannot read the file's contents back in again?

29 Sep 2012, 6:40 PM
#3
tmdea avatar

tmdea

New Zenner

Join Date:
Sep 2012
Posts:
20
Plugin Contributions:
0

Re: "Unable to connect to database" when pressing Save System Settings

DrByte:

Maybe it wasn't able to write to the /includes/configure.php file correctly, or cannot read the file's contents back in again?

I checked both of the configure files and the parameters for the inputs I had to enter were all correct. Not sure about other parameters but the database login and host info for example was good.

29 Sep 2012, 8:55 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: "Unable to connect to database" when pressing Save System Settings

Very bizarre.

Click Reply below and review the questions mentioned in the Posting Tips box and answer the relevant bits, in addition to mentioning more info about your "linux machine" including what operating system/version it's using, what PHP version it's using, mysql version, phpmyadmin version, how your LAMP stack was installed, how you've customized (if at all) the php.ini and my.cnf files, and more.

Your symptoms all sound very much environmental and unlike what would be typical of a commonly configured production webserver.

29 Sep 2012, 10:41 PM
#5
tmdea avatar

tmdea

New Zenner

Join Date:
Sep 2012
Posts:
20
Plugin Contributions:
0

Re: "Unable to connect to database" when pressing Save System Settings

DrByte:

Very bizarre.

Click Reply below and review the questions mentioned in the Posting Tips box and answer the relevant bits, in addition to mentioning more info about your "linux machine" including what operating system/version it's using, what PHP version it's using, mysql version, phpmyadmin version, how your LAMP stack was installed, how you've customized (if at all) the php.ini and my.cnf files, and more.

Your symptoms all sound very much environmental and unlike what would be typical of a commonly configured production webserver.

OK some of those answers will have to wait till monday because my host set up the server and I dont know the specifics. All the minimum requirements and versions were met and exceeded and green checkmarked during the install check. I am going to try a previous version in the meantime and see what goes down.

29 Sep 2012, 10:49 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: "Unable to connect to database" when pressing Save System Settings

You wrote your post in a way that sounded like you were self-hosting it on your own computer.

Who's the hosting company? (that's one of the Posting Tips questions I was referring to).
Is the Posting Tips box not showing up for you?

29 Sep 2012, 11:25 PM
#7
tmdea avatar

tmdea

New Zenner

Join Date:
Sep 2012
Posts:
20
Plugin Contributions:
0

Re: "Unable to connect to database" when pressing Save System Settings

DrByte:

You wrote your post in a way that sounded like you were self-hosting it on your own computer.

Who's the hosting company? (that's one of the Posting Tips questions I was referring to).
Is the Posting Tips box not showing up for you?

Well I'm in the middle of self hosting somewhere. My friend has a collocated server and I have an account on it. So theres no hosting company, but I didnt do the installs. He did everything from OS isntall to apache and php.

29 Sep 2012, 11:30 PM
#8
tmdea avatar

tmdea

New Zenner

Join Date:
Sep 2012
Posts:
20
Plugin Contributions:
0

Re: "Unable to connect to database" when pressing Save System Settings

Here are some of the answers to your questions:
Attachment 11229

29 Sep 2012, 11:40 PM
#9
tmdea avatar

tmdea

New Zenner

Join Date:
Sep 2012
Posts:
20
Plugin Contributions:
0

Re: "Unable to connect to database" when pressing Save System Settings

OK 1.3.9 install gives the same error at the same spot. Is able to create the DB tables with no problem during Database set up but System setup leads to that page. Is there a log that will have any info about what is happening?

30 Sep 2012, 10:32 PM
#10
tmdea avatar

tmdea

New Zenner

Join Date:
Sep 2012
Posts:
20
Plugin Contributions:
0

Re: "Unable to connect to database" when pressing Save System Settings

I PM'd a private video showing the situation. Not sure if it sent because I cant find the sent folder in the private messages.

1 Oct 2012, 12:06 AM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: "Unable to connect to database" when pressing Save System Settings

Thanks. I saw the video. More helpful would be the actual URL.

What puzzles me most is why the System Inspection results show your PHP version twice, and no MySQL version. That's very unusual, and suggests something odd about your server configuration.

1 Oct 2012, 12:46 AM
#12
tmdea avatar

tmdea

New Zenner

Join Date:
Sep 2012
Posts:
20
Plugin Contributions:
0

Re: "Unable to connect to database" when pressing Save System Settings

DrByte:

Thanks. I saw the video. More helpful would be the actual URL.

What puzzles me most is why the System Inspection results show your PHP version twice, and no MySQL version. That's very unusual, and suggests something odd about your server configuration.

URL to the website? Will that show any info? Its just an index page in progress with no DB or zen cart code integrated yet.

I found that double PHP odd too, especially since one is checkmarked and the 2nd is a warning?

1 Oct 2012, 12:49 AM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: "Unable to connect to database" when pressing Save System Settings

The zc_install URL would let me see the PHPinfo output, etc.

1 Oct 2012, 12:53 AM
#14
tmdea avatar

tmdea

New Zenner

Join Date:
Sep 2012
Posts:
20
Plugin Contributions:
0

Re: "Unable to connect to database" when pressing Save System Settings

DrByte:

The zc_install URL would let me see the PHPinfo output, etc.

See PM

1 Oct 2012, 1:10 AM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: "Unable to connect to database" when pressing Save System Settings

What exactly is the database name you're using? It looks like maybe it's "sinhb_...", which seems very odd.
And have you tried using "localhost" as the database host/server? That's more conventional, and usually the only reason to change that to something else is if the mysql database engine is on a physically separate server.

1 Oct 2012, 1:13 AM
#16
tmdea avatar

tmdea

New Zenner

Join Date:
Sep 2012
Posts:
20
Plugin Contributions:
0

Re: "Unable to connect to database" when pressing Save System Settings

DrByte:

What exactly is the database name you're using? It looks like maybe it's "sinhb_...", which seems very odd.
And have you tried using "localhost" as the database host/server? That's more conventional, and usually the only reason to change that to something else is if the mysql database engine is on a physically separate server.

sinhb_... is in fact the name. For some odd reason that is the default name when I create a db and the only name it will let me use. I will ask my friend what the deal is with that. I tried using localhost and it failed on the previous step instead of the current failed step. I will try it again right now with this version as that was with 1.5

1 Oct 2012, 1:17 AM
#17
tmdea avatar

tmdea

New Zenner

Join Date:
Sep 2012
Posts:
20
Plugin Contributions:
0

Re: "Unable to connect to database" when pressing Save System Settings

Yeah using localhost I get:

ATTENTION: Problems Found

Connection to Database failed
No such file or directory more info...

1 Oct 2012, 1:32 AM
#18
tmdea avatar

tmdea

New Zenner

Join Date:
Sep 2012
Posts:
20
Plugin Contributions:
0

Re: "Unable to connect to database" when pressing Save System Settings

well I figured out why i couldnt name the DB what I wanted. It has to start with the sinhb_ prefix. So I created a new one and still no go so that wasnt the problem.

1 Oct 2012, 1:32 AM
#19
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: "Unable to connect to database" when pressing Save System Settings

Unable to connect to databaseThat's caused by incorrect database details.
It uses the DB_TYPE, DB_PREFIX, DB_CHARSET, DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE settings when determining where and how to connect.
So, while you said earlier that you'd checked the configure.php, I must ask again: do the DB_XXXXXX settings in your /includes/configure.php file match what you had entered into zc_install during the Database Setup stage?

And that "No such file or directory" message is peculiar too.

1 Oct 2012, 1:52 AM
#20
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: "Unable to connect to database" when pressing Save System Settings

FYI, just confirming that the double-listing of the PHP version is just a display issue, and unrelated to any of the problems mentioned here.
The double-display only occurs with PHP 5.4, and is simply because the version check is performed twice.

Granted, it would be interesting to see if your problems persist on that same server if it's running PHP 5.3 instead.