How to access the php.ini file in godaddy shared hosting linux

I have a web, and running well on my localhost.

After I Upload on my godaddy hosting, My web got a bug. the conclusions is, I MUST change the memory_limit on the php.ini file, BUT cant find php.ini on FTP manager.

I have tried to:

  • Find the way for change to the Classing FTP manager.
  • Create / upload php.ini file from local and not work.

My Questions is : How I can Fix this? I Must change php.ini file. does anyone have experience like me?


Solution 1:

Create php.ini file with your desired setting and upload it in your root folder of server. It will take effect with this new setting.

You can't edit the php.ini file of godaddy server, but you can upload your own copy of your php.ini with your new setting.

This new setting will be available only to you. Other websites will not be affected with this new setting.

Previously I faced the same issue, but after doing this my problem was resolved.

Solution 2:

Procedures:

  • Go to your CPanel
  • Select PHP version
  • Click on the link Switch to PHP options
  • Edit your configuration
  • don't forget to click save

enter image description here

You can also follow this screencast

https://www.youtube.com/watch?v=tdUlIkZcOe0

Solution 3:

As pointed out by @Jason, for most shared hosting environments, having a copy of php.ini file in your public_html directory works to override the system default settings. A great way to do this is by copying the hosting company's copy. Put this in a file, say copyini.php

<?php
  system("cp /path/to/php/conf/file/php.ini  /home/yourusername/public_html/php.ini");
?>

Get /path/to/php/conf/file/php.ini from the output of phpinfo(); in a file. Then in your ini file, make your amendments Delete all files created during this process (Apart from php.ini of course :-) )

Solution 4:

To check whether your php.ini file takes effect, open a plain text editor and create a file called phpinfo.php. Insert the following line:

<?php phpinfo(); ?>

Save this file to the root of your Web site and then browse to yourdomain.com/phpinfo.php to test the settings.

Solution 5:

Septiyo,

You need to create your own php5.ini file and upload it to your root directory. Using GoDaddy (as I do) you do not have control over the web/conf/ folder to make any changes to their version. Be sure if you're using PHP5 to name your file php5.ini or php.ini for PHP4. Upload it to your root folder, then restart your page, then check using phpinfo() to see if the directory of your php file has changed correctly.

For more information, check this link out. http://www.ostraining.com/blog/coding/phpini-file/