General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 17th, 2003, 05:23 PM
phpnewbie phpnewbie is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Netherlands
Posts: 8 phpnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Fatal error: Allowed memory size of 33554432 bytes exhausted

Hi all,
.
as you can see in the subject, I get the following error :
Fatal error: Allowed memory size of 33554432 bytes exhausted

What you might also have noticed is that I allready tuned the value in php.ini to be 32 MB in size (searching google is a nice thing to do before actually posting something luke this).
BUT, i figured out when I get the error !!
.
Here's what my php script does.
- checks if the user is actually logged in
- if it is a certain user, it will show me the directory contents of the web page that user hosts on my site.
This last part is where the problem comes:
if that directorie is an actual directory, everything is ok, BUT, if it is a link to another directory anywhere (even one 'next to' the link) within my system, I get the error !!!

So, the chdir does not seem to follow the link, causing this memory exception to be thrown !!

If anybody has any ideas on how I could possibly be able to solve this that would be great. (I just thought of something: hard-link instead of a soft link, but I have to look into that on first.)

BTW, I'm running on Linux

Reply With Quote
  #2  
Old December 17th, 2003, 08:55 PM
Mike_r Mike_r is offline
ExoCrew
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 68 Mike_r User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Try running a validation to check if the dir listing is a link or a sub-dir or a file.

is_link() can help find it its a link, is_dir for directory.

Reply With Quote
  #3  
Old December 18th, 2003, 11:25 AM
phpnewbie phpnewbie is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Netherlands
Posts: 8 phpnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks, but that would not to the trick for me. It will merely tell me that it is a link, but I want to chdir() into that link, and that's the part that is failing !

Reply With Quote
  #4  
Old December 18th, 2003, 04:30 PM
Mike_r Mike_r is offline
ExoCrew
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 68 Mike_r User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Then use $DIR = readlink( $LINK ); And then use chdir( $DIR ); ...

Reply With Quote
  #5  
Old December 20th, 2003, 07:14 AM
phpnewbie phpnewbie is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Netherlands
Posts: 8 phpnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks, but that didn't do the trick for me either.
I did find out why it would fail. I have a link in /var/www/html/users. (eg funny). when I do a chdir(funny), the actual dir would become /data/funny. However, I don't allow that, and change it back to /var/www/html/users/funny. Hence I go into an infinate loop. I have to do some redesign here. Thanks for the help anyway.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Fatal error: Allowed memory size of 33554432 bytes exhausted


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT