Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access the php.ini from cPanel?

Tags:

post

php

cpanel

I want to change the limit of the PHP POST array from 1000 to 6000. Is there any way to do that? I searched it and found that I should change some variables in php.ini but the problem is that I did not find the directory of the file in my cPanel:

Your server's php.ini file is located at /usr/local/lib/php.ini.

This line is from the CPanel documentation but i could not find this directory in my cpanel even after i show the hidden files???? can anybody help me locating this file?

like image 246
Basel Avatar asked Aug 28 '13 18:08

Basel


People also ask

How do I access my PHP ini?

ini is usually located in /etc/php/8.1/fpm/php.

How do I find PHP settings in cPanel?

In cPanel search for php, You will find "Select PHP version" under Software. Software -> Select PHP Version -> Switch to Php Options -> Change Value -> save.


2 Answers

Cpanel 60.0.26 (Latest Version) Php.ini moved under Software > Select PHP Version > Switch to Php Options > Change Value > save.

like image 129
Fosco Clayhangzo Avatar answered Sep 21 '22 17:09

Fosco Clayhangzo


If you're on a shared hosting environment you won't have access to the php.ini to make these changes, if you need access, a virtual private server (VPS) or a dedicated server may be a better option if you're confident in managing it yourself.

Alternatively if you create a new file called .htaccess in your root of your web directory (Ensure it doesn't contain a .txt extension if using notepad to create the file) and copy something like this inside.

php_value settingToChange 6000

This will only work if your hosting provider let's you override the certain config value. Best to ask if it doesn't work after trying.

like image 38
Dan Horrocks-Burgess Avatar answered Sep 22 '22 17:09

Dan Horrocks-Burgess