PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, February 15, 2022

[FIXED] Updating PHP files slow on MAMP

 February 15, 2022     mamp, php     No comments   

Issue

Using MAMP, when I change a PHP file and save it, it takes 10-15 seconds for it to be available in my browser. HTML files update immediately. Example:

Example file:

<!DOCTYPE html>
<html>
<body>
<p>This is test</p>
</body>
</html>

When this file is named index.html and placed in MAMP/htdocs directory I can update it, save, open it at http://localhost/index.html and the update is there. If I simply rename the file to index.php (no php code), update and save, I can sit there and refresh browser for 10-20 seconds before I see the update (the old file reloads until the new version appears). I'm a rookie and new to server side scripting, so I'm not sure what is going on with an update to a PHP file - is there some processing that happens by Apache(?) before the file is able to be served? Is my PHP configuration a possible cause?

MacBook Pro osx10.8.5 2.8 Core2Duo 8GB (yes, it's old) -- MAMP 2.2 using port 80 -- PHP 5.5.3 -- Same behavior in all browsers -- Same behavior without an internet connection, so I don't think it is some DNS lookup issue


Solution

Since you're accessing the file via localhost, DNS shouldn't be an issue. If HTML files serve instantaneously, it might be that there is a PHP caching setting. Does this help - http://top-frog.com/2011/03/14/beware-mamps-default-caching-settings/ ?



Answered By - breght
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing