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

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?

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.

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
You can also follow this screencast
https://www.youtube.com/watch?v=tdUlIkZcOe0

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 :-) )

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.

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/

if you don't have a good copy of your php5.ini file in your home directory (a predicament that I recently found myself in), you'll need to follow a little multi-step process to make your changes.
Create a little code snippet to look at the output of the phpinfo() call. This is simple, and there are multiple web-sites that describe this process.
Examine the output of phpinfo() for the row which contains Configuration File (php.ini) Path. Mine was in /usr/local/lib, but your's may be a different path (depends on hosting level purchased).
GoDaddy will NOT simply copy this file into your home directory for you --as silly as that sounds! But, you can write a little php program to copy this php.ini file into your home directory. The guy at
https://www.jabari-holder.com/blog/how-to-get-godaddys-php5-ini-file/
has a drop-box with this code snippet, if you care to use it. Just
take care to modify two things:
a. change the path you read 'from' to match the path you uncovered in Step 2.
b. change the output file-name to something of your choosing. You're going to re-name this file in a later step anyway. Let's call our copied file Foo.ini (but it can be anything).
Rename Foo.ini to .user.ini (for most GoDaddy account types).

Create a new php.ini file with your desired settings and upload it to public_html folder of your Godaddy Hosting Account.
By default, Godaddy doesn't allow to edit it's existing php.ini file. However, you can always upload your own copy of your php.ini file with your own settings.
Below is an example of a simple php.ini file with some custom values:
max_execution_time 600
memory_limit 128M
post_max_size 32M
upload_max_filesize 32M

I had this exact problem with my GoDaddy account.
I am running the Linux hosting with cPanel
follow these steps and you should be fine if you are running the same hosting as me:
first, go to you Manage Your Hosting -> Manage
then you will see a section called Files, click on File Manager
you can select the Document Root for: yourwebsite.com then click GO
this should bring you right away in the public_html folder
in that folder, you can add a file (by clicking the +File in top left corner), call it phpinfo.php
right click that new file, and select edit :
right this in it and save changes:
<?php phpinfo(); ?>
it the same public_html folder, add another file called php.ini
edit this one too, right those lines:
max_execution_time 600
memory_limit 128M
post_max_size 32M
upload_max_filesize 32M
now, go back to your Manage Your Hosting -> Manage, look for PHP Process
click Kill Process, this will allows a refresh with your new settings. you are good to go
side note: you can see your new settings by navigating to yourwebiste.com/phpinfo.php

I found a guide to reload the php5.ini file or load a new one right away. You will need to access your Godaddy hosting panel where you will find the option "system process" do a restart there and it will load the php5.ini or php.ini file right away.
2 external guides to assist you:
http://support.godaddy.com/help/article/5980/managing-system-processes-on-linux-hosting-accounts
http://www.studio-owens.com/blog/GoDaddy-and-Your-php-ini-File.htm

For some hosting accounts, I'm on Ultimate Classic Linux, the file name you need to use is .user.ini.

It's an older question, but if anyone has a problem with setting this, their documentation is outdated. I made a copy of the php.ini file named php5.ini and now it works.

Follow below if you use godaddy shared hosting..
its very simple:
we need to access root folder of the server via ftp, create a "php5.ini" named file under public_html folder... and then add 3 stupid lines... also "php5" because I'm using php5.4 for 1 of my client. you can check your version via control panel and search php version. Adding a new file with php5.ini will not hamper anything on server end, but it will only overwrite whatever we are commanding it to do.
steps are simple:
go to file manager..
click on public_html..
a new window will appear..
Click on "+"sign and create a new file in the name: "php5.ini" ... click ok/save. Now right click on that newly created php5.ini file and click on edit... a new window will appear... copy paste these below lines & click on save and close the window.
memory_limit = 128M
upload_max_filesize = 60M
max_input_vars = 5000

Not php.ini file, but a way around it. Go to GoDaddy's
Files > Backup > Restore a MySQL Database Backup
Choose your file and click Upload. No timeouts. Rename the DB if needed, and assign a user in
Databases > MySQL Databases

Related

Why does WordPress still say that my PHP max input vars has not been updated?

I'm setting up a WordPress site and was prompted to increase my PHP max input vars and the memory limit, but all attempts have reigned no results. I managed to change the memory limit with no issues, however, the input vars still remains the same.
I've created a php.ini file and placed in the root directory, and that didn't work. I created a user.ini file in the same location, didn't work either. I even placed it in the wp-admin file and still no dice. I tried to update the .htaccess file because that was a recommended solution, and still no kosher.
This is the line I've placed within the php.ini file: max_input_vars = 3000
So far I had expected any of the different solutions to have removed that error, but still, nothing has changed and I'm all out of ideas. Any pointers are greatly appreciated, and if more details are needed do let me know and I will add as such.
You may try editing the wp-config file in the document root /var/www/html and add the Directive for wp-config.php. Kindly see it below:
#ini_set( 'max_input_vars' , 4000 );
To gain access to the wp-config file you will need to FTP or SSH to the server.
You may also try editing the php.ini file. In my case, it is located at /etc/php/7.0/apache2/php.ini since I am using apache2 for my wordpress site. You may use the "find / -name *php.ini" command to locate your php.ini file and use vi command to edit the file.
; max_input_vars = 1000
You need to remove the semicolon and change the value that you want to use. Don't forget to restart the Apache service.
$ service apache2 restart
To check if you successfully changed the value, you may create a phpinfo.php file in the document root. Edit the file named phpinfo.php and copy the following code.
<?php
phpinfo();
?>
Hope this information helps you.

