How to Create Custom php.ini File on CPanel Server?

Laravel 6 , PHP , Laravel , Laravel 7

Nicesnippets

137

15-06-2020


Hi Guys,

In this post, I will teach how to create custom php.ini file in cpanel.We will create php.ini file in cpanel.

We have to create own php.ini file in godaddy cpanel and other hosting. We will increase upload_max_filesize, post_max_size, max_file_uploads, memory_limit, max_execution_time etc in php ini file in cpanel.

It easy to create custom php.ini file with change default value of php ini file.

I will give two example for php and one example for laravel project. So Let's see the bellow example.

I chacked in my Godaddy project.

I created .custom.ini file with bellow changes. You have to put on your root directory so it effect only that project.

Path: public_html/mypro.com/index.php

Create File Path: public_html/mypro.com/.user.ini

Solution 1

memory_limit = 148M

max_input_vars = 4000

upload_max_filesize = 120M

post_max_size = 120M

max_execution_time = 250

Above solution not work then you can use bellow solution:

Solution 2

Create File Path: public_html/mypro.com/php.ini

memory_limit = 148M

max_input_vars = 4000

upload_max_filesize = 120M

post_max_size = 120M

max_execution_time = 250

Then last you can check with this:

<?php phpinfo(); ?>

Solution 3 : In Laravel Project

In this solution You can create php.ini file in this directory public_html/domain name/public with bellow changes.

Create File Path: public_html/domain_name/public/php.ini

memory_limit = 148M

max_input_vars = 4000

upload_max_filesize = 120M

post_max_size = 120M

max_execution_time = 250

It will help you...


Recommended Posts