PHP or Apache problem.

Discussion in 'Installation/Configuration' started by tal56, Dec 11, 2007.

  1. tal56

    tal56 Member

    Hi guys,

    I'm using ISPconfig 2.1.18 on Centos 5, followed the perfect install and everything is working great except for Apache and/or PHP.

    When I have a link like this for example :

    www.mydomain.com/index.php?name=chris&do=read

    My apache does not seem to read the stuff after the "?"

    So as you can see, I'm trying to install forums and stuff and nothing is working. Anything I click on, it just goes to the default "index.php" file.

    Is there a module I missed or something not set correctly? Thanks
     
  2. tal56

    tal56 Member

    Ok, I fixed this by adding this :

    php_admin_flag register_globals on
    php_admin_flag register_long_arrays on

    To the Apache Directives on ISPconfig. Hopefully this is the correct way to fix this? From reading on google it seems that Register_Global is turned off by default, so if I want all sites to have it on, I need to turn this on globally, which from what I can read is bad for security.

    Can anyone confirm if what I did on a per site basis is the best way to add this functionality to each site? Or should I be editing the .htaccess instead? Thanks
     
  3. Leszek

    Leszek New Member

    It all depends on how You write the script.
    Remember that setting register_globals in most cases is dangerous.
    Consider rewriting Your scripts for security reasons.
     
  4. tal56

    tal56 Member

    Well this is not a script I wrote, it's just a forum program. I don't see how you can get around it because most forums pass data through links such as :

    www.mydomain.com/index.php?data1=no&do=viewpage

    If register globals is turned off and that information after the "?" is not passed then the programs wont work. Or how can you even link to a specific page within the script?
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    All properly written script import these variables with $_GET["varname"] and do not depend on register globals on.
     
  6. tal56

    tal56 Member

    I know that already, however how do you pass a parameter through a link if register globals are turned off?

    Like even for this forum "vbullitin" you still have the data ?do=newreply&noquote=1 etc.

    So for this site that this forum is hosted, register_globals is turned on? If not how else can you make it work? Because when I turn it off, none of the data after the "?" is interpreted. Thanks
     
  7. tal56

    tal56 Member

    Well after doing a lot more reading, looks like I need to do some changes to my php scripts in order to make it work with php5. I think I understand what needs to be done to make it work with the information using $_request or $_get. Thanks for your help guys.
     
  8. falko

    falko Super Moderator ISPConfig Developer

    Make sure you use $_REQUEST and $_GET (in capital letters!).
     
  9. tal56

    tal56 Member

    Sounds good Falko. Thanks again !

    Chris
     

Share This Page