So I've edited my php.ini file to allow for a longer max_execution_time, among some other settings. When I recycle the application pool in IIS 6 on windows server 2003 and check the php info file I've created, the other settings I've changed stick, but max_execution_time stays at it's default setting (300). What's up? It is not commented out and looks like this:
max_execution_time = 1800
Like I said, I've changed max_input_time to have the same value, and it works.
max_input_time = 1800
Reading a PHP Info file shows that the max_input_time is 1800 seconds, but max_execution_time still says 300. Thoughts on this?
Edit: The Loaded Configuration File listed within the phpinfo file is the file I'm working with. As I mentioned, other settings are taking effect, however, this specific setting is not. This means that it is indeed reading the file I'm editing, it just doesn't want to change the max_execution_time. I've also restarted the server.
please check your php.ini path first after then change in correct file.
or
if you change correct file then restart server
Try you can try to use set_time_limit(0);
Related
I'm using laravel and filepond to upload some files. It works fine with files smaller than 100MB, but if I try to upload bigger (400MB) files I get 413 error.
I have already increased post_max_size and upload_max_filesize in php.ini and changed client_max_body_size in nginx, but it still does not work.
I'm missing something?
Best regards
Its php and nginx related.
Check which php.ini is used php --ini
Sometimes there are multiple ones that change the original value
Search in all php.ini files cat /path/php.ini | grep upload_max_filesize
Last thing is, make sure you restart nginx and php after the changes
Check that the PHP interpreter is reading from the php.ini that you are editing.
Check whether your server resources is sufficient i.e memory size is not exhausted in the process of file uploading. htop can tell you resource consumption on your server. If on php.ini you put values to post_max_size, upload_max_filesize or memory_limit that exceed your server resources, you are most likely to meet the "413 Content Too Large" error.
Error: 413 Request Entity Too Large
I have attempted to increase upload_max_filesize to 20M using the Edit PHP FPM Configuration and Edit PHP CLI Configuration tools in Laravel Forge. It successfully saves my settings, but the changes don't seem to take affect. I have tried restarting nginx and the server.
Environment:
AWS EC2
nginx
Updating since this is the first search engine result for a search on this topic:
Forge now has a built-in setting you can update by going to the server details page and then clicking on PHP from the menu on the left. You'll see a form to change the max file size.
As #dave-alvarez mentioned, there is a setting in Laravel Forge to do this.
Select your server & choose PHP from the left menu.
Set Max File Upload Size as a megabyte integer (with no trailing unit).
Confirm your change by going to the bottom of the page & clicking the Files pull-up, Edit PHP FPM Configuration option. You can search the php.ini for upload_max_filesize.
I was missing a piece. Here's the whole answer.
Nginx Configuration
Add the following line to http or server or location context to increase the size limit in nginx.conf:
# set client body size to 20M #
client_max_body_size 20M;
PHP Configuration
Edit php.ini and set the following directives:
;This sets the maximum amount of memory in bytes that a script is allowed to allocate
memory_limit = 256M
;The maximum size of an uploaded file.
upload_max_filesize = 20M
;Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize
post_max_size = 30M
Source: http://www.cyberciti.biz/faq/linux-unix-bsd-nginx-413-request-entity-too-large/
I am using Ubuntu server with LAMP and I installed phpMyadmin to manage database. By default phpmyadmin session is destroying after 1440 sec.
I have gone through different online tutorials and forums but no method works.
According to the documentation:
Edit the phpMyAdmin config.inc.php and add (or edit) the $cfg['LoginCookieValidity'] directive, for instance $cfg['LoginCookieValidity'] = 10080
Edit the PHP configuration file php.ini (making sure to edit the correct one; you can use phpinfo() to locate the correct location) and extend the time for session.gc_maxlifetime to at least the same value you used for LoginCookieValidity.
EDIT
You don't want to change the session.gc_maxlifetime for all of your applications, but there's still hope. Since you are using Apache and if the corresponding <Directory> entry in your Apache configuration contains AllowOverride Options (or AllowOverride All), then you should be able to configure this on a per-application basis to only affect phpMyAdmin.
You'll need to create a .htaccess file in the top level of the phpMyAdmin directory and include a line like:
php_value session.gc_maxlifetime 10080
That will force the modified setting only for that folder (and subdirectories), so as long as it's in your phpMyAdmin folder it will only affect the phpMyAdmin application.
If you prefer, you should be able to create (or modify) an Apache vhost and edit the PHP setting directly in the Apache configuration; the configuration directive would be exactly the same,
php_value session.gc_maxlifetime 10080
These methods will only work if the AllowOverride directive is set to either All or Options; lesser settings such as None will not allow these changes.
More details.
I wants to upload 6MB image in the products of the magento store. Please help me where i have to change my maximum limit ? This code did not work in php.ini file
upload_max_filesize = 10M
post_max_size = 10M
Any suggestion would be appreciable
Typically the server process (apache, httpd or php-cgi) needs to be restarted after making changes to php.ini. This might be why you are not seeing any difference.
Another way is to put your upload_max_filesize and post_max_size settings in a .htaccess file in the root of your Magento directory. Apache tends to read that more often.
Are you getting an error when you upload the file, or does it just time out? It might be that the dimensions of the image (say 4,000 x 5,000) are too big for scaling/cropping.
Place a file in your root with in it and call it phpinfo.php. Now go to http://www.yoursite.com/phpinfo.php and see what the maximum upload size is.
If you are on shared hosting it may not be possible to increase your php settings beyond what your hosting provider allows. This could be the reason why your settings are not taking hold. Run phpinfo.php and take things from there.
I want to set the include_path variable in my php.ini file (C:\Windows\php.ini).
But, I want different include_path values for different sites hosted on the same Windows server. How can I do this?
http://php.net/manual/en/configuration.file.php says:
php.ini is searched for in these locations (in order):
. . .
You can review this list and see if one of the techniques helps in your case. For example, you can set the environment variable PHPRC, or you can put a different php.ini file in each current working directory, assuming each virtual host has a distinct cwd.
Note that when using Apache and mod_php, or other module embedding PHP in the web server (e.g. FastCGI), the php.ini file is read once, at web server startup. When you use PHP in a CGI manner, the php.ini file is read during every web request, so you have more opportunity to use a different php.ini.
You can set the php include_path from an .htaccess file, assuming you have the correct AllowOverride settings in your httpd.conf file. Here's an example how:
.htaccess
php_value include_path "d:\path\to\include"
As I understand the question, its more important to have individual include paths for each server/site then multiple php.ini files? Id say keep your code in PHP as far as possible.
Then you can just set the include_path with set_include_path or ini_set.
In apache you can set it in virtual domain or .htaccess file with php_value include_path "<first path to look>:<second path>:<etc>:.". IIS probably has a similar method.
Unfortunately, I don't think you can. However, some webservers can change PHP settings on an individual basis... Apache using mod_php has the php_value setting that you can set on various virtual hosts, IIS might have something similar, but I'm not sure.
set_include_path can also override the include path at runtime.
P.S. TF2 Engineer for the win.