- Plesk for Linux
PHP-based website is not accessible: empty page is returned on access
Similar errors can be found in the
CONFIG_TEXT: PHP Fatal error: Call to undefined function virtual() in /var/www/vhosts/example.com/httpdocs/index.php on line 6\n'
virtual()is used in the script on the line mentioned in error:
# cat /var/www/vhosts/example.com/httpdocs/index.php | sed '6!d'
PHP handler processing mode is set to CGI, FastCGI, or FPM in Domains > example.com > PHP Settings
virtual() function is supported only by Apache mod_php, as it performs an Apache sub-request: PHP Manual Function Reference: virtual()
Modify the PHP code, so it would work correctly in the CGI/FastCGI/FPM execution mode. For example, change
virtual()function invocations to
readline()if static content is loaded by it: PHP Manual Function Reference: readline()
Change execution mode to the mod_php served by Apache in Domains > example.com > PHP Settings
Warning: Running PHP under
mod_phpis insecure and might cause a security breach. Consider using CGI, FastCGI, or FPM instead.