ItSolutionStuff.com

How to Create Custom php.ini File in CPanel?

By Hardik Savani • May 14, 2024
PHP

We can create our own php.ini file in godaddy cpanel and other hosting too. We can increase upload_max_filesize, post_max_size, max_file_uploads, memory_limit, max_execution_time etc in php ini file in cpanel.

So basically, Almost server like godaddy server, a2hosting server, hosting raja server that provide basic configuration in default php ini file. so some time we need to increase it with maximum upload file size, memory limit etc. every server have different way to creating custom php ini file creation. i will give two example that will help you.

In this post, i will show you how it easy to create custom php.ini file with change default value of php ini file.

I checked on my GoDaddy Project.

I created .user.ini file with following changes. You need 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

memory_limit = 148M

max_input_vars = 4000

upload_max_filesize = 120M

post_max_size = 120M

max_execution_time = 250

If above solution not work then you can also try this one:

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(); ?>

I hope it can help you...

Tags: PHP
Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

How to Install PHP XML Extension in Ubuntu?

Read Now →

How to Install PHP imap Extension in Ubuntu?

Read Now →

PHP Generate QR Code using Google Chart API Example

Read Now →

How to Import Database in Mysql using Command Line in Ubuntu?

Read Now →

PHP Curl POST Request with Headers Example

Read Now →

How to Upgrade PHP Version from 7.2 to 7.3 in Ubuntu?

Read Now →

PHP - How to Reindex Array Key After Unset Key?

Read Now →

PHP JQuery Ajax Post Request Example

Read Now →

PHP Dropzone Display Existing Files from Server Example

Read Now →

How to Send Mail using Zoho SMTP Server in Laravel?

Read Now →

How to Install Laravel on Windows Xampp Server?

Read Now →

File Upload with Progress Bar using jQuery Ajax and PHP Example

Read Now →

How to Remove Specific Element by Value from Array in PHP?

Read Now →

How to Resolve Laravel Blank Page on Server?

Read Now →