Invalid command 'php_admin_flag', perhaps misspelled or defined by a module not inclu

Discussion in 'HOWTO-Related Questions' started by Pasco, Jul 10, 2008.

  1. Pasco

    Pasco Member

  2. falko

    falko Super Moderator Howtoforge Staff

    Apache doesn't start because you already have PHP-enabled web sites, but you've disabled PHP. That's also the reason why ISPConfig doesn't rewrite the Vhosts_ispconfig.conf file anymore.

    I recommend to follow the tutorial to the end and ignore the failed Apache restarts during the tutorial.
     
  3. Pasco

    Pasco Member

    I've already tried that. The problem is, that I can't start apache2. So I tried to clear all the php_admin_flags in Vhosts_ispconfig.conf and restarted apache2. But the problem that Vhosts_ispconfig.conf still doesn't get rewrite with the appropriate suPHP commands (Engine on etc.) persists...strange, isn't it?

    I thought I could set / let ISPConfig set the php_admin_flags correspondending suPHP-commands, but it doesn't work...But it should, doesn't it?

    This is an Debian 3.1 Server which I upgraded to Etch.

    I tried the whole thing on another box, which was Debian Etch installed (without any web and so no php_admin_flags yet) and it all worked flawlessly...
     
    Last edited: Jul 11, 2008
  4. falko

    falko Super Moderator Howtoforge Staff

    I guess you have now some Vhosts_ispconfig.conf files with a date in the filename in /etc/apache2/vhosts. Does any one of them contain the new suPHP directives? If so, rename it to Vhosts_ispconfig.conf and run
    Code:
    httpd -t
    Does it show syntax errors?
     
  5. Pasco

    Pasco Member

    Yes, there a some of these Vhosts_ispconfig.conf files...but none of them contains any suPHP directives, only suExec. Does suExec conflict with suPHP? I've previously installed suExec.

    I also tried to redo all the suPHP Tutorial, several times. With php_admin_flags and without. It seems, the suPHP directives just don't get into Vhosts_ispconfig.conf, even though Vhosts_ispconfig.conf gets now rewrite. :confused:
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    You can not use php_admin_flags with suphp. php_admin_flags is only for mod_php.

    If you want to use suphp with ISPConfig, you must switch to suphp in the file config.inc.php, then change a setting in one of your sites so that ispconfig updates the Vhost_ispconfig.conf file. ISPConfig will remove all php_admin_flags that were added by ISPConfig, but if you added php_admin_flags manuually in the apache directievs field or a .htaccess file, you will have to remove them first.
     
  7. Pasco

    Pasco Member

    Thanks till! Works perfectly! VHost_ispconfig.conf gets now rewrite with the suphp directives and works! :D (at my other server, config.inc.php got rewrite with the value "suphp" automatically? Why had I to switch manually? Does it depend on the distro?)

    I still got two questions left:

    1. If I got it right, I have to switch the php-Version with editing VHost_ispconfig.conf manually, right? So far ok. But if I (or a reseller/client) do 1 change in my/their ISPConfig Panel, the whole file VHost_ispconfig.conf gets rewrite, so it overwrites my manually edited change to the other php-version (in my case php5, because standart is php4 on my Debian System).
    Can I prevent automatic overwriting somehow? Perhaps I have to place my manually added apache directive on a special place in the VHost_ispconfig.conf? So that only this directives got read from apache2 and it won't get overwritten?

    2. Can I still use the "apache directives" field in ISPConfig Panel for adding my php_admin_flags and php_admin_values? Or how can I set these values with suphp? I tried adding it manually with "setEnv php_admin_flags" but I got errors, actually..

    Thanks so much.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    1) Thats not correct. The Vhsot_ispconfig.conf has never to be edited and can not be edited. If you want t change the php version, install php5 as cgo and edit the suphp configuration in /etc/

    2) No, php_admin_flag and php_admin_values are not supported by suphp, they are mod_php specific.
     
  9. Pasco

    Pasco Member

    I just noticed that if I switch to php5 there are no modules installed like gd or mysql. So I get following errors if I want to access a site:

    Database Error: Unable to connect to the database:The MySQL adapter "mysql" is not available.

    Do I have to install and enable all modules for php5? How do I do that?
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes.

    Install them with the package management tool of the linux distribution.
     
  11. Pasco

    Pasco Member

    1) But in the mentioned how to (How To Set Up suPHP with PH4 and PHP5) on the third an last page it says:

    2) Does this mean, that I can't set any of these variables for php with a suPHP-Installation? Or are just the directives a different syntax?


    3)
    So it's apt-get install xy for Debian Etch I guess. Thanks.
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

  13. Pasco

    Pasco Member

    Ups...:eek: Thanks till! Now I got it... :)


    Great! That sounds pretty cool, exactly what I was looking for! 2 in 1 : )
     
  14. Pasco

    Pasco Member


    Still have one question left: I want to be able to switch between PHP4 and PHP5 for each single vhost. So how can I achieve this if not editing VHost_ispconfig.conf? I have configured PHP4 and PHP5 in /etc/suphp.conf like that:

     
  15. falko

    falko Super Moderator Howtoforge Staff

    You can use the Apache Directives field in ISPConfig to insert custom directives.
     
  16. Pasco

    Pasco Member

    I've installed php4 as CGI, php5 as CGI and suPHP. What kind of apache directives let me switch to php5 (as php4 is standart)?

    I don't get it. If I put a apache directive in the ISPConfig Panel, it will be placed on top of the web's virtual host.

    So if I'd like to switch to php5 for a certain web, I would place following apache directive:

    Code:
     AddHandler x-httpd-php5 .php .php3 .php4 .php5
    suPHP_AddHandler x-httpd-php5
    ?

    But further down there will still be following in the Vhost_ispconfig.conf File:

    Code:
    <VirtualHost 192.168.1.100:80>
    suPHP_ConfigPath /var/www/suphp_conf/test.com
    AddHandler x-httpd-php5 .php .php3 .php4 .php5
    suPHP_AddHandler x-httpd-php5
    SuexecUserGroup testuser testgroup
    ServerName www.test.com:80
    ServerAdmin [email protected]
    DocumentRoot /var/www/web6/web
    
    AddType application/x-httpd-php .php .php3 .php4 .php5
    <Directory /var/www/web6/web>
      suPHP_Engine on
      suPHP_UserGroup test.com web6
      [B]AddHandler x-httpd-php .php .php3 .php4 .php5
      suPHP_AddHandler x-httpd-php[/B]
      SetEnv php_safe_mode On
    </Directory>
    
    So it's still php4 on that vhost? :confused:

    I'm sorry, but I can't see how to override this automatically setting in VHost_ispconfig.conf File...

    Can you help me one more please? Thanks so much.
     
  17. falko

    falko Super Moderator Howtoforge Staff

    You should disable suPHP in ISPConfig so that the second set of PHP directives uses mod_php instead of suPHP.
     
  18. Pasco

    Pasco Member

    You mean disable suPHP globally on ISPConfig? And then insert the mentioned directives?
     
  19. falko

    falko Super Moderator Howtoforge Staff

    Yes, that's right.
     

Share This Page