Internal Server Error after wurfl upload

Installing and configuring Tera-WURFL on your server.

Re: Internal Server Error after wurfl upload

Postby marcguay » Wed Mar 09, 2011 2:34 pm

5.2.6-1+lenny9

memory_get_usage() reports 1 356 088 bytes = 1.2932663 megabytes but I'm not sure if that answers your question.
marcguay
 
Posts: 17
Joined: Mon May 31, 2010 11:42 am

Re: Internal Server Error after wurfl upload

Postby icejava » Fri Mar 11, 2011 12:05 am

Thanks gents! You have saved me a lot of headaches - reverting back to TeraWurflXMLParser_SimpleXML() did the trick :P
icejava
 
Posts: 2
Joined: Fri Mar 04, 2011 3:03 am

Re: Internal Server Error after wurfl upload

Postby kamermans » Fri Mar 11, 2011 12:18 am

Well, it seems we have a problem with both extensions in different situations, so I'll try to find a more elegant way to allow you to choose between SimpleXML and XMLReader :) Thanks for the testing and confirmation, guys!
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: Internal Server Error after wurfl upload

Postby jhodgski » Wed Apr 06, 2011 12:08 pm

Hi everyone,

I am also experiencing the 500 "Internal Server Error" problem when XMLReader has priority in TeraWurflXMLParser.php. I also changed that file to make SimpleXML have priority but, when I try to access admin/updatedb.php?source=local, I now get this error (repeated several times on page)...

Warning: simplexml_load_file() [function.simplexml-load-file]: (null)(null)/websites/123reg/LinuxPackage22/xx/xx/xx/xxxxxxxxxx.xx.xx/public_html/JH/tera_wurfl/kamermans-Tera-WURFL-90057fb/data/wurfl.xml:204520: parser error : out of memory error in /websites/123reg/LinuxPackage22/xx/xx/xx/xxxxxxxxxx.xx.xx/public_html/JH/tera_wurfl/kamermans-Tera-WURFL-90057fb/TeraWurflXMLParsers/TeraWurflXMLParser_SimpleXML.php on line 36

PHP details according to "phpinfo();" output...
------------------------------------------------------
Configure Command:
'./configure' '--host=i686-redhat-linux-gnu' '--build=i686-redhat-linux-gnu' '--target=i386-redhat-linux' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--without-mime-magic' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--enable-force-cgi-redirect' '--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' '--enable-mbstring=shared' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-ncurses=shared' '--with-gd=shared' '--enable-bcmath=shared' '--enable-dba=shared' '--with-db4=/usr' '--with-xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config' '--enable-dom=shared' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--enable-soap=shared' '--with-xsl=shared,/usr' '--enable-xmlreader=shared' '--enable-xmlwriter=shared' '--enable-fastcgi' '--enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr' '--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr' '--enable-json=shared' '--enable-zip=shared' '--with-readline' '--enable-dbase=shared' '--with-mcrypt=shared,/usr' '--with-mhash=shared,/usr' '--with-tidy=shared,/usr' '--with-mssql=shared,/usr'

Zend Memory:
enabled

memory_limit:
64M 64M

report_memleaks:
On On


Also, from admin/install.php...
-------------------------------------
PHP Version: 5.2.6... OK
ZipArchive Support ... OK
MySQLi Support ... OK
PHP Memory Limit: 768M (via TeraWurflConfig::$MEMORY_LIMIT)
When you update the WURFL, PHP may consume over 200MB of RAM while parsing, sorting and indexing the data.

(Everything else OK, except the warning that I am using MYSQL4 instead of MYSQL5 to get over a stored procedures problem.)

Is the PHP memory_limit too low? (Even though I have installed WURFL on PHP installations that have a memory_limit of 32K?)

Looking forward to a bit of help!

Thanks in advance,
James
jhodgski
 
Posts: 20
Joined: Wed Apr 06, 2011 11:42 am

Re: Internal Server Error after wurfl upload

Postby jhodgski » Wed Apr 06, 2011 12:42 pm

