[PHP] Sửa lỗi ini_set() has been disabled for security reasons
Nguyên nhân của lỗi này do server hosting disable hàm ini_set() để tránh local attack. Để khắc phục lỗi này, các bạn thực hiện theo các bước sau:
1) Tạo file php.ini trong thư mục public_html hoặc trong thư mục chứa các file script của bạn. Copy/paste đoạn code dưới đây vào file php.ini:
disable_functions = allow_url_fopen, escapeshellarg, escapeshellcmd, ini_alter, passthru, parse_ini_file, popen, proc_open, proc_close, proc_terminate, proc_get_status, proc_nice, readfile, show_source, system
Nếu đã có hàm disable_functions sẵn rồi thì bạn chỉ cần copy đè lên.
2) Mở file .htaccess trong thư mục public_html và dán đoạn code sau
suPHP_ConfigPath /home/username/public_html/
Với username là username Cpanel của bạn. Nếu chưa có file .htaccess thì bạn cần phải tạo ra trước.
Hi vọng bài viết này sẽ giúp ích cho các bạn. Thân ái!
Xin cam on rat nhiu
Đúng cái mình đang tìm. Cảm ơn bạn !
Mình làm như sau cũng OK :
Truy cập và edit : wp-includes > load.php thêm dấu @ trước $ini_all = ini_get_all(); Sau khi sửa sẽ như thế này :
if ( ! isset( $ini_all ) ) {
@$ini_all = ini_get_all();
}