0

I have a hosted website with cPanel. I want to modify php.ini, but I don't get where that file is on server. I tried to find the location of the file using phpinfo() and I got the location as /usr/local/lib/php.ini but when I search in file manager I'm unable to find this location.

I looked at https://stackoverflow.com/a/3401536/1989696 and followed the same steps, but I'm not sure how to tell if the webserver supports SSH or SFTP access.

Also, how can I locate the php.ini file?

Community
  • 1
  • 1
Jayesh_naik
  • 375
  • 3
  • 7
  • 17

1 Answers1

3

Unless you have a dedicated or virtual server, you are not allowed to edit system-wide PHP settings.

If PHP runs as CGI, you'll possibly have a custom .ini file you can tweak:

CGI

... or, if your PHP version is 5.3 or greater, you can create your own .user.ini files.

If PHP runs as Apache module:

enter image description here

... you can use good old .htaccess.

And, of course, 95% of the PHP settings can just be changed from within PHP code:

Álvaro González
  • 142,137
  • 41
  • 261
  • 360