DirectAdmin Knowledge Base and Support

DirectAdmin is a web panel for a simple administration of both virtual and dedicated servers. DirectAdmin is faster, safe and more powerful than any other CP. And we know how to customize and support it.

CustomBuild: Backslash found where operator expected

| 14:15:43 01.11.2019

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.

About Us
We are a team of professionals, and specialize in installation, configuring and managing of remote virtual and dedicated servers powered by Linux/Unix-like OS with DirectAdmin. We support various sets of software, including web-servers Apache, Nginx; internet domain name servers Bind, PowerDNS; mail-servers with POP3, IMAP and SMTP, FTP-servers, etc. After years of working through the most complex server challenges our team has gathered valuable experience and universal solutions suitable for everyday tasks. We are here to lend you a helping hand and take care of your servers in order to let you have enough time to do more of what you love.




All of the information and data on this site is for informational purposes only and is provided for the convenience of the user.
Powered by: Amiro.CMS - Free edition