Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We currently have a dedicated server with one company that is running apache, php, mysql etc. It currently has whm/cpanel installed. We are migrating to a new server with cpanel/whm. Everything migrated over fine but now one of my sites has some php_flag and php_value lines in the .htaccess file. When I go to the site on this new server I am getting 500 errors that read Invalid command 'php_flag', perhaps misspelled or defined by a module not included in the server configuration.

I am not sure what I need to do to get these to work so any help would be greatly appreciated.

share|improve this question

1 Answer 1

up vote 7 down vote accepted

Putting php_flag etc in .htaccess is only possible when you are using mod_php. With CGI/FCGI, Apache settings cannot be used to configure PHP since it is not running within Apache.

Using CGI, if you need a site with a custom php.ini, the exact details would depend on how exactly you're running the PHP (CGI, mod_fastcgi (with or without php-fpm), mod_fcgid). For basic CGI you will need to create an alternate Action for php files in that site that executes a wrapper script containing something like /usr/bin/php5-cgi -c /some/alternate/php.ini

share|improve this answer
    
Ahh Makes sense now. Thank you very much. –  mahle May 24 '11 at 18:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.