![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics 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 contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| Hi, I have a question about memory consumption of php scripts. I am running php on my Linux server, together with apache and MySQL. I have this very simple script (listed below). Everytime I run that script by browsing to it with my browser (from Windows 2000, IE6), the amount of free memory on the Linux server slowly decreases. Not fast, but is does.. This is the script.. ======================== <?php echo <<<END <html> <head> <link rel=stylesheet type='text/css' href='/style.css'> </head> <body> </body> </html> END; ?> ======================== As you can see, nothing special there. No array's, vars, database things, or whatsoever. The reason why I checked this is because I have several more complex scripts. With these scripts, I run out of memory pretty fast (have only 64MB installed in my server to get the memory back.. Anyone an idea why this happens? (and how this can be solved?) With regards, Marcel | |||
|
| Advertisements |
| | #2 | ||
| Hey there, It looks like you've migrated from Perl to PHP I don't know why the memory consumption occurs, but I do know how to make your code more efficient: > This is the script.. > ======================== > <?php > > echo <<<END You don't need to use this echo command...it's a typical PERL thing. You can close the PHP code using "?>" and type whatever normal HTML code, when you want to use PHP again, simply re-open the code with a "<?php" statement. Example: <?php print $testvar; ?> <BR><BR> <!--normal HTML outside PHP code --> <?php print $testvar2; ?> </BODY> <!-- again normal HTML --> </HTML> Ivo | |||
|
| | #3 | ||
| pickme wrote: > Hi, > > I have a question about memory consumption of php scripts. I am running php > on my Linux server, together with apache and MySQL. I have this very simple > script (listed below). Everytime I run that script by browsing to it with my > browser (from Windows 2000, IE6), the amount of free memory on the Linux > server slowly decreases. Not fast, but is does.. > > This is the script.. > ======================== > <?php > > echo <<<END > <html> > <head> > <link rel=stylesheet type='text/css' href='/style.css'> > </head> > <body> > </body> > </html> > END; > > ?> > ======================== > > As you can see, nothing special there. No array's, vars, database things, or > whatsoever. > The reason why I checked this is because I have several more complex > scripts. With these scripts, I run out of memory pretty fast (have only 64MB > installed in my server > to get the memory back.. > > Anyone an idea why this happens? (and how this can be solved?) > > With regards, > Marcel Just out of curiousity, if the page does not have the PHP script, do you still run out of memory? Todd | |||
|
| | #4 | ||
| > Just out of curiousity, if the page does not have the PHP script, do you still > run out of memory? > > Todd If I just load a test.html, containing the same code as listed earlier, there doesn't seem to be memory loss. As for what Ivo Swartjes said, I got the echo thing from the php site. I have it inside the php part because sometimes I want to use variables there.. I can't believe that could be the cause of memory loss.. | |||
|
| Featured Websites | ||||
|
![]() |
| Tags: consumption, memory |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| No Memory | Kevin | New Users Help And FAQ | 2 | 06-26-2007 3:28 AM |
| memory | Frederick Potts | GPS | 4 | 06-25-2007 11:49 PM |
| memory | Frederick Potts | GPS | 0 | 06-25-2007 11:44 PM |
| memory allocation php | Zoe Brown | PHP | 4 | 05-20-2007 6:33 PM |
| GD CPU/memory requirements | flamer die.spam@hotmail.com | PHP | 0 | 05-20-2007 6:33 PM |
| Featured Websites | ||||
|