How to access the php.ini from cPanel?
Asked Answered
H

8

28

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?

Henghold answered 28/8, 2013 at 18:26 Comment(1)
Yes, you can achieve this using an .htaccess file - you don't actually have to edit the php.ini file, which on shared hosting you often don't have access to. See kb.mediatemple.net/questions/1658/Using+.htaccess+files#gsNeolithic
J
23

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

Joist answered 10/12, 2016 at 19:47 Comment(0)
A
5

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.

Abrasion answered 13/6, 2014 at 10:45 Comment(0)
B
5

I had the same issue in cPanel 92.0.3 and it was solved through this solution:

In cPanel go to the below directory

software --> select PHP version--> option--> upload_max_filesize 

Then choose the optional size to upload your files.

Binghi answered 14/1, 2021 at 19:55 Comment(0)
R
2

You could try to find it via the command line.

find / -type f -name "php.ini"

Or you could add the following to a .htaccess file in the root of your site.

php_value max_input_vars 6000
php_value suhosin.get.max_vars 6000
php_value suhosin.post.max_vars 6000
php_value suhosin.request.max_vars 6000
Redshank answered 28/8, 2013 at 18:30 Comment(2)
I try the comment and it shows the same usr/local/...... but i can not find this place on the cpanel accountHenghold
vi /usr/local/lib/php.ini from the command line, it will open the document up, scroll down to the lines you need to edit, hit i edit the numbers, hit esc, type w hit return, type q hit return. doneRedshank
A
2

In cPanel search for php, You will find "Select PHP version" under Software.

Software -> Select PHP Version -> Switch to Php Options -> Change Value -> save.

Aphotic answered 2/3, 2018 at 9:55 Comment(0)
D
1

Go to main screen. Under 'Software/Services' > 'php.ini EZConfig'.

Detect answered 13/6, 2014 at 10:29 Comment(1)
cPanel 2022 version. On cPanel homepage, go to SOFTWARE > MultiPHP INI EditorGleanings
D
1

Search for "php version" at the bottom of the cpanel

Select PHP Version -> Switch to Php Options -> Change the Value -> save.

Dugas answered 4/1, 2021 at 21:15 Comment(1)
the simpleast way to change php ini for your project i use it its goodCompression
L
0

You cant do it on shared hosting , Add ticket to support of hosting for same ( otherwise you can look for dedicated server where you can manage anything )

Lessard answered 17/2, 2015 at 4:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.