• Solution. Support. Expertise
  • +43 664 635 1238
  • +1 647-947-4502
  • info@tdwebservices.com
How to Make Custom PHP Changes Using a .user.ini FileHow to Make Custom PHP Changes Using a .user.ini FileHow to Make Custom PHP Changes Using a .user.ini FileHow to Make Custom PHP Changes Using a .user.ini File
  • Hosting
    • Hosting
      • Business Hosting
      • Enterprise Hosting
      • TDWS VPS
      • Managed WordPress Hosting
      • Highly Optimized WordPress Hosting
      • Laravel Hosting
      • Odoo Hosting
      • Moodle Hosting
      • TDWS Reseller Plans
    • E-Commerce Solutions
      • Managed WooCommerce Hosting
      • Highly Optimized WooCommerce Hosting
      • Magento Hosting
      • PrestaShop Hosting
      • OpenCart Hosting
    • Dedicated Servers
      • Gaming Servers
    • TDWS Global Monitoring System
      • Server Monitoring
      • Network Monitoring
      • Application Monitoring
      • Database Monitoring
      • Cloud Monitoring
      • Container Monitoring
      • Storage Monitoring
  • Cloud
    • TDWS Cloud
      • TDWS Cloud Servers
      • TDWS CloudSites
      • TDWS Box Cloud
      • TDWS Virtual Private Cloud
      • TDWS Cloud Drive
    • TDWS Private Cloud
      • KVM Hypervisor Private Cloud
      • Xen Hypervisor Private Cloud
      • Microsoft Hyper-V Private Cloud
      • VMware ESXi Private Cloud
      • VMware Public Cloud Servers
    • Services
      • DB as a Service
      • Disaster Recovery as a Service
    • Other
      • TDWS Cloud Infrastructure
      • TDWS Hybrid Cloud
  • Insights
    • Small Business
    • Knowledge Base
    • Cloud Computing
    • Expert Opinion
    • Industry debates
    • Thought Leadership
  • About Us
    • Why Us
    • Data Centers
    • Affiliate
    • TDWS Channel Partners
    • Contact Us
    • TDWS Customer Reviews
    • TDWS Video
    • Legal
      • TD Web Services Acceptable Use Policy (“AUP”)
      • TDAG DMCA Notice Policy
      • TDAG Privacy Policy
      • Master Service Agreement
      • Service Level Agreement
Login
✕
Secrets on How Twitter Can Help You Increase Newsletter Signups
17 March 2015
How Entrepreneurs Can Gain a Fresh Business Perspective
17 March 2015

How to Make Custom PHP Changes Using a .user.ini File

Published by TDWS Technical Support on 17 March 2015
Categories
  • Knowledge Base
  • Q&A
Tags

Different software will require you to have custom php .ini file or have a customized PHP configuration which can differ from increasing the upload limit and even adjusting the memory limit. Fortunately, as much as you cannot be able to make these chances on a server wide basis, you can do the same locally from within your account. All you have to do is follow these easy steps and you will be ready to go in no time.

Please note: In order for the changes of the create user.ini file to reflect on all the sub folders within a given directory, a separate user.ini has to be created for each directory.Ideally, if the file created is within say the public_html folder, the changes will only impact the software that is installed in the targeted folder. Any other installations that are made to a subfolder herein like say public_html/blog are not affected.

On that note, here is a step by step guide on how you can be able to create your own user .ini.

  1. Begin with opening up the file manager in the control panel. This will differ but in most cases, this is the SiteAdmin or the cPanel. Make sure that the hidden files are visible and that you are in the public_html directory. This is indicated by the www.
  2. To create your new .user.ini file, head to the top of the page and click on New File. This allows you to access the tool that you will use in the creation process.
  3. Once you click on the New File icon, there will be a pop up. This will require you configure and name the new file. Add the text .user.ini in the New File Name box without forgetting the dot that appears before the word user in the filename.
  4. Just like that, you have created a file for .user.ini. Since that is now complete, you will be required to add the lines that you would like customized and edit the file. To highlight the file, locate it on the file list and click on it just once.
  5. After highlighting the desired file, click on the Edit link which you will find at the top of the page.
  6. By doing this, you will have opened the file editor which now allows you to input your custom configuration settings. Because the .user.ini file has just been created, do not be concerned to see it being empty. Take the line from the server-wide php.ini file that you intend to change as well as the new value.

