0

I am stuck on a peculiar problem. My ajax (jquery COMET) not working in production server. It had workable. After 2/3 month my ajax showing 500 internal server error.

I have updated my CodeIgniter to 3.1.3 still nothing happened. But strange is sometime the ajax is works fine (probably after refresh) and most of the time it showing 500 internal error.

What I have tried so far

  • pconnect set to TRUE in config.php (not worked)

  • dbriver changed both in mysqli and pdo nothing helped

  • .htaccess tried in many ways. My current one is

     RewriteEngine On
    
     #redirect http to https
     #RewriteCond %{HTTPS} !=on
     #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
     RewriteCond %{HTTPS} off
     RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
     RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
     RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    
     RewriteCond $1 !^(index\.php|static|assets|avatars|uploads|robots\.txt)
     RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
     RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
     RewriteRule ^(.*)$ index.php?/$1 [L]
    
     Header set Access-Control-Allow-Origin: http://xx.xxx.xxx.xx
    

Also tried this htaccess

https://gist.github.com/rejoan/38e59d34ba4f667b78c11b637c48c733

More info for helpers

There is https in production server

Locally no such problem like this

when try mysqli sometime it become very slow so now using pdo as dbdriver

I have huge ajax request on this project because it is a chat system

see console

Rejoanul Alam
  • 5,047
  • 3
  • 31
  • 62
  • Have you checked the error logs for a more definitive description? – Jay Blanchard Jan 10 '17 at 20:21
  • It has the answers you're looking for - time to dig in. – Jay Blanchard Jan 10 '17 at 20:23
  • @JayBlanchard as far as i can see this error in error_log `PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 32 bytes) in /home/webc..` – Rejoanul Alam Jan 10 '17 at 20:39
  • 1
    http://stackoverflow.com/questions/415801/allowed-memory-size-of-33554432-bytes-exhausted-tried-to-allocate-43148176-byte – Jay Blanchard Jan 10 '17 at 20:40
  • @JayBlanchard yes checked all file full of this line `PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 32 bytes) in /home/xxx/public_html/system/database/drivers/pdo/pdo_result.php on line 180` from 22-december to 10th january – Rejoanul Alam Jan 10 '17 at 20:51

0 Answers0