Increase PHP max_input_vars via web.config in IIS

I have a simple wordpress web site under a windows hosting, I know that a Linux environment is better for wp but I need windows for another ASP.NET application. Anyway wordpress show me an error message about max_input_vars set to 1000 and this value should be 4000, I can't edit the php.ini then I would like to know if is it possible to set this value in the web.config, I know that in Apache it can be set in the .htaccess so I hope that can be done in the web.config as well.
Thanks in advice!
EDIT
I have found a solution: I create a php.ini file with max_input_vars=4000 and I added it to wp-admin folder after that the error message disappear and checking the environment setting by PHP Settings wordpress plugin the max_input_vars value is 4000, I don't know if this is a best practice, but works, if someone has a better solution please explain it.
Thanks!
I know it's been a long time but i thought to post a solution for anyone who search about this issue.
Go to IIS and then from the right side there is an option to stop the server.. click on it.
Go to you default programs folder. Probably C: drive (C:\Program Files (x86)) then search for PHP folder.. probably you will find more than a version. choose the one you're using in wordpress.
Inside that folder you will find a file (php.ini) edit that file using notepad (you must start notepad using admin privilege).
It is a big file.. so search for (max_input_vars = 1000) and it is commented. so you have to remove the semicolon before the word max and then increase it to 4000. You may also search for memory_limit and increase it to 128m or more.
Save the file and make sure it is saved properly. try to open it again and make sure your changes are saved.
Return back to IIS and start the server.
Close the browser and open it again. Check your wordpress if the issue is cleared.
Good luck.
There are four modes in which the PHP directives can be set:
PHP_INI_USER
PHP_INI_PERDIR
PHP_INI_SYSTEM
PHP_INI_ALL
Please have a look at how these are managed: http://www.php.net/manual/en/configuration.changes.modes.php
Each directive has one of these changeability modes defined and for that you could visit: http://www.php.net/manual/en/ini.list.php
As you'd see, the changeability attribute for directive max_input_vars is PHP_INI_PERDIR, meaning it can be overridden by adding a custom value in either of php.ini, .htaccess, httpd.conf (Apache) or .user.ini. Therefore, defining a new php.ini file to increase the limit of max_input_vars is just as fine as the other three workarounds.
Please remember though that, at times, some of the extensions that PHP would use might need to be re-enabled in custom ini files. For instance, I've at times run into problems with pdo and mysqli being considered as disabled, unless explicitly set in the custom file too, when using an override ini file.

Error in wordpress export

I am using WordPress 3.5.2 version. When i try to export xml file it show me this type error.
What i have to do.
File not found
Firefox can't find the file at http://example.com/wp-admin/export.php?download=true&content=posts&cat=0&post_author=0&post_start_date=0&post_end_date=0&post_status=0&page_author=0&page_start_date=0&page_end_date=0&page_status=0&submit=Download+Export+File.
Check the file name for capitalization or other typing errors.
Check to see if the file was moved, renamed or deleted.
Here 's an update. Ran into the same exact problem, and..
It 's positive, it 's a memory issue. Just like what jjava00 said above, increase the memory_limit.
File to edit : php.ini
Line to edit : 232
string : memory_limit = 32MB.
If you can't find it on line 232, search for this string memory_limit, you 'll get there for sure.
Not sure if each hosting has the same default setup, but my default is 32MB. I increased it to 64MB.
Not all of us have this privilege to edit this php.ini file. Including me. I 'm on a shared hosting. So here 're what I did:
I edit the php.ini of my local apache - set the memory_limit to 64MB. (I use appserv)
Upload it to the root of my web dir (www or public_html or htdocs or whatever).
.. and That 's it.
The export.php script can then create the xml file we need to download - as now there 're enough memory resources to do so, and it can be downloaded. Problem solved.
Source: WordPress Forum
Let me know if there have also problem.

Joomla 3.2 Increase the upload_max_filesiz

