Zen Cart Logo
Forums / Installing on a Linux/Unix Server / final install page->mysql_real_escape_string() expects parameter 2 to be resource

final install page->mysql_real_escape_string() expects parameter 2 to be resource

Views: 1,761

Results 1 to 3 of 3
26 Sep 2013, 11:06 PM
#1
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,874
Plugin Contributions:
7

final install page->mysql_real_escape_string() expects parameter 2 to be resource

FYI

This is a development copy of my real shop files, located on my hosting.
I have not used it for a long time, and found the configures had old data in them.
I could get the admin side to work ok, but the catalog was always "an error ocurred etc..." no error log messages.
I gave up staring at it and decided to reinstall to re-create them.

I deleted the configures, dropped all the db tables and ran the installer.
On the final page where it installs/or not the demo products it gave the "an error ocurred....refresh" white page of death· etc.
The only error log is this

[26-Sep-2013 23:10:45 Europe/London] PHP Warning: mysql_real_escape_string() expects parameter 2 to be resource, boolean given in /....../tienda_copy/includes/classes/db/mysql/query_factory.php on line 89
[26-Sep-2013 23:10:45 Europe/London] PHP Fatal error: 0:Install Error: Could not connect to the Database :: update configuration set configuration_value = '' where configuration_key = 'STORE_NAME' in /......./tienda_copy/includes/classes/db/mysql/query_factory.php on line 120

In the end I found the install problem was caused by selecting "use SSL" for both the catalog and admin in the installer. I'm not sure which was the problem or the use of both.

Once it had installed ok, I imported my real database and enabled SLL in the newly created configures and all works ok.
I checked the new configures against the old ones (where the catalog one would not work) and they were identical.

So in summary, it all should have worked from the start.

So two issues:

  1. why it would not work from the start, somehow related to
  2. why did the installer choke?

Any idea what happened here?

26 Sep 2013, 11:23 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: final install page->mysql_real_escape_string() expects parameter 2 to be resource

I use SSL all the time when running zc_install, and check the use-ssl box about 80% of the time when testing/dev and 100% of the time when installing real sites, so can't see how it could be related to that.

But, that particular screen actually reads the contents of the configure.php to obtain the db credentials, so the error is most likely related to a problem reading configure.php contents correctly.

3 Oct 2013, 8:31 AM
#3
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,874
Plugin Contributions:
7

Re: final install page->mysql_real_escape_string() expects parameter 2 to be resource

I had omitted to delete the /local folder from the files so it was indeed reading the wrong configure information.:bangin: