php.ini location?

Joined
Aug 29, 2016
Messages
38
Best answers
0
Ratings
2
Points
8
#1
I have error Fatal error: Allowed memory size...and following guides to fix this but I need to change memory_limit = 512M or higher in php.ini, but I don't know where is the location of my php.ini on my server? I am using cPanel.
 

FerdieQO

Well-known member
Joined
Jul 15, 2016
Messages
138
Best answers
0
Ratings
14
Points
18
#2
In your Putty, login as root account and running this command

php -i | grep "Loaded Configuration File"
It should show you somethings like this

Code:
[[email protected] ~]# php -i | grep "Loaded Configuration File"
Loaded Configuration File => /usr/local/lib/php.ini
And /usr/local/lib/ is the path where you can find out your php.ini file.

Hope that helped!
 

R Langley

Well-known member
Joined
Dec 12, 2016
Messages
205
Best answers
0
Ratings
17
Points
0
#3
I have error Fatal error: Allowed memory size...and following guides to fix this but I need to change memory_limit = 512M or higher in php.ini, but I don't know where is the location of my php.ini on my server? I am using cPanel.
public_html/php.ini should be, do you have access to the WHM or is it like shared hosting cPanel?
 

energizedit

Well-known member
Joined
Dec 13, 2016
Messages
259
Best answers
0
Ratings
14
Points
18
#4
If this is just for a cpanel account you can create it in your public_html directory. Just create a new file php.ini then edit it with the line memory_limit = 512M and save it. That should do the trick.
 

HostXNow

Well-known member
Joined
Nov 26, 2014
Messages
373
Best answers
0
Ratings
25 1
Points
28
#5
Which service are you using? Web/Reseller or your own VPS/Dedicated server? If the former then you may not be able to override the hosts' fixed values, if the latter and you're using cPanel then you can quickly update the setting using PHP Configuration Editor where the location is different depending on whether using EasyApache 3 or EasyApache 4.
 
Joined
Aug 29, 2016
Messages
38
Best answers
0
Ratings
2
Points
8
#6
public_html/php.ini should be, do you have access to the WHM or is it like shared hosting cPanel?
I don't see php.ini file in my public_html, I can access WHM.

Which service are you using? Web/Reseller or your own VPS/Dedicated server? If the former then you may not be able to override the hosts' fixed values, if the latter and you're using cPanel then you can quickly update the setting using PHP Configuration Editor where the location is different depending on whether using EasyApache 3 or EasyApache 4.
I can edit values in php.ini via WHM? It's more convenient than using terminal or ssh.
 

Skylarkhosting

Well-known member
Joined
Dec 24, 2016
Messages
85
Best answers
0
Ratings
7
Points
8
#8
php.ini should be located in root directory.

If you have access to .htaccess file, you can increase memory by adding following lines in it..

php_value upload_max_filesize 1000M
php_value post_max_size 2000M
php_value memory_limit 3000M
php_value max_execution_time 180
php_value max_input_time 180
Feel free to play around with sizes.
 
Joined
Jan 1, 2017
Messages
39
Best answers
0
Ratings
1
Points
0
#9
if you ar using cpanel cpanel you go tweak setting option and you see it php tab
 

Kieran2001

Well-known member
Joined
Mar 4, 2017
Messages
118
Best answers
0
Ratings
11
Points
18
#12
Hello,

This depends on your hosting environments, shared clients should be able to modify it via CPanel from the php zone editor feature if provided. Although are unlikely to have direct access, the same applies for shared resellers.

However, the ability to change the php.ini files is completely up to your hosting provider, especially on a shared hosting services.

Did I satisfactorily answer your question? Don't forgot to leave me a thumbs up or 'thanks' :)

If I didn't please send me a message, so we can discuss any issues with my answer. If there's any additional questions, feel free to ask them in the thread, quoting me if necessary.

Best Regards,
Kieran Cairns
 

racksandcloud

Well-known member
Joined
May 18, 2017
Messages
89
Best answers
0
Ratings
13
Points
0
#13
in cpanel, php.ini is located in /usr/local/lib/php.ini but it better you check with below command to find the loader php.ini

=======
$ php -i | grep php.ini
=======

you wont be able to edit this file or run the above command if you do not have root access to the server. If you have cpanel account access only, please use .htaccess to increase the memory limit. Which is also can restrict by the hosting provider. It would be better to open ticket to your hosting provider if .htaccess wont help.
 
Older Threads
Replies
12
Views
1,880
Replies
3
Views
1,077
Replies
13
Views
3,702
Replies
7
Views
821
Latest Threads
Replies
0
Views
14
Replies
0
Views
1
Replies
2
Views
23
Replies
2
Views
37
Similar Threads

Latest postsNew threads

Latest Hosting OffersNew Reviews

Sponsors

Latest Blog ArticlesMost Viewed Threads

Top