11th October, 2007

vs.hive v1.2

Thursday, 8:14 am in CodeGirl

Okay, so I’m back from painting and – as promised – here is v1.2 of vs.hive.  Some minor HTML validation bug fixes, but the bulk of this update is adding support for modules.

To that end, the first module has been released; vs.hive-affiliates (same download link as above).  It pretty much does exactly what it sounds like it does – provides affiliates management – so knock yourselves out.  I think it’s okay… but I’m kinda braindead at the moment, so if there are bugs, there are bugs.  Next release will be the extended codes manager, since the backend is pretty much identical.

In related news, I’ve noticed a related issue has started popping up on a few of the sites that have been trying to install vs.hive,  It looks like so:

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/username/public_html/fan/example/config.inc.php:1) in /home/username/public_html/fan/example/config.inc.php on line 281

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/username/public_html/fan/example/config.inc.php:1) in /home/username/public_html/fan/example/config.inc.php on line 281

There’s some good news and some bad news.  The good news, is I know what’s causing the error.  Essentially, vs.hive is attempting to set a session cookie.  Like all cookies, these must be set in the header block of an HTTP request (this isn’t the stuff between the <head> tag; an add-on like Live Headers for Firefox will allow you to see them).  Now, PHP automatically sends the ‘end’ of the header block whenever you start outputting stuff that looks like text to the browser.  You cannot set additional headers – such as cookies – after this happens, and PHP will give you this error if you try.  So that’s what’s going on; line 1 of config.inc.php contains some kind of text character (white space counts, incidentally) before the opening PHP tag.

The bad news is I don’t know what’s causing what’s causing the error.  It could pretty much be just about anything; the most common culprit is corrupted encoding caused by text editors that don’t understand UTF-8, or possibly an FTP client that’s attempting to upload PHP files as binary rather than ASCII.  I haven’t been able to replicate the issue locally; in fact, I haven’t even seen it in about five years.1  As far as I’ve been able to tell, it’s not a problem in the code; it’s something in the user’s local environment that’s corrupting the file.

So, how to fix it?  To be honest, I’ve got no idea.  The easiest solution would be to back-up your corrupted config.inc.php file and re-upload an unedited version from the original zip archive.  Visit your site and see if it errors.  If it doesn’t, slowly go through and edit the config file piece by piece (database variables first), testing after each edit/re-upload.  Try using different text editors and different FTP clients; that sort of thing.

Additionally, if someone has one of these files and would like to send it to me, that would be super; I’m not sure it will allow me to provide an answer, but at least I will be able to replicate the problem.


Oh!  One more thing.  So of you might have discovered this already, but taking the <base href= out of vs.hive’s header.inc.php will fuck up certain links (specifically the pagination on the members page).  This is the price of the ‘neat’ faux-.htaccess URLs.

  1. Caused by a dumb FTP client.  Nowadays, most FTP clients are pre-configured to understand that PHP files are text; in those days, they weren’t. ^

Comments

  1. User Avatar

    Yay update!

    BTW, I have that problem you mentioned but I haven’t gotten around to tinkering with it yet. I’ll send you my config.inc.php file.

    If it helps, the problem started when I almost finished editing everything and I had CAPTCHA turned on. I tried out the form and I couldn’t get the form to send; every time I entered the CAPTCHA code, even after multiple attempts, it said that the code is incorrect. I went back to config.inc.php to change set CAPTCHA to “0” and that’s when the errors started popping up. Either me reediting the config.inc.php caused the error, or there was already something wrong with CAPTCHA.

  2. User Avatar

    I have that problem you mentioned

    Yup, your site was what reminded me of it. smile.png

    Well, after opening your email with the config.inc.php I can show you right away what the problem is:

    [ image ]

    See the  at the start there?  That’s the corruption; tracking down what’s causing it is another issue.  I don’t think it would be related to the CAPTCHA; that’s likely to be a different issue.

    Out of curiosity, what text editor and FTP client do you use?

  3. User Avatar

    I use Notepad++, normal Notepad, and I use CuteFTP  (though I also have FireFTP as a Firefox addon).

    That’s really odd, I’ve never noticed those random characters before. I just opened up the file in both Notepad++ and Notepad and I don’t see those characters at all. Could it just be an email thing?

    BTW, I use vs.hive for another fanlisting I have, and there’s no problems there, even though I edit all my files with the above programs.

  4. User Avatar

    It’s not an email thing; those character are definitely the junk. You’re not seeing them because your file encoding is incorrect.

    My best guess, is that Notepad is attempting to save the file as ANSII and it’s just… messing up somehow.  I dunno.  I’ve emailed you back the file; let me know if this helps (no idea if it will!).

Add Comment
auto insert line breaks
use log.code
use smilies
Verification
  • v-s.net v0.6 and all content (unless noted) © Dee.
  • sk.log v0.6 spat this out in 2.121 seconds.
  • 50 / 216,626
artistic-twobyfour