LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-21-2013, 07:28 AM   #1
maxmilhas
LQ Newbie
 
Registered: Nov 2013
Posts: 7

Rep: Reputation: Disabled
Question CentOS + NGinx + PHP: unexpected timeout (process execution limits??)


Hello,

I have a timeout problem in a server that is hosting several different pages (on a few different domains). For some of these pages, the execution of the PHP scripts can't be more than 45 seconds (but it is not PHP that puts this limit, for me).

To test I have made a simple script with a "sleep(46);" call. With 46 the page will be a 500 HTTP "internal server error". With 44 or less it will work, and a call to phpinfo() function in this test script shows "max_execution_time 6000", despite of the 45 second limitation.

Nginx's configuration for this site (/var/www/[site-path]/conf/last_nginx.conf) doesn't have anything to limit the execution time. The global Nginx config also doesn't have anything. I thought I could add something to Nginx config (assuming it's his fault), but on documentation pages I didn't see anything that may help. http://nginx.org/en/docs/dirindex.html] Am I right?

So I'm guessing it must be some system program or limit that imposes this limit for some sites (since not all of them have this limitation). But I need help on finding out wich programs or configuration files to check, change or create. Could you help me?

Any ideia that may be a single step to the solution is very welcome.

Maxmilhas
 
Old 11-21-2013, 05:36 PM   #2
action_owl
Member
 
Registered: Jan 2009
Location: 127.0.0.1
Distribution: Fedora, CentOS, NetBSD
Posts: 115

Rep: Reputation: 17
Is the max_execution_time in /etc/php.ini set to something sane?

You say that you are getting a 500 error, there should (hopefully) be a log somewhere that has more info. You may need to enable the "display_errors" option in php.ini.

Posting your nginx, php, and fpm configuration will help as well.

Also, I've deployed php applications on a LOT of CentOS servers and I've always used apache. I use Nginx for pretty much anything else, but Php+apache always have worked out well for me on CentOS, just thought I'd mention that if you are having issues with FPM.
 
Old 11-22-2013, 06:14 AM   #3
maxmilhas
LQ Newbie
 
Registered: Nov 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by action_owl View Post
Is the max_execution_time in /etc/php.ini set to something sane?
Yes, it is set to 3600. So, 6000 in local php.ini (and phpinfo() output), and 3600 in global php.ini.

I'll check here (for the other parts of your answer) and reply again soon. Thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Install nginx with PHP and MySQL in CentOS 6.4 / RHEL 6.4 LXer Syndicated Linux News 0 03-26-2013 05:50 AM
LXer: Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On CentOS 6.4 LXer Syndicated Linux News 0 03-21-2013 10:10 PM
Unexpected error in centos combining php yahoosam Linux - Desktop 1 07-02-2012 02:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration