Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2000
    Location
    Dundee, UK
    Posts
    1,366

    Suexec and enviromental variables.

    Hello,

    I enabled suexec on my servers last week. Ever since some of the enviromental variables used by php scripts and cgi scripts have stopped working. Have a look at http://66.54.138.67/mail.php

    Does any one know how to resolve this?

  2. #2
    Join Date
    Jan 2002
    Location
    Kuwait
    Posts
    679
    What ENV's are you missing?
    Ahmad Alhashemi
    PHP, Apache, C, Python, Perl, SQL
    18 related BrainBench certificates

  3. #3
    Join Date
    Nov 2000
    Location
    Dundee, UK
    Posts
    1,366
    Have a look at SCRIPT_URI, and HTTP_REFERER on the phpinfo page. They are not correcy.

  4. #4
    Join Date
    Mar 2002
    Location
    Servers
    Posts
    806
    _SERVER["HTTP_REFERER"] is correct. I think you should not worry about _ENV variables.
    × Dedicated Servers × cPanel Shared/Reseller Hosting
    × VPS × Backups × Cloud × Colocation × Managed Services
    × Webx Networks × Serving world wide since 1997

  5. #5
    Join Date
    Nov 2000
    Location
    Dundee, UK
    Posts
    1,366
    The problem is scripts use that, so i need to worry about it

  6. #6
    If you need other environment variables, you can add them into suexec & recompile.
    Dr. Colin Percival, FreeBSD Security Officer
    Online backups for the truly paranoid: http://www.tarsnap.com/

  7. #7
    Join Date
    Nov 2000
    Location
    Dundee, UK
    Posts
    1,366
    Ok, so the problem is they arent in suexec when i rebuilt apache?

  8. #8
    Somewhere around line 128 in suexec.c you'll find char *safe_env_lst[] defined; any environment variables not in that list will not be passed through to the cgi script.

    Add the necessary entries, recompile, reinstall.
    Dr. Colin Percival, FreeBSD Security Officer
    Online backups for the truly paranoid: http://www.tarsnap.com/

  9. #9
    Join Date
    Apr 2001
    Location
    Depok, Indonesia
    Posts
    988
    Originally posted by cperciva
    If you need other environment variables, you can add them into suexec & recompile.
    Correct me if I'm wrong, but PHP with Apache module doesn't have anything to do with suexec. So the problem must be related to something else. Besides SCRIPT_URI and HTTP_REFERER are already passed by suexec by default.

  10. #10
    Join Date
    Nov 2001
    Posts
    47
    I would say the same as priyadi:
    the php scripts shouldn't be affected.
    What is the problem/error you get, with the env.-vars?
    Is it limited to php and/or cgi?

Posting Permissions

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