30 seconds timeout solutions not working - php

I have tried every possible solution for my php file 30 seconds timeout, but nothing works.
Is it possible that my new configurations that I put in my code don't take affect and still works according to the configurations which are in Goddady's default php.ini?

Quick google shows that you can't change that setting on GoDaddy shared servers. Can't be done: http://support.godaddy.com/groups/web-hosting/forum/topic/set-max_execution_time-and-max_input_time/
That was 2 years ago, and so probably not changed. Go virtual or get a new host?

Yet it is possible that a hosting provider does not allow overrides for some settings or for all settings.
That's what the httpd.conf configuration directive AllowOverride None/AllowOverride All does.
Use ini_get('max_execution_time') to check what the execution time becomes after you've tried a solutin. If it doesn't change it's obvious that solution didn't work.

Are you sure you've put it in the correct location to be identified? if so, you can look into this link
http://support.godaddy.com/help/article/5647/why-isnt-my-phpini-file-taking-effect
you've provided too little information about your server. if it is linux, here what they said:
On Linux Shared Hosting accounts, you can kill the Web processes to
get your php.ini (PHP 4) or php5.ini (PHP 5) file to take effect.

I was able to make it work on a Godaddy shared Linux account by creating a .user.ini file in the hosting root.
My changes are visible with phpinfo()

remember that when setting your own custom php.ini file with Godaddy you may pull up timezone warning messages. In which case you have to also define the default timezone in the php.ini file, for example:
date.timezone="Europe/London"
More about this problem here:
https://uk.godaddy.com/help/why-did-i-receive-a-timezone-error-with-my-php-website-6703

Related

Set max_input_var on 1and1 Server for a Prstashop 1.6

I have a Prestashop 1,6 with 1and1 as hosting Service and cant use the Translation Service in the Backend because of the max_input_vars settings.
Warning! Your PHP configuration limits the maximum number of fields allowed in a form: 5000 for max_input_vars.
Please ask your hosting provider to increase this limit to 5271 at least, or you will have to edit the translation files.
I tryed to set the max_input_vars settings to 6000 and didnt get a error on the server but it wont work has someone a solution to fix it or knows how to change it?
P.S. here is the PHP file i used
<?php
error_reporting(E_ALL);
ini_set('max_input_vars', 6000);
?>
if you have shared hosting then instead of php.ini you have create a file name .user.ini and
max_input_vars=6000;
and upload on root. it will take time to reflect changes based on server settings.
I think that the best way to do this is asking directly to 1and1 because is probable that you don't have permissions to change this feature of PHP.
Also, you have another options:
File .htaccess: externar link
Make a php.ini file in the root of the installation and add this:
max_input_vars=6000;
Hope it 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.

Dynamically change php ini variable

I have recently purchase Godaddy Linux Shared hosting. In My site there is one php.ini file in my root(/) directory. As my requirement i have set ini paramete output_buffering=on but it will not take effect in my site.
because after changing ini setting we need to restart server, but as it is godaddy's shared server they are not able to restart server. I have talked also in support. But no result.
so can any one give solution how can php.ini change will take effect without restart apache server.
I have tried by setting in .htacces as php_value output_buffering on but it won't work.
One solution would be to use ini_set(). http://ca1.php.net/ini_set
ini_set('output_buffering', 'on');
Of course this is not completely ideal, as you have to call it wherever you want output buffering to be enabled.

cannot change php max_memory in php.ini

I am trying to change the max_memory parameter so I went into my php.ini and set max_memory = 500M For some reason, when I use phpinfo(), that setting still displays 128M (the default setting). I read that some hosts restrict max_memory. Is there a way to change this value manually, or override this option in a config file, or do I have to recompile php?
If you can recompile PHP, then you, obviously, have full control of the web server.
I would guess, as written in the comments, you:
Did not restart the Apache (or not the right Apache)
(as you found) You are editing the wrong ini file.
Your server simply don't have 500MB free memory
a few other things to check:
the report from phpinfo states that it is using the php.ini file that you're editing, not some more "specific" .ini file somewhere else
you haven't overridden the memory_limit variable through an apache .htaccess file or using ini_set in a PHP script somewhere
if you're in a shared environment, as Itay suggests, you may not have more than 128M available to your account, and you probably don't have access to reset apache either.
if that's the case, try making the value smaller to see if the changes you're making take effect. If they are, and you can't increase it above 128M, time to upgrade your hosting account.. otherwise, try making the change through .htaccess or ini_set in your script because those methods don't require an apache restart.
if you still can't get it to work, contact the host and ask them to make you a local copy of the global php.ini file for your account.

Enable parse_ini_file into .htaccess

anyone knows if is it possible to enable php parse_ini_file() function overriding php.ini settings into .htaccess? If yes how it can be done?
Thank you all for help
If it was disabled using disable_functions, you can't reactivate it using a .htaccess php_value directive. See http://php.net/manual/en/ini.core.php
As far as I know, parse_ini_file() is a core function built into PHP, thus it can't really be enabled. I'll guess that you are facing one of these situations:
Your host has disabled it for security reasons (:-?) using the disable_functions directive.
You are providing a URL in the $filename parameter and your host has disabled loading or remote files with the allow_url_fopen directive.
You are reading an *.ini file you don't have access to.
In general, all three cases imply that you are just not allowed to do so. Even if you manage to find a hack and override the restriction, you might be violating your host's terms of use. Whatever, it's possible that you are just trying to do the wrong thing:
Local files can be read from disc, there is not need to use HTTP.
You should be able to read your own files, given that they're given the appropriate permissions.
I added a copy of php.ini under the folder where application wants to call parse_ini_file() and it helped, but my hosting provider "honors" php.ini file per directory, so each app can use different settings.
In this case the app was complaining PHP function parse_ini_file is not available not because the method was disabled, but because it could not find php.ini to parse.

Categories