Zen Cart Logo
Forums / Installing on a Windows Server / Can not passed Database setup

Can not passed Database setup

Locked

Views: 4,724

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
5 Dec 2009, 4:17 PM
#1
goetch avatar

goetch

New Zenner

Join Date:
Dec 2009
Posts:
37
Plugin Contributions:
0

Can not passed Database setup

Hi, I am a newb!!!!!! I have been trying to find a fix for my install problem and haven' been able to find an answer yet soI decided to post..... I am trying out or want to try out zen cart on my local server before putting it up on my web host. I am running osx 10.6 server, (I am very new toOSX server as well) I made sure I set up zen cart database in mysql and made sure all the permissions were correct, (I had no clue about mysql) but quickly learned how to set up a user a database name at least and the permissions........
Before I set up the mysql server I was getting the normal error can not connect to database. I think all that is set up now because I get a new error message that I have not seen on the forums (and this very well be due to my local web server not being set up correctly........ Any way now i get this message and can not get around it .....
Safari can’t open the page “http://localhost/zc_install/index.php?main_page=database_setup” because the server unexpectedly dropped the connection. This sometimes occurs when the server is busy. Wait for a few minutes, and then try again.

No matter what now I get this message, If I give it the wrong Database or wrong password I get the usual can not connect to database message............

Any Ideas? .. remember I am not a big programmer so please be pretty basic with me, I am great with hardware lol ....... anyway I hope someone has an idea for me......

I am running OSX SNOW LEOPARD SERVER, PHP 5.3.0, MYSQL 5.0.82-log.... and apache 2.2 .......

Oh I did forget to do a software update since install of the server software, (I am testing out configurations before rollout next year )
So I will be updated to 10.6.2 ...

5 Dec 2009, 5:18 PM
#3
goetch avatar

goetch

New Zenner

Join Date:
Dec 2009
Posts:
37
Plugin Contributions:
0

Re: Can not passed Database setup

Thanks for the reply !!!!!!!!!!!!!!!
Ok I installed the patch per the instructions, butI still get the server timeout...... Since I am new I can not rule out the possibility that my web server is not configured correctly..... In the web server error logs I do get this error " child pid 64293 exit signal Segmentation fault (11)"

I have tried this with and with out ssl as well ..........
I know it has to be me .............
I could try this right from the web host, butI really want to configure and see it in action locally......

Any other ideas???????????

15 Jan 2010, 7:19 PM
#4
hermes369 avatar

hermes369

New Zenner

Join Date:
Dec 2006
Location:
Augusta, GA
Posts:
74
Plugin Contributions:
0

Re: Can not passed Database setup

It appears that this is a php bug: http://bugs.php.net/bug.php?id=48754 that's been fixed. Without MAMP, looks like I'll be learning how to install php 5.3.1 from scratch. Yippie!
I know the easy solution; but, now I'm mad.

15 Jan 2010, 8:00 PM
#5
hermes369 avatar

hermes369

New Zenner

Join Date:
Dec 2006
Location:
Augusta, GA
Posts:
74
Plugin Contributions:
0

Re: Can not passed Database setup

Interesting. I did this in zc_install/classes/installer.php

      if ($this->error == false) {
        if ($zp_type == 'mysql') {
          if (@mysql_connect($zp_host, $zp_username, $zp_pass) == false )

----

mysql_close();

to

	$a = @mysql_connect($zp_host, $zp_username, $zp_pass);
      if ($this->error == false) {
        if ($zp_type == 'mysql') {
          if ($a == false )
----

mysql_close($a);

and

      if ($zp_create != 'true' && $this->error == false) {
        if ($zp_type == 'mysql') {
          @mysql_connect($zp_host, $zp_username, $zp_pass);
-----

mysql_close();

to

	$a = @mysql_connect($zp_host, $zp_username, $zp_pass);
      if ($zp_create != 'true' && $this->error == false) {
        if ($zp_type == 'mysql') {
          $a;

---

mysql_close($a);

and…the bloody thing worked!!
:clap:

3 Feb 2010, 7:09 PM
#6
celtic avatar

celtic

Zen Follower

Join Date:
Feb 2010
Posts:
154
Plugin Contributions:
0

Re: Can not passed Database setup

Does this sound familiar?...

- I have WAMP Server 2.0 installed (and working!) with PHP 5.3.

  • I am new to Zen cart. I am trying to install zen-cart 1.3.8a.
  • The apache server is shutting down at the ZenCart database setup stage.
  • I found the forums about the patch and applied it.
  • The apache server is still shutting down after the database setup.

I had this same problem, as it seems do many others...

http://www.zen-cart.com/forum/showthread.php?t=139064
http://www.zen-cart.com/forum/showthread.php?t=146147
http://www.zen-cart.com/forum/showthread.php?t=142953

The problem appears to be with a PHP mysql_close() function bug...

http://uk2.php.net/manual/en/function.mysql-close.php

http://bugs.php.net/bug.php?id=48754

The solution (for me) was fairly simple in the end:

Thanks to the solution provided in this thread, but not very clear, so expanded by me below!

  1. Install the ZenCart Patch following the details in this post.
  2. With your favourite text editor, open up: zc_install/classes/installer.php
  3. Search for: function dbConnect
  4. Replace the entire function with this one...
    function dbConnect($zp_type, $zp_host, $zp_database, $zp_username, $zp_pass, $zp_error_text, $zp_error_code, $zp_error_text2=ERROR_TEXT_DB_NOTEXIST, $zp_error_code2=ERROR_CODE_DB_NOTEXIST) {
    $fix53 = @mysql_connect($zp_host, $zp_username, $zp_pass);
    if ($this->error == false) {
        if ($zp_type == 'mysql') {
          if ($fix53 == false ) {
            $this->setError($zp_error_text.'<br />'.@mysql_error(), $zp_error_code, true);
          } else {
            if (!@mysql_select_db($zp_database)) {
              $this->setError($zp_error_text2.'<br />'.@mysql_error(), $zp_error_code2, true);
            } else {
              @mysql_close($fix53);
            }
          }
        }
      }
    }
  1. Search for: function dbExists (a couple of lines below the dbConnect function)
  2. Replace the entire function with this one...
    function dbExists($zp_create, $zp_type, $zp_host, $zp_username, $zp_pass, $zp_name, $zp_error_text, $zp_error_code) {
      //    echo $zp_create;
      if ($zp_create != 'true' && $this->error == false) {
        if ($zp_type == 'mysql') {
          $fix53 = @mysql_connect($zp_host, $zp_username, $zp_pass);
          if (@mysql_select_db($zp_name) == false) {
            $this->setError($zp_error_text.'<br />'.@mysql_error(), $zp_error_code, true);
          }
          @mysql_close($fix53);
        }
      }
    }
  1. Save the modded installer.php
  2. Run ZenCart setup once again.

I hope it works for you as it did for me.

I suggest the powers that be make these changes in the patch zip file to avoid further problems for people.

PS. It appears from here that this error has been fixed in ZenCart 1.3.9 and so it should disappear when that is released.

3 Feb 2010, 11:45 PM
#7
celtic avatar

celtic

Zen Follower

Join Date:
Feb 2010
Posts:
154
Plugin Contributions:
0

Re: Can not passed Database setup

um, note in the above two functions that the @mysql_error() calls may also have to be replaced with @mysql_error($fix53) to reference the open database. Haven't tested it, sorry, as I didn't get any errors.

Also, can we please change the title of this thread to be a bit more descriptive of the error it discusses. I had posted my solution above in its own thread with an appropriate title, but it seems to have been dumped here by the moderators!!!

9 Feb 2010, 2:06 PM
#8
drbyte avatar

drbyte

Sensei

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

Re: Can not passed Database setup

Celtic:

Also, can we please change the title of this thread to be a bit more descriptive of the error it discusses.
Not necessary, as a couple weeks ago I updated the patch to include the fix posted by hermes. I double-checked it last week, at which time I also updated the readme to include the filename, etc. So, using the patch should avoid the problem, thus making it unnecessary to do the edits manually.

22 Feb 2010, 6:16 AM
#9
vandy76 avatar

vandy76

New Zenner

Join Date:
Feb 2010
Posts:
1
Plugin Contributions:
0

Re: Can not passed Database setup

Hi ,

I am facing same problem. I have done changes in functions dbConnect and dbExists same as mentioned above , but after these changes , a blank page appear when i press ok in database set up page . Please advise on this issue .

System set up

PHP 5.3 Version
Apache 2.2.11
Operating System Mac OS Ver 10.6
MySql :- 5.1.44 - LOG

Vandana