ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

First time plugin question

July 19, 2012 1:52pm

Subscribe [1]
  • #1 / Jul 19, 2012 1:52pm

    cbad

    60 posts

    I posted this over in the develop forum, but haven’t gotten much response and thought maybe some of the Ellis Labs people might have some thoughts. If this breaks any kind of cross posting rules, let me know and I’ll avoid it in the future.

    I have 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 outside of EE.

    But when I uploaded it to the servers (LAMP), the page triggers an error in browsers. In Chrome it shows as a 330 error, but that seems to be sort of a catch-all.

    I 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 from working? Any name spacing issues with codeigniter or EE?

    I have verified the paths and files all exist. I’ve checked file permissions. I have error_reporting on. 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!

     

  • #2 / Jul 19, 2012 2:14pm

    cbad

    60 posts

    Never mind, I found it. There was a line feed after the final ending php tag (?>) in phpglobals.php that was causing the problem.

    But thanks for being here anyway!  😊

  • #3 / Jul 19, 2012 5:22pm

    Kevin Smith

    4784 posts

    Glad you were able to get this one fixed up, cbad! Let us know if we can help again in the future!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases