Fixing an error which one might face with CustomBuild 2, when running secure_php: Backslash found where operator expected at -e line 1, near "s##disable_functions = show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open,ini_set#disable_functions \"
If you run ./build secure_php and see all those lines like these ones:
./build secure_php Backslash found where operator expected at -e line 1, near "s##disable_functions = show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open, ini_set#disable_functions \" Regexp modifiers "/d" and "/a" are mutually exclusive at -e line 1, at end of line Unknown regexp modifier "/b" at -e line 1, at end of line Regexp modifiers "/d" and "/l" are mutually exclusive at -e line 1, at end of line Unknown regexp modifier "/_" at -e line 1, at end of line Unknown regexp modifier "/f" at -e line 1, at end of line Regexp modifiers "/d" and "/u" are mutually exclusive at -e line 1, at end of line Unknown regexp modifier "/n" at -e line 1, at end of line Unknown regexp modifier "/t" at -e line 1, at end of line Unknown regexp modifier "/n" at -e line 1, at end of line syntax error at -e line 1, near "s##disable_functions = show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open, ini_set#disable_functions \" -e has too many errors. PHP has been secured. Restarting php-fpm71.
Here is a possible solution:
perl -pi -e 's/#disable_functions/disable_functions/' /usr/local/php*/lib/php.ini
And then try ./build secure_php once again.
Here is an example:
root@shared:~# perl -pi -e 's/#disable_functions/disable_functions/' /usr/local/php*/lib/php.ini root@shared:~# bash /usr/local/directadmin/custombuild/build secure_php PHP has been secured. Restarting php-fpm71. root@shared:~#
That's it.