Search code examples
phpconfigurationhostingshared-hosting

GoDaddy php.ini on shared cpanel hosting... where, what and how?


I've been pulling my hair out over how to actually use custom php.ini settings outside of the limited options available directly through GoDaddy's cpanel shared hosting.

It seems they're documentation is wrong or out of date. I've spent hours on the phone with them; they're clueless.

I have identical ini files named as php.ini, php5.ini, php56.ini and .user.ini in both /home/[username] and /home/[username]/public_html:

display_errors = Off
log_errors = On
error_reporting = E_ERROR | E_WARNING
error_log = /home/[username]/php_error.log
memory_limit = 512M
post_max_size = 64M
max_input_vars = 10000

I've killed PHP processes endless times. Waited overnight. Sacrificed a goat.

Output from phpinfo() makes it clear that these configurations are not taking effect, and PHP is just dumping error logs in the directories containing the PHP files where the errors occur.

What is the actual correct location and filename to get PHP configurations working on GoDaddy shared Linux cpanel hosting?


Solution

  • The answer, for me, seems to be to edit the "additional system" ini file at /opt/alt/php56/link/conf/alt_php.ini

    The one caveat is that it will be overwritten if you change PHP settings via cpanel. I can live with that, since this actually works.