Cấu hình tăng bộ nhớ upload file bằng php.ini, .htaccess stephencunnington.com (ok)

Ví dụ 1: Dùng file php.ini

C:\Users\Administrator\AppData\Local\Temp\scp04238\public_html\php.ini

; cPanel-generated php ini directives, do not edit
; Manual editing of this file may result in unexpected behavior.
; To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
; For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)

allow_url_fopen = On
display_errors = Off
enable_dl = Off
file_uploads = On
max_execution_time = 30
max_input_time = 60
max_input_vars = 1000
memory_limit = 256M
post_max_size = 1516M
session.gc_maxlifetime = 1440
session.save_path = "/var/cpanel/php/sessions/ea-php74"
upload_max_filesize = 1512M
zlib.output_compression = Off

C:\Users\Administrator\AppData\Local\Temp\scp07462\public_html\.user.ini

; cPanel-generated php ini directives, do not edit
; Manual editing of this file may result in unexpected behavior.
; To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
; For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)

display_errors = Off
max_execution_time = 30
max_input_time = 60
max_input_vars = 1000
memory_limit = 256M
post_max_size = 1516M
session.gc_maxlifetime = 1440
session.save_path = "/var/cpanel/php/sessions/ea-php74"
upload_max_filesize = 1512M
zlib.output_compression = Off

Ví dụ 2: Dùng file .htaccess làm trên khamphukhoa.net.vn

Mở file .htaccess bằng text editor hoặc code editor, sau đó thêm mã sau:

php_value upload_max_filesize 32M
php_value post_max_size 64M
php_value memory_limit 128M
php_value max_execution_time 300
php_value max_input_time 300

Last updated