How to change PHP settings in cPanel using .htaccess

Why change PHP settings?

PHP settings define the operating limits of your website (e.g. upload size, available memory, script execution time).
At Konet, thanks to CloudLinux OS + LiteSpeed Enterprise Web Server, you can easily adjust these settings through the .htaccess file.

Important: The maximum limits are always determined by your hosting plan and the upper security limits we have set.


1. Where is the .htaccess file?

  • For the main domain: in the /public_html/ folder.

  • For addon domains or subdomains: in the corresponding folder inside public_html (e.g. /public_html/example.com/).


2. How to modify PHP settings via cPanel

  1. Log in to cPanel.

  2. Select File Manager.

  3. Go to the public_html folder or your domain's folder.

  4. Locate the .htaccess file.

    • If it does not exist, create it (New File → .htaccess).

  5. Right-click → Edit.

  6. Add the lines you need.


3. Examples of PHP settings you can change

 
# Maximum number of input vars php_value max_input_vars 3000 # Maximum available memory php_value memory_limit 512M # Maximum file size for uploads php_value upload_max_filesize 64M # Maximum size for POST php_value post_max_size 128M # Script execution time php_value max_execution_time 120

Tip: If you set a value higher than the allowed limit, the maximum supported by your plan will be applied automatically.


4. What to do if you see Error 500

If an Internal Server Error (500) appears after your changes:

  • Check for syntax errors.

  • Make sure the values you set are allowed.

  • Temporarily remove the last lines you added.

  • If the error persists → open a ticket with Konet Support.


5. Frequently Asked Questions (FAQ)

Can I change settings with php.ini or user.ini?
No. At Konet, PHP changes are made exclusively through .htaccess.

Why isn't the setting I added being applied?
It most likely exceeds your plan's limit. For custom needs, contact Support.

Can I have different settings on subdomains?
Yes. Create a .htaccess file in each subdomain's folder and add the settings there.


 

Was this article helpful?

Related service Konet Web Hosting cPanel, LiteSpeed and automatic backups on every plan.

Related articles