Results 1 to 15 of 30

Thread: lighttp and php tutorial

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2005
    Location
    Vienna, Austria
    Posts
    191
    Quote Originally Posted by LinusW View Post
    Hi, thanks for the great guide

    I have a problem though, since changing from thttpd to lighttpd, .cgi pages have stopped working. PHP support works excellent. When trying to access a cgi page, firefox asks if I want to save the file and ie goes 500-internal server error. I have no idea on how to fix this, please help.
    Maybe the CGI script does not return valid http headers?

    Install "Live http headers" for firefix and see what it returns.

    I'm using lighttpd with cgi shell scripts without a problem.

  2. #2
    Was not able to check headers in firefox, since it only wants to d/l the file. However, in ie, the headers seem to be proper, but as far as i can see, the cgi-script doesn't work.

  3. #3
    I also had this issue after install lighttpd. In my case, change ".cgi" => "/bin/sh" in CGI module section in ligthttpd.conf solve the problem.

    #### CGI module
    cgi.assign = ( ".pl" => "/opt/bin/perl",
    ".cgi" => "/bin/sh" )

    Hope this help.

  4. #4
    Join Date
    Feb 2007
    Location
    CzechRep
    Posts
    151

    lighhtp sessions

    I have lighttp + php + MySQL working on Asus wl-500gP except PHP sessions.
    Directory
    Code:
    /opt/var/lib/php/session
    exists and contains some session files but I can't use session in web browser. What item should I check in php.ini and/or lighttpd.conf?
    I prefer
    Code:
    session.use_cookies =0
    but ...

    php.ini session part:
    Code:
    [Session]
    ; Handler used to store/retrieve data.
    session.save_handler = files
    
    ; Argument passed to save_handler.  In the case of files, this is the path
    ; where data files are stored. Note: Windows users have to change this 
    ; variable in order to use PHP's session functions.
    session.save_path = /opt/var/lib/php/session
    
    ; Whether to use cookies.
    session.use_cookies = 1
    
    ; This option enables administrators to make their users invulnerable to 
    ; attacks which involve passing session ids in URLs; defaults to 0.
    ; session.use_only_cookies = 1
    
    ; Name of the session (used as cookie name).
    session.name = PHPSESSID
    
    ; Initialize session on request startup.
    session.auto_start = 0
    
    ; Lifetime in seconds of cookie or, if 0, until browser is restarted.
    session.cookie_lifetime = 0
    
    ; The path for which the cookie is valid.
    session.cookie_path = /
    
    ; The domain for which the cookie is valid.
    session.cookie_domain =
    
    ; Handler used to serialize data.  php is the standard serializer of PHP.
    session.serialize_handler = php
    
    ; Define the probability that the 'garbage collection' process is started
    ; on every session initialization.
    ; The probability is calculated by using gc_probability/gc_divisor,
    ; e.g. 1/100 means there is a 1% chance that the GC process starts
    ; on each request.
    
    session.gc_probability = 1
    session.gc_divisor     = 1000
    
    ; After this number of seconds, stored data will be seen as 'garbage' and
    ; cleaned up by the garbage collection process.
    session.gc_maxlifetime = 1440
    
    ; PHP 4.2 and less have an undocumented feature/bug that allows you to
    ; to initialize a session variable in the global scope, albeit register_globals
    ; is disabled.  PHP 4.3 and later will warn you, if this feature is used.
    ; You can disable the feature and the warning separately. At this time,
    ; the warning is only displayed, if bug_compat_42 is enabled.
    
    session.bug_compat_42 = 1
    session.bug_compat_warn = 1
    
    ; Check HTTP Referer to invalidate externally stored URLs containing ids.
    ; HTTP_REFERER has to contain this substring for the session to be
    ; considered as valid.
    session.referer_check =
    
    ; How many bytes to read from the file.
    session.entropy_length = 0
    
    ; Specified here to create the session id.
    session.entropy_file =
    
    ;session.entropy_length = 16
    
    ;session.entropy_file = /dev/urandom
    
    ; Set to {nocache,private,public,} to determine HTTP caching aspects.
    ; or leave this empty to avoid sending anti-caching headers.
    session.cache_limiter = nocache
    
    ; Document expires after n minutes.
    session.cache_expire = 180
    
    ; trans sid support is disabled by default.
    ; Use of trans sid may risk your users security.
    ; Use this option with caution.
    ; - User may send URL contains active session ID
    ;   to other person via. email/irc/etc.
    ; - URL that contains active session ID may be stored
    ;   in publically accessible computer. 
    ; - User may access your site with the same session ID
    ;   always using URL stored in browser's history or bookmarks.
    session.use_trans_sid = 0
    
    ; The URL rewriter will look for URLs in a defined set of HTML tags.
    ; form/fieldset are special; if you include them here, the rewriter will
    ; add a hidden <input> field with the info which is otherwise appended
    ; to URLs.  If you want XHTML conformity, remove the form entry.
    ; Note that all valid entries require a "=", even if no value follows.
    url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"

  5. #5
    Join Date
    Feb 2007
    Location
    CzechRep
    Posts
    151

    sessions

    I can see session variables stored in files (like sess_xxxxxxxxxxxx...) in
    Code:
    /opt/var/lib/php/session/
    - it seems to be ok, but when I want do use them (on other php page for instance) nothing happens; content of variables isn't displayed with echo command.


    There is everything ok on my local testing Xampp web server, so I hope php code is correct. I really don't know. Any idea? Maybe permissions? Please.

  6. #6
    Join Date
    Feb 2007
    Location
    CzechRep
    Posts
    151
    Nobody uses php sessions? !!Please help me set up lighttp to work with cookies - thats the problem!!!
    It works with SID in URL. with cookies not.Thanks
    Last edited by sarlacc; 30-06-2007 at 01:43.

  7. #7
    @sarlacc,


    did you ever solve this problem?
    right now i'm experiencing the same problem.
    I have a CMS running on the webserver with a mysql-db. however. when i want to log into the admin section of that cms. it refuses. because the session variable isn't filled with the admin flag.

    It seems to me that this problem is solved when the session variables work.

    i've tried chmod 777 /opt/var/lib/php/session but that didn't work.

    TIA

  8. #8

    Preoblem

    Hi,

    first, thank you for the tutorial...
    and now ive uninstalled the php and tried to reinstall it again, using the same method. it all works fine except when i try to run it it states:

    [admin@(none) init.d]$ ./S45php start
    [admin@(none) init.d]$ ./S45php: ./S45php: 17: /opt/bin/php-fcgi: not found

    i dont know why does it says that because the file is there! and the "S45php" file is copyed from your tutorial.

    ps:when i was reinstaling it, i dont think i removed it completely... i used "ipkg remove php and php-fcgi" command. dont know if thats enough...

    cheers

  9. #9
    Hi,

    My answer to my own question about modxcms (a very nice cms!).:

    I''ve ditched the whole idea about running modx on my asus.

    I couldn't resolve the problem I was having with the internal and external links.

    I tracked the problem down to the 'base href' which modx creates in it's generated html output, if it wasn't for this base href, modx would be a 'near perfect' system. but I couldn't get the base href out of modx.

    That's why I've switched to AIOCP (www.aiocp.com)

    This one works on the internal side of the network, as well as on the external side of the network.

    It's more than I needed, (it's more like a website management system), but it does what I want it to do.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •