Slowly proceeding with my V-Server: What PHP wants

Today after proceeding with the work I have to do, I was stuck with one problem, so I stopped working and took a bit of time continuing to try to get php work through hunchentoot. The last time it worked partially, and it seemed like it needs some more environmental variables.

So I reconfigured my hunchentoot to use php-cgi through cgi rather than through fastcgi. And I changed /etc/alternatives/php (which was a symlink anyway) into

#! /bin/bash

env > /tmp/environz
php5-cgi

Surprisingly, this worked, and looking at /tmp/environz, I saw some strange variables being set:

HTTP_X_REQUESTED_WITH=XMLHttpRequest

What a strange variable this is. I dont see any sense in adding this information. Ok, well, maybe to improve security, that is, no xss-injected javascript can access special content without the user’s notice.

HTTP_X_PROTOTYPE_VERSION=1.6.0.1

I have no idea what this does. Obviously giving some version-number. I will try what happens when not setting it. And if it fails, I’ll maybe just set it to 1.6.0.1 and see what happens.

HTTP_CONNECTION=keep-alive

Dunno, why a cgi-script would want to know this. There are quite a few other HTTP_ variables. As far as I read, HTTP_* is just the value of the Http-Header *, passed by the server. So maybe I will just do this.

REDIRECT_STATUS=200

This is the most strange variables of all. I dont really get the point to this. Googling for it, I only found strange results.

Well, at the moment I somehow get Segmentation Faults from php-cgi. And actually I am too tired to proceed working at it. At least as soon as my current work is done, I will spend a few days get this whole thing work properly. But till that, I will need enough sleep. So … Good Night.

2 Antworten zu Slowly proceeding with my V-Server: What PHP wants

  1. HTTP_X_REQUESTED_WITH=XMLHttpRequest

    You need this to identify AJAX requests.

    HTTP_X_PROTOTYPE_VERSION=1.6.0.1

    The Prototype library inserts this when it does an AJAX request. Probably.

  2. dasuxullebt sagt:

    Thank you for your comment.
    Hm. Yes. Seems like what you said.

    But as far as I read meanwhile, I dont have to care about the HTTP_ stuff at all. Just passing the (slightly modified) Values to the script – and indeed, according to LiveHTTPHeaders, there are values X-Requested-With and X-Prototype-Version sent by Firefox to the server. So, I will try that soon.

Schreibe einen Kommentar

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s

%d Bloggern gefällt das: