![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Sofa King Band
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
|
PHP pro's, got an interesting problem....
I recently upgraded my PHP to 5.2.1 and now have an interesting problem.
I have a query grabbing results from a database. The results then loop in a while loop and get dumped into an array for storage. The problem is, it worked before.... but now it dies out after it hits a certain point. I don't get any "out of memory" errors, it just.... stops. I know the code is ok, I can get results from other queries that don't return as much information, and it worked on 5.2. I bumped the memory usage to 100Mb in the ini file, and it still dies at the same point. Thoughts? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Sep 2003
Posts: 8,713
|
maybe its a time out server side ?
__________________
![]() TrafficCashGold Paying Webmasters Since 1996! Awesome Conversions! Fast Weekly Payments! Over 125 Tours! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
Did you try:
set_time_limit(0) ? Maybe it is a timeout somewhere.
__________________
Your post count means nothing. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Sofa King Band
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
|
Nah, it gives me a blank screen within 2-3 seconds. So it's dying out during the loop pretty fast.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
I saw a post made today somewhere about drupal and php 5.2.1 not playing nice with each other - throwing memory errors or something. Not sure what it could be as you'd think a simple loop would run fine. Are you running it from command line or a browser?
__________________
Your post count means nothing. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Confirmed User
Join Date: Sep 2003
Posts: 8,713
|
Quote:
Try to check the code and look if the page variables are received with $_get or $_post since if this is not determined it might be the problem.
__________________
![]() TrafficCashGold Paying Webmasters Since 1996! Awesome Conversions! Fast Weekly Payments! Over 125 Tours! |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Sofa King Band
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Sofa King Band
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
|
Quote:
I'm pretty sure it is a memory error, but like I said, I'm not getting the error. I turned on _ALL and even turned on the logging to throw errors to the apache error log and yet... I get nothing. Just a blank page in my browser where I should see results. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
<&(©¿©)&>
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
|
wow, didn't even notice we are up to 5.2.1, seems like yesterday when 4.2.1 was out...
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000 Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager ![]() Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Confirmed User
Join Date: Sep 2003
Posts: 8,713
|
the code could work fine on your last version of php to increase security some defaults were changed and you might need to optimize your code or your php settings.
For best idea of what could be changed just review it at php.net ![]()
__________________
![]() TrafficCashGold Paying Webmasters Since 1996! Awesome Conversions! Fast Weekly Payments! Over 125 Tours! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed IT Professional
Industry Role:
Join Date: Nov 2005
Location: Hollywood, CA
Posts: 3,744
|
try it from the command line, if it doesn't work there than there was a problem with the installation so you'll need to re-install. If it works then it's your software. Doesn't anyone know how to use trial and error these days?
![]()
__________________
The Best Affiliate Software, Ever. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed IT Professional
Industry Role:
Join Date: Nov 2005
Location: Hollywood, CA
Posts: 3,744
|
And yes, that could also be the issue.
__________________
The Best Affiliate Software, Ever. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 | |
Sofa King Band
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
|
Quote:
Doesn't anyone use common sense these days? ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
So Fucking Banned
Join Date: Oct 2002
Location: MaxCash.com
Posts: 12,745
|
Damn - this came up on a WP forum I was looking at the other day.
I will have a search through my history, but it could have been on my laptop that I have loaned out. I will get back to you. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 | |
Confirmed User
Join Date: Jan 2007
Posts: 190
|
Doing some searching via google, shows many people are suffering from memory leaks on heavy array use, you can see the changes of the PHP core here
Quote:
You may want to provide some sample code so people can advise/test locally what is failing. Have you tried checking if anything has changed in your PHP setup with a phpinfo.php page with PHP Code:
You can also try putting errors on in php.ini or via .htaccess. When you get a white page straight away it usally means a code error has taken place so seeing the code could route out the problem. Just because you are using similar code else where and it works, doesnt mean this version does. You could have a rogue .,'" etc etc. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 | |
Sofa King Band
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
|
Quote:
PHP Code:
And my phpinfo() looks the same from what I could see. I tried to keep all my settings the same. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Too lazy to set a custom title
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
|
There's been a lot of problems with 5.2.. thankfully 5.2.1 fixed my biggest problem but I'm sure there's more...
I see you have all the logs turned on.. Have you confirmed that it would report an error by "forcing" one in your mysql query? I've been having a lot of issues with my queries where I didn't before so would be interested to know if the query actually works or fails and that the problem is after that. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 |
Confirmed User
Join Date: Jan 2007
Posts: 190
|
Hi,
If it is writing 1200 lines a failing, have your tried running a similar query along through PHPmyadmin or similar to see if any of the fields you are pulling are empty. Do you do any outputting in the page? try putting in some checking i.e. PHP Code:
What type of field/size are you pulling into the array? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 |
Confirmed User
Join Date: Jun 2006
Posts: 1,062
|
It sounds like your MySQL database has alzheimers.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 | |
Sofa King Band
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
|
Quote:
I checked and the mysql_num_rows tells me that there's 2900+ results. So it's pulling the data properly... it's all there. However once I start looping it and putting it into the array, it dies. If I alter the code to just output the fields in $line, it outputs everything quite nicely. It's dumping the information into the array that causes it to choke out. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 | |
So Fucking Banned
Join Date: Oct 2002
Location: MaxCash.com
Posts: 12,745
|
Quote:
Have you got safe mode on or off? Obvious stuff - but I have missed it before on a new server. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#22 | |
Sofa King Band
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
|
Quote:
And safe mode is turned off. Good thinking. I hadn't actually checked to see about safe mode, just assumed... but now that you mentioned it, I checked just to be sure. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#23 |
Confirmed User
Join Date: Jan 2007
Posts: 190
|
Hi,
try doing PHP Code:
PHP Code:
What type of data are you dumping? String?, links? string lengths? If you want to PM me I could have a direct look if needed to help debug it, im just interested in what would cause such an issue. :/ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#24 |
Sofa King Band
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
|
Ok, I found it... took me forever though!
php 5.2.1 put in a second php.ini file.... one in the php folder and one in the apache folder. The new one had a memory limit of 8, but it was reporting what I saw in the other php.ini. And therefore, my memory limit was way lower than I thought it was. Once I changed the second php.ini file, all was good! Thank you to everyone for helping me to solve this ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#25 | |
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
Quote:
I've had the stupid issue happen to me and it drove me crazy where a "ghost" php.ini file existed somewhere. Since then, I try and remind myself to check php_info() and make sure shit's where I think it should be.
__________________
Your post count means nothing. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#26 | |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
Quote:
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |