shadiadiph Posted June 7, 2010 Share Posted June 7, 2010 Just changed server to eom.com ini_set not allowed allow_long_arrays not allowed problem is I have string when exploded by \n it returns over 3 million lines of data 130M. worth max_memory is only 64Mb how can I use php to solve this problem? My thought is create the array while($source then create the array in the while statement possible ?????? FYI this is from a zipped csv folder my old server provider I had it working fine lol but the difference is about 1,918 USD a year to allow long arrays and ini_set lol downside my old server was down for 4 a total of 4 weeks in the last 2 years and I have to think of customers I host for. Have my own server but here but no T connections here. : ( Any advice would be appreciated Quote Link to comment https://forums.phpfreaks.com/topic/204088-how-to-get-around-allow_long_arrays-off/ Share on other sites More sharing options...
ignace Posted June 7, 2010 Share Posted June 7, 2010 Don't rely on $HTTP_ you should use $_GET, $_POST, $_COOKIE, .. instead. Quote Link to comment https://forums.phpfreaks.com/topic/204088-how-to-get-around-allow_long_arrays-off/#findComment-1068956 Share on other sites More sharing options...
trq Posted June 7, 2010 Share Posted June 7, 2010 Your problem has nothing at all to do with allow_long_arrays, you might want to look at what that actually does (or see ignace's post for a hint). As for your problem, I would say this is pretty clearly a case of not having the right equipment for the job. 130Mg of data is allot for most systems to be manipulating. What exactly are you doing with this data? Quote Link to comment https://forums.phpfreaks.com/topic/204088-how-to-get-around-allow_long_arrays-off/#findComment-1068961 Share on other sites More sharing options...
shadiadiph Posted June 7, 2010 Author Share Posted June 7, 2010 Answer unzip maxminds geocitylite zip file worked fine on the old server problem when writing it creates a huge array unless.there is a way to split a string by \n without creating an array! Sorry having a few beers right now been waking up at 3pm most days recently trying to get back into morning to evening mode Quote Link to comment https://forums.phpfreaks.com/topic/204088-how-to-get-around-allow_long_arrays-off/#findComment-1068972 Share on other sites More sharing options...
shadiadiph Posted June 7, 2010 Author Share Posted June 7, 2010 This is from a zip file downloaded and reuploaded to my site how can I use http get or a cookie? Quote Link to comment https://forums.phpfreaks.com/topic/204088-how-to-get-around-allow_long_arrays-off/#findComment-1068975 Share on other sites More sharing options...
shadiadiph Posted June 7, 2010 Author Share Posted June 7, 2010 Hi Thope one of my first teachers here and I will say thanks for that but if you can't process a file in one go from .zip because of memory allocation how is $_GET $_POST or $_COOKIE going to handle the long arrays or memory limit problem? Yes the new equipment sucks I certainly won't be showing that in public. I set up the server in Apache and turned safe mode off I don't know how they can Even say they support php only on their settings the other option was Php cgi any thoughts? Quote Link to comment https://forums.phpfreaks.com/topic/204088-how-to-get-around-allow_long_arrays-off/#findComment-1068991 Share on other sites More sharing options...
PFMaBiSmAd Posted June 7, 2010 Share Posted June 7, 2010 So, does your web host allow php settings in a local php.ini (when php is running as a CGI application) or in a .htaccess file (when php is running as an Apache Module)? If you post the code you are currently using, so that we can get the big picture of what you are actually doing, someone would be able to suggest ways of doing it within a restricted amount of memory. Assuming you are placing this data into a database, have you tried importing the unzipped csv data using your favorite database management tool? Quote Link to comment https://forums.phpfreaks.com/topic/204088-how-to-get-around-allow_long_arrays-off/#findComment-1068992 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.