By the way, changing to SimpleXML seems to have resulted in my MySQL tables being created, but when I go to check_wurfl.php, I get this output beneath the form:

Fatal error: Uncaught exception 'Exception' with message 'Tried to lookup an invalid WURFL Device ID: generic_xhtml' in /websites/123reg/LinuxPackage22/xx/xx/xx/xxxxxxxxxx.xx.xx/public_html/JH/tera_wurfl/kamermans-Tera-WURFL-90057fb/DatabaseConnectors/TeraWurflDatabase_MySQL4.php:52 Stack trace: #0 /websites/123reg/LinuxPackage22/xx/xx/xx/xxxxxxxxxx.xx.xx/public_html/JH/tera_wurfl/kamermans-Tera-WURFL-90057fb/TeraWurfl.php(343): TeraWurflDatabase_MySQL4->getDeviceFromID('generic_xhtml') #1 /websites/123reg/LinuxPackage22/xx/xx/xx/xxxxxxxxxx.xx.xx/public_html/JH/tera_wurfl/kamermans-Tera-WURFL-90057fb/TeraWurfl.php(303): TeraWurfl->getFullCapabilities('generic_xhtml') #2 /websites/123reg/LinuxPackage22/xx/xx/xx/xxxxxxxxxx.xx.xx/public_html/JH/tera_wurfl/kamermans-Tera-WURFL-90057fb/check_wurfl.php(51): TeraWurfl->getDeviceCapabilitiesFromAgent('SonyEricssonK70...') #3 {main} thrown in /websites/123reg/LinuxPackage22/xx/xx/xx/xxxxxxxxxx.xx.xx/public_html/JH/tera_wurfl/kamermans-Tera-WURFL-90057fb/DatabaseConnectors/TeraWurflDatabase_MySQL4.php on line 52
jhodgski
 
Posts: 20
Joined: Wed Apr 06, 2011 11:42 am

Re: Internal Server Error after wurfl upload

Postby kamermans » Wed Apr 06, 2011 1:28 pm

I see from your php.ini that the memory limit is defaulted to 64MB - well below what is required for WURFL or Tera-WURFL to parse the WURFL file. By default, Tera-WURFL will try to allocate additional memory for the import, but sometimes this does not work or your hosting provider advertises unlimited memory to the system but restricts your memory per process to something very low like 64MB. Who is your hosting provider? I'm assuming you are on a shared server. One option for low memory servers is to use the WURFL Customizer to reduce the size of the WURFL file, so it doesn't take so much memory to load it on the server. To do this, download the app from http://www.tera-wurfl.com/wiki/index.ph ... Customizer and download the current WURFL file from http://wurfl.sourceforge.net, then open the WURFL file inside the WURFL Customizer and select the capabilities that you need (like "is_wireless_device"), then export your smaller WURFL and upload it to the server in the "data/" folder and then you should be able to load it from the local file. See the YouTube video on the download page for more info.

Regarding MySQL, can you verify the version you are using (MySQL Server Version) and paste a list of the tables in your Tera-WURFL DB? (type "SHOW TABLES" in PhpMyAdmin)
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: Internal Server Error after wurfl upload

Postby jhodgski » Wed Apr 06, 2011 3:59 pm

Hiya Steve,
The host is 123-reg.co.uk - and, yes, it's a shared server.
OK, I've used the WURFL Customizer (selecting only is_wireless_device - although I will need more attributes in reality), followed your instructions and uploaded it. Also (essentially), I emptied the database of all the old tera-wurfl tables, and then when loading from the local file, it's worked!

Success page content:
Database Update OKTotal Time: 43.264777898788
Parse Time: 0.96540093421936 (TeraWurflXMLParser_SimpleXML)
Validate Time: 0.0066628456115723
Sort Time: 3.4500241279602
Patch Time: 0.059208154678345
Database Time: 38.775233983994
Cache Rebuild Time: 0.0082478523254395
Number of Queries: 314
PHP Memory Usage: 9.18 MB
--------------------------------
WURFL Version: www.wurflpro.com - 2011-03-06 11:09:18 (Sun Mar 06 11:10:46 -0600 2011)
WURFL Devices: 14221
PATCH New Devices: 40
PATCH Merged Devices: 1


