FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Geo-Location Issue
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Geo-Location Issue [message #159229] Wed, 13 May 2009 23:59 Go to next message
nozafc is currently offline  nozafc   United Kingdom
Messages: 75
Registered: April 2009
Karma: 0
Member
I've got a forum that is on shared hosting and I appear to be limited to the size of file I can upload. I'm trying to upload the csv file but it keeps failing. As far as I'm aware there is no way I can change the file size limit

I did try splitting the csv into 3 sections each under 2mb but it appears that this overwrites the existing file?

Any suggestions on how to get the Geo-Ip working ?
Re: Geo-Location Issue [message #159230 is a reply to message #159229] Thu, 14 May 2009 05:55 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Ask your hosting provider to increase the upload_max_filesize setting in php.ini.

If they cannot, upload the file to the server, cut and paste the loading code from admgeoip.php and run it manually.

Best of luck.

Frank
Re: Geo-Location Issue [message #159243 is a reply to message #159230] Thu, 14 May 2009 17:30 Go to previous messageGo to next message
nozafc is currently offline  nozafc   United Kingdom
Messages: 75
Registered: April 2009
Karma: 0
Member
naudefj wrote on Thu, 14 May 2009 06:55
Ask your hosting provider to increase the upload_max_filesize setting in php.ini.

If they cannot, upload the file to the server, cut and paste the loading code from admgeoip.php and run it manually.

Best of luck.

Frank



Thanks for the tip

My webhost wouldn't adjust the setting but I found an easy way to do it. I commented out the line

q("DELETE FROM ".$DBHOST_TBL_PREFIX."geoip");


in the admgeoip.php file which then allowed me to upload the split csv files

Thanks for the info anyway :toppa: , without it I'd never have thought about doing it that way Smile

[Updated on: Thu, 14 May 2009 17:31]

Report message to a moderator

Re: Geo-Location Issue [message #159244 is a reply to message #159243] Thu, 14 May 2009 17:52 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Great job! Thanks for sharing your solution.

Best regards.

Frank
Re: Geo-Location Issue [message #159619 is a reply to message #159244] Sat, 13 June 2009 03:54 Go to previous messageGo to next message
The Witcher is currently offline  The Witcher   United States
Messages: 675
Registered: May 2009
Location: USA
Karma: 3
Senior Member
Excellent answer Frank

Solved an issue I had on 2 separate hosts, I have added this to the Wiki so it is available from the help link on the Geo-IP manager.

Possible Error Messages and solutions:

Error:
Quote:
File upload failed! Please check that file_uploads is enabled in your php.ini file and ensure that the upload_max_filesize setting is bigger than the file's size


solution: Ask your hosting provider to increase the upload_max_filesize setting in php.ini.

Note: I encountered this problem twice, and in both instances my hosts support team resolved the problem in minutes, but they did need to know the size of the file I was attempting to upload which in the case of Geo-IP is 3.72MB




"I'm a Witcher, I solve human problems; not always using a sword!"
Re: Geo-Location Issue [message #161731 is a reply to message #159619] Tue, 02 February 2010 01:37 Go to previous messageGo to next message
djechelon is currently offline  djechelon   
Messages: 46
Registered: July 2005
Karma: 0
Member
Couldn't you simply make admgeoip.php load the database from server's filesystem (so I can upload via FTP) or better remotely, using curl or fopen?
Re: Geo-Location Issue [message #161741 is a reply to message #161731] Tue, 02 February 2010 11:48 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Patches are always welcome.

PS: It should be easy to add command line support (as implemented in some of the other ACP scripts).
Re: Geo-Location Issue [message #164164 is a reply to message #159230] Fri, 07 January 2011 11:00 Go to previous messageGo to next message
The Witcher is currently offline  The Witcher   United States
Messages: 675
Registered: May 2009
Location: USA
Karma: 3
Senior Member
naudefj wrote on Thu, 14 May 2009 00:55
Ask your hosting provider to increase the upload_max_filesize setting in php.ini.

If they cannot, upload the file to the server, cut and paste the loading code from admgeoip.php and run it manually.

Best of luck.

Frank

As a work around could the forums data dump be loaded into "Fudforum_to_go", geo location uploaded then forum dumped and loaded back to the original server?



"I'm a Witcher, I solve human problems; not always using a sword!"
Re: Geo-Location Issue [message #164175 is a reply to message #164164] Fri, 07 January 2011 17:02 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
If your main forum is using SQLite it should probably work.
If not, who knows? Someone will have to test it to confirm.
Re: Geo-Location Issue [message #164178 is a reply to message #164175] Fri, 07 January 2011 17:37 Go to previous messageGo to next message
The Witcher is currently offline  The Witcher   United States
Messages: 675
Registered: May 2009
Location: USA
Karma: 3
Senior Member
You mentioned a patch for FUD2Go MySQL, and SQLite to support cross database export/imports here:

http://fudforum.org/forum/index.php?t=msg&th=119222&goto=162127& ;#msg_162127

But it was apparently never completed, would this still be current?

Index: install/www_root/adm/admimport.php
===================================================================
--- install/www_root/adm/admimport.php	(revision 4928)
+++ install/www_root/adm/admimport.php	(working copy)
@@ -196,6 +189,14 @@
 				// Reverse formatting applied in admdump.php.
 				$line = str_replace('\n', "\n", $line);
 
+				// Handle different quote styles between databases for cross-database export/imports.
+				// For example, change \' --> '' (MySQL's --> SQLite or pgSQL)
+				if (__dbtype__ == 'mysql') {
+					$line = str_replace("''", "\'", $line);
+				} else {
+					$line = str_replace("\\'", "''", $line);
+				}
+
 				if (($line = trim($line))) {
 					if ($line{0} != '(') {
 						if ($tmp && !$skip) {


If so I'd be willing to give it a test and see, having that functionality for FUDforum2go
Would seem like a necessity if you are going to use it.



"I'm a Witcher, I solve human problems; not always using a sword!"
Re: Geo-Location Issue [message #164179 is a reply to message #164178] Fri, 07 January 2011 17:53 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
If I remember correctly a variation of that patch was eventually committed.
Best would be to just test it. If it doesn't work, we can always prepare another patch.
Re: Geo-Location Issue [message #164182 is a reply to message #164179] Sat, 08 January 2011 00:44 Go to previous messageGo to next message
The Witcher is currently offline  The Witcher   United States
Messages: 675
Registered: May 2009
Location: USA
Karma: 3
Senior Member
Ok I tried it but the initial results weren't quite what I hoped for:
So far without using the patch:
On the 1st attempt to upload geo-Ip got this error:

"File upload failed! Please check that file_uploads is enabled in your php.ini file and ensure that the upload_max_filesize setting is bigger than the file's size"

Checked system info: "Maximum allowed size for uploaded files.
upload_max_filesize = 2M"


So I Modified line 402 in G:\Users\name\AppData\Local\Temp\Server2Go_4452\php.ini to 6MB . (the current ip-to-country excel file is 5,506 KB)

That allowed the file to upload apparently but there was some small errors listed at the bottom of the page, which I did not catch,(FUDforum2Go uses IE so its hard for me to tell off hand.

In attempting to install the FUDforum2Go data dump on a full installation forum I got the "1061: Duplicate key name 'fud30_tv_1_i_t'" error previously addressed followed by "FATAL ERROR: No session, cannot update status!" so I was unable to ensure that the Geo_Ip had been successful installing to FUDforum2Go and uploading via the data dump or not.

I will try it again and get back.


"I'm a Witcher, I solve human problems; not always using a sword!"
Re: Geo-Location Issue [message #164207 is a reply to message #164179] Sun, 09 January 2011 15:47 Go to previous messageGo to next message
The Witcher is currently offline  The Witcher   United States
Messages: 675
Registered: May 2009
Location: USA
Karma: 3
Senior Member
naudefj wrote on Fri, 07 January 2011 11:53
If I remember correctly a variation of that patch was eventually committed.
Best would be to just test it. If it doesn't work, we can always prepare another patch.

Ok I tried it again using a 4 GB thumb drive with no joy!

Errors mentioned last time were: "Errors on page" and "done but with errors on page"

Upload timed out after 30 seconds: Fatal error: Maximum execution time of 30 seconds exceeded in G:\FUDforum2Go testing\htdocs\include\theme\default\db.inc on line 100

Changed same to 3 minutes and retried:

Fatal error: Uncaught exception 'Exception' with message '(G:\FUDforum2Go testing\htdocs\include\theme\default\db.inc:101<br /> G:\FUDforum2Go testing\htdocs\include\theme\default\db.inc:108<br /> G:\FUDforum2Go testing\htdocs\adm\admgeoip.php:144<br /> ) 23000: columns ips, ipe are not unique<br /> Query: INSERT INTO fud30_geoip (ips, ipe, cc, country) VALUES('417800192','417808383','bs','BAHAMAS')<br /> _POST: array ( 'S' =&gt; '33d8c0899c1ea85a2eefd772f4db7b56', 'SQ' =&gt; 'ec3b60355bbcb09af8ce6f8ee9daac4b', 'format' =&gt; 'IP2C', 'btn_submit' =&gt; 'Upload IP Database', )<br /> Database version: 3.3.7undefined<br /> [Referring Page] http://127.0.0.1:4001/adm/admgeoip.php<br /> ' in G:\FUDforum2Go testing\htdocs\include\core.inc:215 Stack trace: #0 G:\FUDforum2Go testing\htdocs\include\theme\default\db.inc(101): fud_sql_error_handler('INSERT INTO fud...', 'columns ips, ip...', '23000', '3.3.7undefined') #1 G:\FUDforum2Go testing\htdocs\include\theme\default\db.inc(108): uq('INSERT INTO fud...', 1) #2 G:\FUDforum2Go testing\htdocs\adm\admgeoip.php(144): q('INSERT INTO fud...') #3 {main} thrown in G:\FUDforum2Go testing\htdocs\include\core.inc on line 215


"I'm a Witcher, I solve human problems; not always using a sword!"
Re: Geo-Location Issue [message #164208 is a reply to message #164207] Sun, 09 January 2011 16:21 Go to previous messageGo to next message
Ernesto is currently offline  Ernesto   Sweden
Messages: 413
Registered: August 2005
Karma: 0
Senior Member
Did you unpack the geo-ip file first?

Re: Geo-Location Issue [message #164209 is a reply to message #164208] Sun, 09 January 2011 16:44 Go to previous messageGo to next message
The Witcher is currently offline  The Witcher   United States
Messages: 675
Registered: May 2009
Location: USA
Karma: 3
Senior Member
Ernesto wrote on Sun, 09 January 2011 10:21
Did you unpack the geo-ip file first?


Yes, downloaded and expanded a new version just this week.


"I'm a Witcher, I solve human problems; not always using a sword!"
Re: Geo-Location Issue [message #164210 is a reply to message #164209] Sun, 09 January 2011 17:13 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Look at the error: "columns ips, ipe are not unique".
You are loading duplicate data.
The '417800192' to '417808383' range is already in the db.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Ver 3.0.2 Post Form options fail (RESOLVED)
Next Topic: A Bunch of Questions
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Apr 25 00:00:42 GMT 2024

Total time taken to generate the page: 0.02731 seconds