This article introduces some techniques to defend against PHP Trojan attacks. Through these techniques, you can better prevent Trojans.
1. Avoid jumping out of the web directory and first modify httpd. conf. If you only allow Your php script program to operate in the web directory, you can also modify the httpd. conf file to limit the php operation path. For example, if your web directory is/usr/local/apache/htdocs. add the following lines to the conf file: php_admin_value open_basedir/usr/local/apache/htdocs. If the script needs to read files other than/usr/local/apache/htdocs, if the error is displayed, the following error occurs: Warning: open_basedir restriction in effect. file is in wrong directory in/usr/local/apache/htdocs/open. php on line 4 and so on.
2. Prevent php trojans from executing webshell to open safe_mode. In, set disable_functions = passthru, exec, shell_exec in php. ini. Select either of them or both.