Mỗi người đều là chuyên gia trong lịnh vực bạn đam mê ! Đăng ký và cùng chia sẻ kiến thức nào
40,789 views
0 votes
0 votes

 Khi thực thi đoạn mã PHP có hàm ini_set thì bị báo lỗi

ini_set() has been disabled for security reasons

Vậy có cách nào để khắc phục lỗi không? Hay phải chuyển nhà cung cấp hosting khác, sửa code?
User Avatar
by Editor
3.1k points

Please log in or register to answer this question.

1 Answer

0 votes
0 votes

 Dùng Shared Hosting hoặc gói Free Hosting không khỏi gặp một số hạn chế. Xuất phát từ góc độ bảo mật, an toàn dữ liệu gây thiệt hại cho người dùng và cả nhà cung cấp hosting, thì một số hàm được mặc định là khóa:

phpinfo,exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source,allow_url_fopen,allow_url_include,ini_set

 Việc khóa các hàm thực thi này áp dụng cho toàn bộ các người dùng amateur . Để dùng được cho riêng từng tài khoản. Bạn chỉ việc tạo 1 file php.ini với nội dung là bật các function kia lên

Ví dụ

ini_set = on

Sau đó upload lên thư mục root của bạn ( chính là public_html hoặc htdocs )

Have fun :)

User Avatar
by Editor
5.6k points

Sponsors


Vietbeauty Community
Netdepviet Wiki là nơi hỏi-đáp, chia sẻ kiến thức và mọi mặt cuộc sống.
Xem thêm trợ giúp. Hiện tại chỉ mở Wiki cho người dùng có tài khoản Facebook và Gmail đăng nhập

131 questions

119 answers

4 comments

68 users

ADVERTISEMENT

Related questions

1 answer
0 votes
0 votes
1.3k views
2 answers
1 vote
1 vote
4.8k views
2 answers
0 votes
0 votes
11.2k views
0 answers
0 votes
0 votes
469 views
1 answer
1 vote
1 vote
20.7k views
Since © 2006 Netdepviet.org All rights reserved. Home | Privacy Policy | Pictures