kicken Posted April 6, 2012 Share Posted April 6, 2012 My guess is that your version of rand() could only seem to come up with 5048 unique values. That also explains why my code just looped forever because mine would not stop until you reached 600,000 unique values which for some reason your setup is incapable of doing. I have no idea why your implementation of rand() seems to be so poor. What OS and PHP version are you using? Quote Link to comment https://forums.phpfreaks.com/topic/260288-the-limits-of-php/page/2/#findComment-1334854 Share on other sites More sharing options...
Shadowing Posted April 6, 2012 Author Share Posted April 6, 2012 PHP 5.3.8 windows xp pro, 32bit Just using what came with XAMMP Quote Link to comment https://forums.phpfreaks.com/topic/260288-the-limits-of-php/page/2/#findComment-1334868 Share on other sites More sharing options...
Shadowing Posted April 6, 2012 Author Share Posted April 6, 2012 It seems like any code that tries to run more then a second or something it hangs up until the 30 seconds is hit. Googled it pretty hard. doesnt seem like anyone else having a issue like this. Quote Link to comment https://forums.phpfreaks.com/topic/260288-the-limits-of-php/page/2/#findComment-1334889 Share on other sites More sharing options...
Shadowing Posted April 6, 2012 Author Share Posted April 6, 2012 The larger map generator that uses the code ive been using in the example still wont work though. so I came up with an idea. I could use sleep() so every 100 stars or what ever i make it sleeps for 2 seconds. I just did a test on 10 by 10 stars and it seems to be working so far. my map generator consist of a few functions to make a unique stargate address to prevent stars from being to close to each other to make a unique random planet name and to random a number for a picture. Thats why I was creating 600k stars cause i really only need liek 150k but im running more functions. I asked my question in the apache forum to see why i have this time out issue. If sleep() is working then that means im simply running out of resources i would think. Quote Link to comment https://forums.phpfreaks.com/topic/260288-the-limits-of-php/page/2/#findComment-1335057 Share on other sites More sharing options...
Shadowing Posted April 6, 2012 Author Share Posted April 6, 2012 Ahh this sleep idea is working. what happends when a page loads is there some sort of cache flush or something that resets the resources? cause i was thinking if there is a function I can use to reset what ever it is that is being maxed out. then instead of me using sleep() i can just simply reset it. anyone know what gets reset after every page load? and if there is a function I can do to make it do the task. Quote Link to comment https://forums.phpfreaks.com/topic/260288-the-limits-of-php/page/2/#findComment-1335065 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.