I am trying to download this template on Joomla 3.2 extension manger :
http://scriptmafia.org/templates/115622-yt-moustache-yootheme-for-joomla-25-32.html
but every time I upload it, it gives me this error:
There was an error uploading this file to the server.
I have read articles about "increase the upload max size in the php.ini file".
I have tried to find this file in the administrator files section in Joomla, but it is "not found".
So how can I fix this problem? It has not happened for this template only, it has happened for several. So I am almost sure it is due to the upload size.
Edit your php.ini and increase *upload_max_filesize* and *post_max_size*; then restart your web server.
If you don't know where is your php.ini, create a php file to discover: echo php_ini_loaded_file();
The returned path is where your php.ini is located.
EDIT
Well, seems like you have a permission error and not size limit. Try to change permissions of the temp Joomla folder (you can see/configure it on Global Configuration > System).
If you are using XAMPP , php.ini file will be located in c:\XAMPP\php folder. Find the file and increase file upload size there.
If you are using WAMP, You can find ini file in /wamp/bin/php directory.
The location may vary from one OS to another.
You can follow this link:
http://www.cyberciti.biz/faq/linux-unix-apache-increase-php-upload-limit/
You can call in your script ini_set function and change values, which have been stored in php.ini (any changes has affected only for current script, but not for global settings)
ini_set('post_max_size', "%value in MiB for example 16M%")
ini_set('upload_max_filesize', "%value in MiB for example 16M%")
You can read more about it at php.net
If you can't resolve the PHP limitation easily, an alternative is to FTP the installation file to the /tmp folder and in Extension Manager -> Install, use the "Install from Directory" option instead.
Had the same issue for the longest time, none of the answers helped. Found that if you are using GoDaddy, and go to your CPanel, scroll down to Software, then choose PHP version, switch to PHP Options, there you can change your upload file size. Hope this helps, took me forever to find it.
Some people might be having a issue with the memory allocation portion of php.ini file "memory_limit" the default for me was 128mb and i was attempting to upload nearly 300mb and it hit that roadblock. After changing the default value to 512mb and restarting the server i was able to get past this limit.
How to change post_max_size and upload_max_filesize in a local installation of Joomla 3 in XAMPP
You can check the php setting in two places – site’s backend under system information – go to php information. Or on browser go to localhost and click on phpinfo. You’ll find the post and upload part under “Core” heading.
Go to c:\xampp\php\
Find the file php.ini
Open php.ini in notepad
Find post_max_size and change value to 20M
Find upload_max_filesize and change value to 20M
Save the file
Logout out of your site backend.
Turn off apache and mysql on xampp and quit
Restart xampp as administrator
Turn on apache and mysql
Open browser and go to localhost
Open phpinfo and search for upload_max_filesize and post_max_size.
Confirm that changes are registered.
This can also happen with the following suhosin setting:
suhosin.upload.disallow_binary = On
Setting it to off temporarily allows you to upload zip files
If you use CPanel, search for PHP version (in the Software section) and click on it, then click on 'switch to PHP Options', the options will display then look for 'upload_max_filesize' and click on the value to change it. Do the same for 'post_max_size'.

Custom php.ini file not working in VPS hosting

I've tried going through Network Solutions tech support but didn't get it resolved ("You need to talk to Signature Support, which is $50").
I'm running some sites off of a Net Sol VPS account and need to change the upload_max_filesize setting (which is apparently set to a paltry 2MB by default) for the php server. I've added:
upload_max_filesize = 20M
post_max_size = 20M
max_execution_time = 6000
to the /httpdocs/cgi-bin/php.ini file (per NS's instructions), and then restarted apache, but when I run a phpinfo on that domain, the settings are not applied. It still says "2M" for the upload max.
I also tried adding this to the server root at /cgi-bin/php.ini as well, to no effect.
There is no /cgi-bin/.php/php.coalesced.ini file that I can see.
Any ideas? I'm losing my mind with this.
First thought is to check your phpinfo() output for the value listed in the "Loaded Configuration File" setting and make sure that it matches the file you've been editing.
You can't just litter PHP.ini files around and expect PHP to load them. If it's not been told to look for one in that cgi-bin directory, the file will just get ignored.
Check the phpinfo() output - the first section will tell you exactly what .ini files were located/parsed, and their location. e.g. on my home server:
Configuration File (php.ini) Path /etc/php5/apache2
Loaded Configuration File /etc/php5/apache2/php.ini
Scan this dir for additional .ini files /etc/php5/apache2/conf.d
Additional .ini files parsed /etc/php5/apache2/conf.d/curl.ini, /etc/php5/apache2/conf.d/gmp.ini, /etc/php5/apache2/conf.d/mysql.ini, /etc/php5/apache2/conf.d/mysqli.ini, /etc/php5/apache2/conf.d/pdo.ini, /etc/php5/apache2/conf.d/pdo_mysql.ini
if your cgi-bin .ini file isn't listed, then PHP is NOT looking in that directory.
I know this is old but figured I'd share my experience. I tried adding a php.ini file to the /cgi-bin folder as I read was suggested, that didn't appear to work. My solution was to SSH onto the server and make a change to the real php.ini file and then restarting the server.

Categories