call to member funcction close() exception.

Installing and configuring Tera-WURFL on your server.

call to member funcction close() exception.

Postby munishsethi777 » Mon May 03, 2010 1:03 pm

Hi.

I have just installed your app on my machine (windows) under apache web server and its working like a charm. I can test the check wurfl script and it does shows me meaningful data.
But it adds alot to my surprise that same script when uploaded on my remote web server is not working and shows me the following error when tried to access the test script from admin page.
Fatal error: Call to a member function close() on a non-object in /home/satya777/public_html/followme/tera/DatabaseConnectors/TeraWurflDatabase_MySQL5.php on line 89

Looks like some connection is tried to close before it is instantiated.
Letting you know that my remote web server have 5.2 php with mysql 5.

database is mounted by exported scripts from my local machine.

You can acccess the admin page at http://www.satyainfopages.com/followme/tera/admin

Kindly suggest.

Regards
Munish Sethi.
munishsethi777
 
Posts: 4
Joined: Mon May 03, 2010 12:53 pm

Re: call to member funcction close() exception.

Postby kamermans » Tue May 04, 2010 10:36 am

The problem is that the WURFL file has not been loaded yet, so the database tables do not exist, and since the tables do not exist, a query failed, then ->close() was called on the failed query's result set, which is a fatal error.

Thanks for providing the link to the admin page, from here I was able to see that you are not able to load the WURFL file because it fails with this error:
Fatal error: Balloc() failed to allocate memory in /home/satya777/public_html/followme/tera/TeraWurflLoader.php on line 87

That is a strange error - it appears that your server has less RAM than the script is attempting to allocate, although this usually results in a "failed to allocate x bytes..." error. By default, Tera-WURFL requests 256M of RAM when it's loading the WURFL file, and this may be the problem. You certainly do not need 256M, I just set it as the default for insurance. Please edit your TeraWurflConfig.php file and change MEMORY_LIMIT to something more conservative, like "64M", then go back to your admin page and load the WURFL from the local file.
Thanks,

Steve Kamerman
Tera-WURFL Author
COO of ScientiaMobile

IMPORTANT ANNOUNCEMENT! Tera-WURFL and WURFL have joined forces! We have launched ScientiaMobile to provide commercial support for our device detection solutions.

Tera-WURFL.com | Device Explorer
kamermans
Site Admin
 
Posts: 323
Joined: Wed Mar 10, 2010 12:06 pm
Location: Fort Worth, TX

Re: call to member funcction close() exception.

Postby munishsethi777 » Fri May 14, 2010 9:50 pm

My server guys were not able to sort out the issue with memory usage so i thought of exporting the database to the server and not just run the installer on server itself.

I told u about the exception
Fatal error: Call to a member function close() on a non-object in /home/satya777/public_html/followme/tera/DatabaseConnectors/TeraWurflDatabase_MySQL5.php on line 89
Now i understood that table names on the database are diff from what the scripts are expecting.
All the tables names in db are small letters, but i realised that i m getting the above exception because it was looking for TeraWurflMerge but table name on server is terawurlfmerge ( all in smalls), which results in exception.

Kindly tell me why did your scripts created small letters tables if the scripts are looking for not small letters tables.
Let me know some quick solution, or do i have to rename the tables?
hav u ever fronted this kind of issue???
munishsethi777
 
Posts: 4
Joined: Mon May 03, 2010 12:53 pm

Re: call to member funcction close() exception.

Postby kamermans » Fri May 14, 2010 10:59 pm

If your tables are being created in lowercase it is because MySQL is configured to use lowercase table names - this is ok and it will still work properly. To get around the memory issue I have created a program called the WURFL Customizer, it allows you to strip the capabilities that you don't need out. Please look for it on http://www.Tera-WURFL.com - there is a YouTube video on the site also that describes how to use it. The program will let you save a very small version of the WURFL that you can upload to your server and will let you update the database and recreate the tables.
Thanks,

Steve Kamerman
Tera-WURFL Author
COO of ScientiaMobile

IMPORTANT ANNOUNCEMENT! Tera-WURFL and WURFL have joined forces! We have launched ScientiaMobile to provide commercial support for our device detection solutions.

Tera-WURFL.com | Device Explorer
kamermans
Site Admin
 
Posts: 323
Joined: Wed Mar 10, 2010 12:06 pm
Location: Fort Worth, TX

Re: call to member funcction close() exception.

Postby munishsethi777 » Sun May 16, 2010 11:23 pm

no application is not working properly because of smal letters table names.
My application is hosted on linux and its case sensitive.. You scripts are looking for mixedcase table names whereas mine as smaller ones.
look at www.satyainfopages.com/followme/wap.php5 under some mobile phone / emulator.
munishsethi777
 
Posts: 4
Joined: Mon May 03, 2010 12:53 pm

Re: call to member funcction close() exception.

Postby kamermans » Mon May 17, 2010 2:35 pm

