Welcome! Log In Create A New Profile

Advanced

php.ini settings do not work under nginx

Posted by res 
res
php.ini settings do not work under nginx
November 17, 2010 03:42PM
Hi,
I am a newbie to NGINX but run such a server.

Now I try to change this parameter in php.ini:

max_execution_time = 500s

but this does not show up in /phpinfo.php:

max_execution_time 600 600
max_file_uploads 20 20

and instead of the expected 500 or 600sec
the server gives a 500 time-out error, when I let a script run too long.
This error always comes after 60 sec.

I want to set the max_execution_time to 5000s or such,
so that my scripts will run through.

I found this in /phpinfo.php:

Virtual Directory Support disabled
Configuration File (php.ini) Path /etc/php/cgi-php5
Loaded Configuration File /etc/php/cgi-php5/php.ini
Scan this dir for additional .ini files /etc/php/cgi-php5/ext-active
additional .ini files parsed (none)
PHP API 20041225

And also changed above parameter in /etc/php/cgi-php5/php.ini
and restarted
sudo /etc/init.d/php-fpm restart

But this does not change anything.
And the local php.ini also is not recognized.

What am I doing wrong?
Do you need more data from me about my system? If yes, which?

thanks in advance!

Res
Jérôme Loyet
Re: php.ini settings do not work under nginx
November 17, 2010 04:02PM
2010/11/17 res <nginx-forum@nginx.us>:
> Hi,
> I am a newbie to NGINX but run such a server.
>
> Now I try to change this parameter in php.ini:
>
> max_execution_time = 500s
>
> but this does not show up in /phpinfo.php:
>
> max_execution_time      600     600
> max_file_uploads        20      20
>
> and instead of the expected 500 or 600sec
> the server gives a 500 time-out error, when I let a script run too
> long.
> This error always comes after 60 sec.

The fact it stops after 60s comes from nginx itself.

You should play with fastcgi_read_timeout and fastcgi_write_timeout.

server {
...
fastcgi_read_timeout 500;
...
}

>
> I want to set the max_execution_time to 5000s or such,
> so that my scripts will run through.
>
> I found this in  /phpinfo.php:
>
> Virtual Directory Support       disabled
> Configuration File (php.ini) Path       /etc/php/cgi-php5
> Loaded Configuration File       /etc/php/cgi-php5/php.ini
> Scan this dir for additional .ini files         /etc/php/cgi-php5/ext-active
> additional .ini files parsed    (none)
> PHP API         20041225
>
> And also changed above parameter in /etc/php/cgi-php5/php.ini
> and restarted
> sudo /etc/init.d/php-fpm restart
>
> But this does not change anything.
> And the local php.ini also is not recognized.
>
> What am I doing wrong?
> Do you need more data from me about my system? If yes, which?

Modifying max_execution_time in the master php.ini works on my env. I
don't know how you compiled / installed FPM, I can't really help here.
Before finding a solution, you can use the set_time_limit() php
function from you php scripts.

>
> thanks in advance!
>
> Res
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,151519,151519#msg-151519
>
>
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 144
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready