• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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