Useful Snippets

Welcome!


This blog is used to collect useful snippets related to Linux, PHP, MySQL and more. Feel free to post comments with improvements or questions!

Are your smart devices spying on you? Make better purchasing choices and find products that respect your privacy at Unwanted.cloud

RSS Latest posts from my personal blog


Subscribe to RSS feed


disable_functions in PHP for added security

Stanislav KhromovStanislav Khromov

Setting up open_basedir is good security practice, but a user can still read files from other directories by invoking exec or other commands that run on the operating system level. We can fix this by disabling a select few commands in your php.ini file.

Open /etc/php.ini (or similar), look for disable_functions and add:

disable_functions=popen,exec,system,passthru,proc_open,shell_exec

Source

PHP

Full-stack impostor syndrome sufferer & Software Engineer at Schibsted Media Group

Comments 1
  • Richard Benn
    Posted on

    Richard Benn Richard Benn

    Reply Author

    Thanks for the snippet! We are trying our best to secure our server as much as we can and will make use of this ASAP.