drwg89980 2016-05-20 11:27
浏览 100
已采纳

Codeigniter和Apache配置问题

I am having one Codeigniter project that include one "time expensive" synchronization. Basically I am connecting to remote server(running probably CentOS but thats all I know) via OCI8 to Oracle database, picking about 20,000 rows, and then updating local MySQL database.

That synchronization lasts for about 20ihs minutes (yes, MySQL could be more optimized and what not), but thats not the issue that I am having currently...

I have dedicated server with dual Xeon and 16 Gig of ram, CentOS x64, Apache 2.2.15, PHP 5.6.21 and MySQL version 5.6.30.

Now, with Apache 2 Handler and default PREFORK MPM, that synchronization works as intended.

If I leave Apache 2 Handler (mod_php I presume) and change MPM to WORKER or EVENT, that synchronization starts and PHP spits out white screen of death with nothing in log files.

If I switch to fcgi and EVENT or WORKER MPM, synchronization starts, and after about 2 minutes it gives me "The gateway did not receive a timely response from the upstream server or application."

Mind you that its not connection between servers issue since the moment I switch back to Apache 2.0 Handler and PREFORK it works as intended.

Codeigniter version is 2.1.0 (yes I am aware that it long past time to upgrade, its just inherited project and I am not fully aware if there has been some changes with CORE files and the guy is "well its working, ain't it".

Any clue or link with similar issue is more than appreciated.

Thanks in advance

  • 写回答

2条回答 默认 最新

  • doulei8861 2016-05-20 21:53
    关注

    Do a httpd -M and see if you have fcgid_module in the list of Apache's active modules.

    If not, do yum install mod_fcgid and install it

    Then you will probably need to do some settings for your timeout issue, assuming you have set up everything else to use CGI/FastCGI instead of Apache 2 Handler, in your /etc/httpd/conf/httpd.conf something like

    <IfModule mod_fcgid.c>
            FcgidIdleTimeout 1800
            FcgidProcessLifeTime 1800
            FcgidBusyTimeout 1800
            FcgidIOTimeout 1800
            FcgidConnectTimeout 20
    </IfModule>
    

    Do a restart service httpd restart and service php-fpm restart (or whatever PHP handler you are using) and re-try

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?