I've created a little test php file...
<?php
require_once('./TeraWurfl.php');
$wurflObj = new TeraWurfl();
$wurflObj->getDeviceCapabilitiesFromAgent();
if($wurflObj->getDeviceCapability("is_wireless_device")){
echo "<h2>WIRELESS</h2>";
}
else {
echo "<h2>NOT WIRELESS</h2>";
}
?>
...have tried it with a few different user-agents and it works great!!


Also, as requested...

The MySQL Server Version:
5.1.47-rel11.2-log


SHOW TABLES:
TeraWurflCache
TeraWurflIndex
TeraWurflMerge
TeraWurflSettings
TeraWurfl_AOL
TeraWurfl_Alcatel
TeraWurfl_Android
TeraWurfl_Apple
TeraWurfl_BenQ
TeraWurfl_BlackBerry
TeraWurfl_Bot
TeraWurfl_CatchAll
TeraWurfl_Chrome
TeraWurfl_DoCoMo
TeraWurfl_Firefox
TeraWurfl_Grundig
TeraWurfl_HTC
TeraWurfl_Kddi
TeraWurfl_Konqueror
TeraWurfl_Kyocera
TeraWurfl_LG
TeraWurfl_MSIE
TeraWurfl_Mitsubishi
TeraWurfl_Motorola
TeraWurfl_Nec
TeraWurfl_Nintendo
TeraWurfl_Nokia
TeraWurfl_Opera
TeraWurfl_OperaMini
TeraWurfl_Panasonic
TeraWurfl_Pantech
TeraWurfl_Philips
TeraWurfl_Portalmmm
TeraWurfl_Qtek
TeraWurfl_SPV
TeraWurfl_Safari
TeraWurfl_Sagem
TeraWurfl_Samsung
TeraWurfl_Sanyo
TeraWurfl_Sharp
TeraWurfl_Siemens
TeraWurfl_SonyEricsson
TeraWurfl_Toshiba
TeraWurfl_Vodafone
TeraWurfl_WindowsCE
wurfl_object_cache (from my old WURFL installation)
jhodgski
 
Posts: 20
Joined: Wed Apr 06, 2011 11:42 am

Re: Internal Server Error after wurfl upload

Postby jhodgski » Wed Apr 06, 2011 4:17 pm

Am now trying it all over again, using these attributes: is_wireless_device, resolution_width, xhtml_support_level.
Output:
Database Update OKTotal Time: 42.038813114166
Parse Time: 1.0392680168152 (TeraWurflXMLParser_SimpleXML)
Validate Time: 0.0071361064910889
Sort Time: 1.9584369659424
Patch Time: 0.061084032058716
Database Time: 38.964473962784
Cache Rebuild Time: 0.0084140300750732
Number of Queries: 314
PHP Memory Usage: 10.66 MB
--------------------------------
WURFL Version: www.wurflpro.com - 2011-03-06 11:10:16 (Sun Mar 06 11:11:41 -0600 2011)
WURFL Devices: 14221
PATCH New Devices: 40
PATCH Merged Devices: 1

Have made a more involved test page and it works a treat.

Many thanks, Steve, for your excellent support.

Regards,
James
jhodgski
 
Posts: 20
Joined: Wed Apr 06, 2011 11:42 am

Re: Internal Server Error after wurfl upload

Postby kamermans » Wed Apr 06, 2011 4:25 pm

Hi James, no problem! I'm glad we got it working, and I'm even more glad that my time spent on the WURFL Customizer is paying off :)
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: Internal Server Error after wurfl upload

Postby kamermans » Wed Apr 06, 2011 4:27 pm

Also, are you using the MySQL5 connector now or MySQL4? It's still strange to me that the install script was unable to create the test procedure.
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

PreviousNext

Return to Installation / Configuration

Who is online

Users browsing this forum: No registered users and 4 guests

cron