Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 10th July 2008, 16:22
Pasco Pasco is offline
Member
 
Join Date: Aug 2005
Location: Switzerland
Posts: 94
Thanks: 11
Thanked 0 Times in 0 Posts
Default Invalid command 'php_admin_flag', perhaps misspelled or defined by a module not inclu

I followed the following Tutorial to enable a "switch" on my ISPConfig for PHP4 and PHP5: [URL="http://www.howtoforge.com/apache2_suphp_php4_php5"].

On the first site it says:

Quote:
2 Disable the Apache PHP Module

If you already had Apache2 installed with PHP4 as a module, you must disable that module now because suPHP uses the CGI version of PHP to work (if you don't know if you have PHP4 installed as module, you can also run this command - it doesn't hurt):

a2dismod php4

Do the same for PHP5 if you have the PHP5 module installed (the official Debian Sarge repositories don't have PHP5 packages, however it's possible that you installed third-party PHP5 packages like those from http://www.dotdeb.org):

a2dismod php5

Then restart Apache:

/etc/init.d/apache2 restart
As soon as I want to restart apache2 it says:
Quote:
Invalid command 'php_admin_flag', perhaps misspelled or defined by a module not included in the server configuration
I earased all php_admin commands in the vhost-file and started again. Apache can be started now of course, but my websites don't work anymore... I guess I get this error because of the disabled php4 module?

But how can I work around?

Another thing is, that I followed the tutorial altough, at the end the ISPConfig-vhost-file isn't rewrite automatically anymore... :-( What did I wrong?
Reply With Quote
Sponsored Links
  #2  
Old 11th July 2008, 13:41
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

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.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 11th July 2008, 18:31
Pasco Pasco is offline
Member
 
Join Date: Aug 2005
Location: Switzerland
Posts: 94
Thanks: 11
Thanked 0 Times in 0 Posts
Default

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 by Pasco; 11th July 2008 at 18:35.
Reply With Quote
  #4  
Old 12th July 2008, 12:14
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

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?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 13th July 2008, 12:16
Pasco Pasco is offline
Member
 
Join Date: Aug 2005
Location: Switzerland
Posts: 94
Thanks: 11
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #6  
Old 13th July 2008, 12:30
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 35,777
Thanks: 821
Thanked 5,332 Times in 4,184 Posts
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 13th July 2008, 15:08
Pasco Pasco is offline
Member
 
Join Date: Aug 2005
Location: Switzerland
Posts: 94
Thanks: 11
Thanked 0 Times in 0 Posts
Default

Thanks till! Works perfectly! VHost_ispconfig.conf gets now rewrite with the suphp directives and works! (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.
Reply With Quote
  #8  
Old 13th July 2008, 15:41
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 35,777
Thanks: 821
Thanked 5,332 Times in 4,184 Posts
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #9  
Old 13th July 2008, 15:43
Pasco Pasco is offline
Member
 
Join Date: Aug 2005
Location: Switzerland
Posts: 94
Thanks: 11
Thanked 0 Times in 0 Posts
Default

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?
Reply With Quote
  #10  
Old 13th July 2008, 16:01
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 35,777
Thanks: 821
Thanked 5,332 Times in 4,184 Posts
 
Default

Quote:
Do I have to install and enable all modules for php5?
Yes.

Quote:
How do I do that?
Install them with the package management tool of the linux distribution.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Proftpd + MySQL virtual users, can't connect geekman HOWTO-Related Questions 28 27th September 2010 18:03
ffmpeg Video support for ubuntu 7.10 [suphp-ispconfig] amaurib Installation/Configuration 13 16th February 2010 17:26
proFTPd passive mode problems bisbell Server Operation 8 6th August 2008 21:12
ispconfig and mambo shajazzi Installation/Configuration 70 28th March 2006 19:29
Webmin docs missing namit Server Operation 11 5th January 2006 09:51


All times are GMT +2. The time now is 14:49.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.