5

I'm developing a wordpress plugin locally using:

  • MAMP (updated to PHP 5.4.4)
  • PhpStorm
  • Chrome

I've turned off short tag, magic quotes and zlib compression, but occasionally load-scripts.php comes back all gibberish:

Broken page

The admin area has no styling, and none of the scripts on the page load or work.

Occasionally, though they do work with a few hard refreshes ( shift + cmd + r )

I've seen a few similar examples and tried their fixes, to no avail (hence disabling short tags, magic quotes and zlib compression).

I've tried it in Firefox, and it breaks ... but when I hard-refresh the page a few times, the issue goes away.

I cannot replicate the issue in Safari.

6
  • 1
    This is almost certainly nothing to do with WordPress - sounds like an issue with Firefox (as Safari works fine) - this should probably go to ServerFault or SuperUser
    – anu
    Jul 16, 2012 at 17:36
  • thanks anu, for the heads up. thanks for the migration and edits, stack mods. i was speaking w/ another dev, and they've had similar issues with chrome before in a local environment, something about the headers not getting there / being sent before file is interpreted. which makes sense, load-scripts.php is supposed to be interpreted as js, but if arrived with something wrong in the header it could fail. i'm not marking this as the answer. just a thought. Jul 16, 2012 at 19:50
  • Same is happening here. Strange thing is that this was working fine a few days ago. will post a solution if i find
    – chifliiiii
    Aug 7, 2012 at 19:45
  • Well this is really strange. I opened the local site with a "incognito window" of Chrome and the problem dissapeared :S
    – chifliiiii
    Aug 7, 2012 at 19:47
  • that is weird. good to know though, thanks for posting! Aug 8, 2012 at 16:17

7 Answers 7

12

I had the same issue. Deleting my cookies from that domain and clearing my cache fixed it.

3
  • this is the only thing i could figure it was, probably an issue between some cacheing, old cookies, and chrome updating. ty to everyone for posting tho. a head scratcher for sure. Oct 19, 2012 at 14:30
  • After updating Wordpress on my local webserver, I had the same issue, Cleared cache and eveything is fine, thanks :)
    – GabLeRoux
    Feb 11, 2013 at 20:02
  • @Justin God bless you!
    – Doug
    Jul 30, 2021 at 0:25
12

The issue, as hakre points out, is almost certainly the cache setting in MAMP. You need to disable it by going to MAMP > Preferences > PHP and set Cache to '--'. Restart MAMP, clear your browse cache and cookies and reload the page.

4
  • my cache settings in MAMP are / were disabled. Oct 17, 2012 at 17:33
  • This was the solution for me.
    – Phil
    Feb 11, 2013 at 10:12
  • Thanks, I had the same issue and couldn't figure out how to clear the cache!
    – Daniel Apt
    Jul 25, 2014 at 22:40
  • For those who don't love the idea of clearing cache, if you're using Chrome just do as @robdodson says here, and then use an incognito window to do your development.
    – Nathan
    Apr 7, 2015 at 15:38
1

Please clean your browsers cache and delete all cookies. Also disable any caching on your localhost webserver installation.

From what you describe, I'd assume this is apache webserver caching and it does this because you once had compression enabled, something PHP might have done transparently before you configured it not to.

Look into your webservers manual and deactivate any caching. Any. That is important for debugging the issue.

Also disable anything that might set headers to tell the browser that it's okay to cache something in the browser cache. See your webservers' manual and disable anything such.

If the webserver had already cached those responses, you can reload how much you want, you will always see that but not in case repetitive reloading de-actives caching for the one or other request.

1
  • i have MAMP set not to cache anything, sry it took me so long to respond. i dumped all my cookies and setup chrome not to cache anything and the problem hasn't happened since. Some local area devs thought it may be an issue w/ a chrome update and my chrome settings. Oct 17, 2012 at 17:34
0

Re-uploading the entire wp-includes directory fixed the problem for me.

0

Simply restarted my Mamp web server and it fixed the issue.

I also emptied my browser cache and deleted cookies but that didn't help.

0

In my case, the error was showing up when I was trying to save a DOMDocument (file) in a folder that wasn't there. I was trying to do something like this:

$xml->save("TEMP/test.xml");

But the folder TEMP wasn't there thus the error was pomping up.

Saving the file to the current directory (e.g. $xml->save("test.xml"); fixed the issue.

0

While you have those dev tools open, if you click and hold the refresh button, some extra options should appear. None of the other solutions here worked for me, but the Empty Cache and Hard Reload option in that drop-down cleared it up.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.