Problem Description
- You're using Plesk with Imunify360 hardened PHP
- You have selected a version of PHP earlier than 7.4, such as 5.4
- When trying to save your configuration in Plesk's PHP Settings, you get the following error, or one similar to it:
PHP: syntax error, unexpected $end, expecting TC_DOLLAR_CURLY or TC_QUOTED_STRING or '"' in Unknown on line 2
Problem Resolution
This is the result of an invalid configuration parameter for this version of PHP. In this instance, when using Websavers default configs, this is because the disable_functions value has functions in it that do not exist or do not apply to PHP 5.4. To fix it quickly, remove the entire disable_functions value. Or you can replace it with a PHP 5.4 compatible list that removes the pcntl_ functions as follows (this may work with other older versions of php):
opcache_get_status,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix_getppid,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,socket_accept,socket_bind,socket_clear_error,socket_close,socket_connect,socket_listen,socket_create_listen,socket_read,socket_create_pair,stream_socket_server,proc_open,proc_close,proc_nice,proc_terminate,dl,link,highlight_file,show_source,diskfreespace,disk_free_space,getmyuid,popen,escapeshellcmd,symlink,shell_exec,exec,system,passthru