Hello-
I’ve just written my first non-trivial plug-in, and everything went really smoothly on my localhost machine (WAMP). This is a private plugin, and I want to include some scripts we use elsewhere.
But when I uploaded it to the servers (LAMP), the page won’t show at all. In Chrome it shows as a 330 error, but that seems to be sort of a catch-all.
I’ve traced it down to (at least) one line in the plugin:
require_once $_SERVER['DOCUMENT_ROOT'].'/phpglobals.php';Like I said, it works great on my local dev machine. Is this not allowed in a plugin, or do you think there is some sort of config or server setting that prevents this working?
I’ve verified the paths and files all exist. We use this same file in other php scripts all over the place, addressing it in the same way.
Any ideas? I’m splitting hairs trying to understand it.
Thanks!
You might want to turn on error reporting to see what the issue is.
error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);(You may need to add that to index.php.)
Also, try echoing the path to see what it comes up as in the server (just to make sure it looks right).
echo $_SERVER['DOCUMENT_ROOT'].'/phpglobals.php';I’d also check the file permissions on the file to make sure it’s readable and executable.
Thank you for the response. I’ll turn on the error reporting and check file permissions.
Is there some reason permissions need to be different in EE addons as opposed to normal php execution? Like I said, we access this file from other places no problem.
I also had checked the path and file both exist. Hopefully permissions may be the answer.
Thanks!
Found the problem. In the file I was including, there was a line feed after the closing ?> that was causing the error. It was messing with the header, thus causing the browser error. Never got a php or EE error though.
Anyway, thanks for your help, it got me looking in the right direction!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.