Cobra Forum

Plesk Panel => Webserver => Topic started by: Suhitha on Dec 01, 2025, 04:26 AM

Title: Website hosted in Plesk is unavailable: Invalid command 'php_flag' or 'php_value
Post by: Suhitha on Dec 01, 2025, 04:26 AM
Question: Website hosted in Plesk is unavailable: Invalid command 'php_flag' or 'php_value'


Applicable to:



Symptoms


500 internal server error
503 Invalid command 'php_flag', perhaps misspelled or defined by a module not included in the server configuration.

Unable to generate the web server configuration file on the host example.com because of the following errors:
Template_Exception: AH00526: Syntax error on line 2 of /var/www/vhosts/system/example.com/conf/vhost.conf:
Invalid command 'php_flag', perhaps misspelled or defined by a module not included in the server configuration


Cause

Site code contains unsupported directives: PHP directives php_flag and php_value  that are not supported in modern PHP versions. They were supported in PHP as Apache module only (mod_php Apache module) that is now deprecated as it is considered outdated and insecure.

(https://youtu.be/StGI6c592Rc)

https://youtu.be/StGI6c592Rc (https://youtu.be/StGI6c592Rc)

1.Login to Plesk

2.Go to Domains > example.com > File Manager and open .htaccess file for editing.

Note: .htaccess file may be located in domain subdirectories.

3.Comment out php_flag and php_value lines (put sign # at the beginning of the line) or remove completely:

(https://pix.cobrasoft.org/images/2025/12/01/Screenshot-2017-10-23_Code_Editor_example_com_httpdocs_htaccess_-_Plesk_Onyx_17_5_3.png)


4.Click OK to apply the changes.

5.Open Domain > example.com > PHP Settings and add directives from step #3 in predefined parameters (like, post_max_size) or in the Additional configuration directives field. Example of an additional directives:

display_startup_error on
max_input_vars = 2000
html_errors on
allow_call_time_pass_reference 1
magic_quotes_gpc on

(https://pix.cobrasoft.org/images/2025/12/01/mceclip0-12.png)