Khắc phục lỗi touch() [function.touch] và unlink() [function.unlink] với wordpress kh

  • Thread starter Thread starter AdminAdmin is verified member.
  • Start date Start date
Admin

AdminAdmin is verified member.

Well-Known Member
Staff member
Administrator
Nếu bạn gặp lỗi này:
Warning: touch() [function.touch]: SAFE MODE Restriction in effect. The script whose uid is *** is not allowed to access /tmp owned by uid 0 in /full_path_to_wordpress/wp-admin/includes/file.php on line 198
Hoặc
Warning: unlink() [function.unlink]: SAFE MODE Restriction in effect. The script whose uid is *** is not allowed to access /tmp owned by uid 0 in /home/powernet/domains/powernet.vn/public_html/home/wp-admin/includes/file.php on line 489
Có nghĩa rằng server đang bật chế độ safe mode On.
Cách khắc phục như sau:
Tạo một thư mục con trong thư mục public_html với tên tùy chọn ( ở đây là mình đặt tên thư mục là tmp). Sau đó CHMOD 777
Sau đó bạn sửa file wp-config.php, thêm vào dưới dòng này
require_once(ABSPATH . 'wp-settings.php');
dòng giá trị sau:
define('WP_TEMP_DIR', ABSPATH . 'tmp');
Save và sử dụng bình thường.
Lưu ý: Việc Chmod 777 có thể gây nguy cơ cao về bảo mật, nếu không thực sự cần thiết nên chmod về 755. Ngoài ra nên Chmod thư mục public_html thành 711
 

Facebook Comments

Similar threads

cuongpro9x
Replies
0
Views
2K
cuongpro9xcuongpro9x is verified member.
cuongpro9x
Admin
Replies
0
Views
3K
AdminAdmin is verified member.
Admin
Admin
Replies
0
Views
2K
AdminAdmin is verified member.
Admin
Admin
Replies
0
Views
2K
AdminAdmin is verified member.
Admin
Admin
Replies
1
Views
2K
vuotquaraocan.hp
V
Back
Top