php禁用一些危險函數

打開php.ini文件,
查找到 disable_functions ,修改爲:
disable_functions=pathinfo,eval,passthru,exec,assert,system,chroot,chgrp,chown,shell_exec,proc_open,ini_restore,dl,readlink,symlink,popen,stream_socket_server,pfsockopen,putenv
如果eval禁用不了,藉助:php Suhosin。

禁用的方法可以根據自己的環境來,其實curl_exec(),fopen(),file_get_contents()等都是很危險的,還有一些目錄瀏覽的方法,酌情考慮

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章