Cara menggunakan php max_input_vars not updating

Btw, pernah suatu saat setelah website terasa lambat diakses padahal pengunjung tidak terlalu banyak, apalagi website tersebut berbasis wordpress atau website berbasis framework seperti laravel, CI, YII, dll.

Karena lambat biasanya pemilik website akan melakukan upgrade hosting atau server, misalnya dari paket A ke paket B, kalau di VPS dari ram 1 GB menjadi 2 atau bahkan 4 GB.

Setelah upgrade ternyata performa website tidak ada peningkatan, nah pasti banyak yang pusing dengan kasus seperti ini.

Ternyata ada beberapa hal yang dapat dilakukan agar performa website meningkat, yaitu konfigurasi server perlu dirubah, upgrade software [PHP, MySQL, Webserver], optimasi script, optimasi database, dan lain-lain.

Kali ini kita akan membahas cara pertama yaitu konfigurasi server, khususnya di PHP.INI.

Berikut ini adalah parameter yang perlu diubah di php.ini

  • max_execution_time
    Adalah nilai maksimum script berjalan, defaultnya 30 detik, coba diisi saja 60
  • max_file_uploads
    Adalah jumlah maksimum file diupload, defaultnya 20, isi saja 50 atau lebih
  • max_input_time
    Adalah waktu maksimum script dalam mengurai data [Post, get], defaultnya 60 detik, boleh diisi lebih.
  • max_input_vars
    Adalah jumlah maksimum variabel input yang bisa ditangani [post, get, cookie, dll], defaultnya 1000, tambah jadi 3000 atau lebih.
  • memory_limit
    Adalah jumlah maksimum dalam mengalokasikan memory saat memproses script, defaultnya 128M, kalau script banyak dan proses panjang lebih baik ditambahkan.
  • post_max_size
    Adalah ukuran maksimal yang diizinkan saat post data, default 8M, tambah jadi 50MB agar aman saat restore db via web.
  • upload_max_filesize
    Adalah ukuran maksimum tiap file yang diupload, default 2M, tambahkan jadi 10M atau lebih karena foto saat ini ukurannya besar-besar.

Baca Juga:   Membuat CRUD dengan PHP MySQL HTML CSS JS [part 7]

Berikut contoh isian setting php.ini
post_max_size = 16M
max_execution_time = 180
max_input_time = 180
max_input_vars = 3000
memory_limit = 256M
upload_max_filesize = 128M
max_file_uploads = 50
session.gc_maxlifetime = 18000 atau 5 jam max 65535 atau 18 jam [lbh dari ini fatal].
session.cache_expire = 300 atau 5 jam

 

Jangan lupa disimpan kemudian restart web servernya [apache, nginx, litespeed, dll]. Cek phpinfo untuk melihat hasilnya.

Did you read a tutorial that asks you to edit your wp-config file, and you have no idea what it is? Well we’ve got you covered. In this article, we will show you how to properly edit the wp-config.php file in WordPress.

What is wp-config.php File?

As the name suggests, it is a configuration file that is part of all self-hosted WordPress sites.

Unlike other files, wp-config.php file does not come built-in with WordPress rather it’s generated specifically for your site during the installation process.

WordPress stores your database information in the wp-config.php file. Without this information your WordPress website will not work, and you will get the ‘error establishing database connection‘ error.

Apart from database information, wp-config.php file also contains several other high-level settings. We will explain them later in this article.

Since this file contains a lot of sensitive information, it is recommended that you don’t mess with this file unless you have absolutely no other choice.

But since you’re reading this article, it means that you have to edit wp-config.php file. Below are the steps to do it without messing things up.

Video Tutorial

Subscribe to WPBeginner

If you don’t like the video or need more instructions, then continue reading.

Getting Started

First thing you need to do is to create a complete WordPress backup. The wp-config.php file is so crucial to a WordPress site that a tiny mistake will make your site inaccessible.

You will need an FTP client to connect to your website. Windows users can install WinSCP or SmartFTP and Mac users can try Transmit or CyberDuck. An FTP client allows you to transfer files between a server and your computer.

Connect to your website using the FTP client. You will need FTP login information which you can get from your web host. If you don’t know your FTP login information, then you can ask your web host for support.

The wp-config.php file is usually located in the root folder of your website with other folders like /wp-content/.

Simply right click on the file and then select download from the menu. Your FTP client will now download wp-config.php file to your computer. You can open and edit it using a plain text editor program like Notepad or Text Edit.

Understanding wp-config.php file

Before you start, let’s take a look at the full code of the default wp-config.php file. You can also see a sample of this file here.

Bài mới nhất

Chủ Đề