The Tera-WURFL tables are created with mixed case, so if they are showing up in lower case, this means the MySQL option lower_case_table_names is enabled. In this case, as you can see from the documentation, when this option is enabled, comparisons for the table name are done in an insensitive manner - a common reason for enabling this option is to make a Linux MySQL server act the same as a Windows MySQL server regarding case sensitivity.

If you want to prove to yourself that this is the case, you can run this command from your MySQL server: SHOW VARIABLES LIKE 'lower_case_table_names'. The value should be 1 or 2.
Code: Select all
mysql> SHOW VARIABLES LIKE 'lower_case_table_names';
+------------------------+-------+
| Variable_name          | Value |
+------------------------+-------+
| lower_case_table_names | 1     |
+------------------------+-------+
1 row in set


You will need to use a smaller WURFL file. I have made a few changes to the XML parser in version 2.1.2 so that you will now see an error message if your installation of Tera-WURFL runs out of memory while trying to load the WURFL. You may want to download version 2.1.2.

I have also made a smaller WURFL for you that you may download and use. Just unzip this file and put it in your data/ directory, then update the database from your admin interface.
Thanks,

Steve Kamerman
Tera-WURFL Author
COO of ScientiaMobile

IMPORTANT ANNOUNCEMENT! Tera-WURFL and WURFL have joined forces! We have launched ScientiaMobile to provide commercial support for our device detection solutions.

Tera-WURFL.com | Device Explorer
kamermans
Site Admin
 
Posts: 323
Joined: Wed Mar 10, 2010 12:06 pm
Location: Fort Worth, TX

Re: call to member funcction close() exception.

Postby munishsethi777 » Tue May 18, 2010 11:16 pm

i followed your instructions and did the following

1. Downloaded latest files and instaled the new database with mixed case table names
2. Exported DB from my local machine and imported it on the remote databse server.
3. DB tables got created with mixed case and i think now my DB is good.

I m trying to now test the usage at url
http://satyainfopages.com/followme/terawurfl/test_usage.php
but i see this error.
Code: Select all
Catchable fatal error: Argument 1 passed to TeraWurfl::addTopLevelSettings() must be an array, null given, called in /home/satya777/public_html/followme/terawurfl/TeraWurfl.php on line 334 and defined in /home/satya777/public_html/followme/terawurfl/TeraWurfl.php on line 463


Kindly suggest.
munishsethi777
 
Posts: 4
Joined: Mon May 03, 2010 12:53 pm

Re: call to member funcction close() exception.

Postby kamermans » Tue May 18, 2010 11:23 pm

I'm glad the database was imported successfully! Please look at the following page on your server: http://satyainfopages.com/followme/tera ... _wurfl.php, you will see this error:
Code: Select all
Fatal error: Uncaught exception 'Exception' with message 'Error in DB RIS Query: execute command denied to user 'satya777_munish'@'localhost' for routine 'satya777_wurfl.TeraWurfl_RIS'. Query: CALL TeraWurfl_RIS('SonyEricssonK700i/R2AC SEMC-Browser/4.0.2 Profile/MIDP-2.0 Configuration/CLDC-1.1',16,'SonyEricsson') ' in /home/satya777/public_html/followme/terawurfl/DatabaseConnectors/TeraWurflDatabase_MySQL5.php:110 Stack trace: #0 /home/satya777/public_html/followme/terawurfl/UserAgentMatchers/UserAgentMatcher.php(73): TeraWurflDatabase_MySQL5->getDeviceFromUA_RIS('SonyEricssonK70...', 16, Object(SonyEricssonUserAgentMatcher)) #1 /home/satya777/public_html/followme/terawurfl/UserAgentMatchers/SonyEricssonUserAgentMatcher.php(29): UserAgentMatcher->risMatch('SonyEricssonK70...', 16) #2 /home/satya777/public_html/followme/terawurfl/TeraWurfl.php(175): SonyEricssonUserAgentMatcher->applyConclusiveMatch('SonyEricssonK70...') #3 /home/satya777/public_html/followme/terawurfl/TeraWurfl.php(303): TeraWurfl->getDeviceIDFromUALoose in /home/satya777/public_html/followme/terawurfl/DatabaseConnectors/TeraWurflDatabase_MySQL5.php on line 110


The important part of that error is: Error in DB RIS Query: execute command denied to user 'satya777_munish'@'localhost' for routine 'satya777_wurfl.TeraWurfl_RIS. Please make sure the user satya777_munish has the EXECUTE permission on the database satya777_wurfl. Also, you will want to verify that the stored procedure TeraWurfl_RIS was copied over to the server with the database tables.
Thanks,

Steve Kamerman
Tera-WURFL Author
COO of ScientiaMobile

IMPORTANT ANNOUNCEMENT! Tera-WURFL and WURFL have joined forces! We have launched ScientiaMobile to provide commercial support for our device detection solutions.

Tera-WURFL.com | Device Explorer
kamermans
Site Admin
 
Posts: 323
Joined: Wed Mar 10, 2010 12:06 pm
Location: Fort Worth, TX


Return to Installation / Configuration

Who is online

Users browsing this forum: No registered users and 3 guests

cron