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

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条)

报告相同问题?

悬赏问题

  • ¥15 Arcgis相交分析无法绘制一个或多个图形
  • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格
  • ¥15 fpga自动售货机数码管(相关搜索:数字时钟)
  • ¥15 用前端向数据库插入数据,通过debug发现数据能走到后端,但是放行之后就会提示错误
  • ¥30 3天&7天&&15天&销量如何统计同一行
  • ¥30 帮我写一段可以读取LD2450数据并计算距离的Arduino代码
  • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
  • ¥15 vs2019中数据导出问题
  • ¥20 云服务Linux系统TCP-MSS值修改?
  • ¥20 关于#单片机#的问题:项目:使用模拟iic与ov2640通讯环境:F407问题:读取的ID号总是0xff,自己调了调发现在读从机数据时,SDA线上并未有信号变化(语言-c语言)