PHP Set UID Mode

Discussion in 'Feedback/Feature Requests' started by gahan, Jan 1, 2006.

  1. gahan

    gahan New Member

    I wish I could see such feature at after 'CGI Set UID Mode' some day :)
    PHP Set UID Mode: PHP file UID/Doc root UID

    Is there any chance that lsws will support that? I know it's impossible with fcgi (well running seperate wrapper for each uid 'solves' issue) but how about lsphp?

    All the best in the 2006
  2. mistwang

    mistwang LiteSpeed Staff


    It is possible to run PHP in suexec CGI mode, there is no dedicated configuration for this but it can be done with some simple rewrite rules to simulate Apache's "Hanlder" directive. I will post the rewrite rule later.

    Anyway, running PHP as CGI does not give the best performance.
    It is not possible to do that with lsphp yet, it is on our to do list. :)

    Happy new year!
  3. gahan

    gahan New Member

    That would be great.

    Thanks for reply
  4. pizzaman

    pizzaman Active Member


    I've read through a couple posts regarding running PHP suExec through fastcgi interface, and what I understand is that it's currently not possible in a straightforward way. However, you suggested that it's possible to do so if we provide dedicated php-fcgi process for each UID. How exactly do we do that?

    I've running such a setup with lighttpd with great success bar some sites canot be run there since due to some complications in its rewrite enginge--so I decide to give litespeed a try. So far so good, except I need to run php in suExec way. :)

    Thanks in advance.
  5. mistwang

    mistwang LiteSpeed Staff

    Just define a dedicate PHP FCGI or LSAPI application, php script handler, and set "CGI Chroot Mode" to "Doc Root UID".

    For multiple similar vhost, you can use our vhost template feature.
  6. pizzaman

    pizzaman Active Member

    Oh wow, at first I set "CGI Set UID Mode" to "CGI File UID" and the script ran as "nobody". After I changed it to "DocRoot UID", then it magically runs as that user. :)

    Thanks for your answer. I'll spend some time testing litespeed and if it turns out ok, will move some production sites to using it (behind apache proxy).
  7. Arkadius

    Arkadius Member

    pizzaman, could you please post how you created the FastCGI app ?

    I am able to run the same if i start a php -b under the user I plan to but a start wrapper would be supreme for what I am trying to do.

    Thank you.


Share This Page