PHP handling

Discussion in 'Developers' Forum' started by oliver.blaha, Apr 25, 2006.

  1. oliver.blaha

    oliver.blaha ISPConfig Developer

    Hi,

    I'm not completely happy about how PHP is enabled/disabled in Vhosts.
    IMHO completely disabling PHP for the whole server and only activating it in the vhost statements isn't the best practice.

    I've enhanced the apache2_php parameters in config.inc.php with "engine". If you specify this option, an "php_admin_flag on" or "php_admin_flag off" is included in the vhost. This way it is possible to let PHP be activated for the server, without enabling it for every vhost.

    From now on you can either use the old format:

    Code:
    $go_info["server"]["apache2_php"] = 'both';
    Or you can pass an array of valid options:

    Code:
    $go_info["server"]["apache2_php"] = array("filter", "engine");
    It should be completely backward compatible.

    If you like this way of handling PHP, I'd suggest to:

    1) Change the default value to:
    Code:
    $go_info["server"]["apache2_php"] = array("filter", "addtype", "engine");
    2) Remove the commenting of the php AddType clauses in httpd.conf.

    This would decrease the amount of configuration when setting up a new server, as you can leave the mime types and the php AddTypes untouched.
     
  2. till

    till Super Moderator

    Hi Oliver,

    looks fine and sounds reasonable.

    I'am not sure which notation we shall use in the config.inc.php file, as this file will be edited by poeple not familar with PHP and the PHP array syntax.

    Option 1) as you suggested:

    Or option 2)

    What do you think?
     
  3. oliver.blaha

    oliver.blaha ISPConfig Developer

    Hm, I suggest we simply support both *g*

    Currently I'm checking if it is an array, and if it's not, I assign it as the only element of a new array.

    If we simply replace this assignment by an explode(",", ...) we'd magically support single options, strings with comma seperated options AND arrays.
     
  4. oliver.blaha

    oliver.blaha ISPConfig Developer

    Update: As it was a quite trivial change, I simply checked it in with explode. Hope you like it. I changed this for the MySQL priviledges which are changed by the MySQL Quota script, too.
     
  5. till

    till Super Moderator

    Fine, thanks. It might be easier for the users if they might use comma separated values :)
     

Share This Page