• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Unrecognized option: 'nginx-serve-php'

Matt M

New Pleskian
Server operating system version
CentOS Linux 7.9.2009 (Core)
Plesk version and microupdate number
Plesk Obsidian Version 18.0.43 Update #1
I'm trying to change the PHP handler for a domain from CLI. I'm using the command:

Code:
plesk bin site -u example.com -php_handler_id plesk-php74-fastcgi

I get the result:

Code:
PHP scripts cannot be processed by nginx if the Plesk CGI or FastCGI handler is selected. Either omit the "-nginx-serve-php" option, or select the PHP-FPM handler.

exit status 1

I tried:

Code:
plesk bin site -u example.com -php_handler_id plesk-php74-fastcgi -nginx-serve-php false

which results in:

Code:
Unrecognized option: 'nginx-serve-php'


exit status 1

At this my point my google fu ran into a wall. It seems like I'm probably missing something obvious.

Any thoughts?
 
I don't know if this is a bug or not but if the subscription is using the FPM application served by nginx handler, I get the same warning:

Code:
PHP scripts cannot be processed by nginx if the Plesk CGI or FastCGI handler is selected. Either omit the "-nginx-serve-php" option, or select the PHP-FPM handler.
exit status 1

It still won't work if you do this:
Code:
# plesk bin site -u domain.com -php_handler_id plesk-php74-fpm
# plesk bin site -u domain.com -php_handler_id plesk-php74-fastcgi

PHP scripts cannot be processed by nginx if the Plesk CGI or FastCGI handler is selected. Either omit the "-nginx-serve-php" option, or select the PHP-FPM handler.
 
In the end, I resolved this in the following way:

Code:
plesk bin service_plan -u "Plan Name" -php_handler_id plesk-php74-fastcgi -php_served_by_nginx false
plesk bin subscription --unlock-subscription domain.com
plesk bin subscription --sync-subscription domain.com

I should note that using the Plesk control panel, the subscription and domain did NOT have the Fastcgi option at all under PHP settings. Only the service plan did. This is what led me to this approach.
 
The root cause is that some domains have the nginx-proxy-mode option not set to true. Non-proxy mode of nginx effectively means that the nginx-serve-php option is always true preventing any non-FPM PHP handlers from being set.

To fix this issue please contact Plesk Support Team.
 
Back
Top