In those simple and easy to follow steps you now have your own custom .user.ini file and the website will now be able to use the custom PHP configurations changes that you have added. Some of the most common lines that need altering from time to time when you are making your PHP changes include;

  • Magic_quotes_gpc
  • Max_input_time
  • Memory_limit
  • Register_globals
  • Max_execution_time
  • Post_max_size
  • Upload_max_filesize

Customizing the Memory Limit

Even though there is not a set limit, it is highly recommended that users stick to about 128M. This guide should walk you through the process of being able to increase your memory.

Once you have set up your .user.ini file, the next step is to open up the file using your preferred command line editor and therein input,

Memory_limit=128M

 
The changes should take place instantaneously without restarting the web server.

Adjusting your Max Upload

Ideally, 128MB is the standard default for reseller, managed and shared VPS but you can readjust these to about 2GB.

Using your preferred command line editor, input the following line after your .user.ini. file has been set up and is open.

Upload_max_filesize=1000M

 
You can set these to whatever value you like and the changes are prompt without requiring the web server to be restarted.

Note; if you use the POST method, you will be required to increase the post_max-size and the upload_max_filesize concurrently. Ensure that you set the former at a slightly higher value than the latter as recommended by PHP.

Adjusting the Post Max Size

The default value for this in most VPS is still 128MB but can be adjusted to about 2GB max. You set the value for this higher than that of the upload_max_filesize for everything to be configured properly.

Using the same procedure as above process, input the following line into the opened.user.ini file using your preferred command line editor.

Post_max_size=1005M

 
The changes are prompt and not web server restart in required.

Adjusting the Max Execution Time

This refers to the maximum time in seconds that a PHP script can be allowed to run. Usually, it is set to around 60 seconds by default and when the time runs out you should experience a PHP error. However, given different circumstances, the 60 seconds can be exceeded.

Using the same criteria as above, input;

Max_execution_time-120.

 
The value here can be as long as you wish. However, it is worth remembering that servers are meant to terminate any PHP connections that take longer than 30 minutes.

Changing the Max Input Time

This is the maximum amount of time in seconds that a PHP script can be allowed to receive or accept input and it is usually set at 60 seconds.

After you open the .user.ini file, user your preferred command line editor to insert this line;

Max_input_time=120

 
The value here is also unlimited but the server protocol is the same as that of the max execution time.

Adjusting the Register Globals Value

In PHP 5.3, this option was deprecated and it is not available in PHP 5.4. It is NOT recommended to enable this either way even though some of the older scripts might have it.

Adjusting Your Magic Quotes

The same scenario as that of the Register Global Value applies in this case and it is equally not recommended to enable this.

Share
1
TDWS Technical Support
TDWS Technical Support

Related posts

man in white dress shirt sitting on black rolling chair while facing black computer set and smiling

Photo by Andrea Piacquadio on Pexels.com

6 March 2023

The Power of Plus Addressing


Read more
15 June 2021

Why Upgrade Your Site to PHP 7.x


Read more
27 May 2021

Common Causes Why is WordPress Slow


Read more
4 April 2021

HOW TO INSTALL WP-CLI?


Read more
11 June 2019

What is Plus Addressing?


Read more
27 May 2019

WordPress Acceleration using NginX Reverse Proxy & Caching


Read more
12 March 2019

How to Switch Your Domain Name Without Damaging Your Site’s SEO


Read more
10 March 2019

How to Use the cPanel/WHM Transfer Accounts Tool


Read more

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Our Services

  • Business Hosting
  • TDWS VPS
  • Dedicated Servers
  • E-Commerce Solutions
  • Enterprise Hosting
  • Managed WordPress Hosting
  • Highly Optimized WordPress Hosting
  • SSL Certificates

TDWS Cloud

  • TDWS Cloud Servers
  • TDWS CloudSites
  • VMware Public Cloud Servers
  • VMware ESXi Private Cloud
  • Microsoft Hyper-V Private Cloud
  • TDWS Virtual Private Cloud
  • Hybrid Cloud
  • Cloud Infrastructure

Recent Posts

  • The Power of Plus Addressing
  • Why an LMS is Essential for Selling Courses Online
  • CentOS Stream vs AlmaLinux: Which Distribution is Right for You?
  • De-Risk Your IT Strategy with TDWS High-Performance Cloud
  • Speeding Up Success: How Power Day Sale Improved Website Performance and Increased Conversions

About Us

  • About Us
  • Why Us
  • Affiliate
  • Contact Us
  • Data Centers
© 2021 TD Web Services. All Rights Reserved.