Welcome Guest, Not a member yet? Register   Sign In
Random Error 500
#1

Hello,

We upgraded from windows server 2008 R2 to windows server 2016 earlier this year. It is a completely new install. We updated Codeigniter as well as the PHP version. Everything has been running fine for the most part. However, ever since implementing this upgrade we have been getting these random 500 errors. Sometimes it is weekly on the same day, sometimes it is every other day or the same day. It is always at random times. I have checked and there are no errors with IIS. To fix the issue we recycle the application pool. 

We updated PHP again recently and I discovered that I could swap back to the old PHP version and it would fix the issue then after some time I could swap back to the new version and the issue was resolved as if we recycled the app pool. 

Sometimes the issue will resolve itself within an hour or a couple hours however, this is usually not the case. This is driving me crazy as I have no clue what the issue is and have exhausted all of my resources. I have the CodeIgniter and PHP logs and will post the errors of the latest times it has happened. Any help will be greatly appreciated.

---PHP errors log---

[07-Sep-2018 01:16:04 America/Denver] PHP Fatal error:  require_once(): Failed opening required 'C:/projects/tcgpgm/system/core/Output.php' (include_path='.;C:\php\pear') in C:\projects\tcgpgm\system\core\Common.php on line 163

[07-Sep-2018 22:58:09 America/Denver] PHP Warning:  require_once(C:\proje): failed to open stream: No such file or directory in C:\projects\tcgpa\system\core\CodeIgniter.php on line 72
[07-Sep-2018 22:58:09 America/Denver] PHP Fatal error:  require_once(): Failed opening required 'C:\projects\tcgpa\application\config/constants.php' (include_path='.;C:\php\pear') in C:\projects\tcgpa\system\core\CodeIgniter.php on line 72

[10-Sep-2018 17:19:49 America/Denver] PHP Warning:  require_once(C:\projects\tcgpa): failed to open stream: Permission denied in C:\projects\tcgpa\system\core\CodeIgniter.php on line 80
[10-Sep-2018 17:19:49 America/Denver] PHP Fatal error:  require_once(): Failed opening required 'C:/projects/tcgpa/system/core/Common.php' (include_path='.;C:\php\pear') in C:\projects\tcgpa\system\core\CodeIgniter.php on line 80
[10-Sep-2018 17:20:09 America/Denver] PHP Fatal error:  Uncaught Error: Call to undefined function is_php() in C:\projects\tcgpa\system\core\CodeIgniter.php:89
Stack trace:
#0 C:\projects\tcgpa\index.php(293): require_once()
#1 {main}
  thrown in C:\projects\tcgpa\system\core\CodeIgniter.php on line 89

[10-Sep-2018 21:40:09 America/Denver] PHP Warning:  require_once(C:\projects\tcgpa\application\co): failed to open stream: No such file or directory in C:\projects\tcgpa\system\core\CodeIgniter.php on line 72
[10-Sep-2018 21:40:09 America/Denver] PHP Fatal error:  require_once(): Failed opening required 'C:\projects\tcgpa\application\config/constants.php' (include_path='.;C:\php\pear') in C:\projects\tcgpa\system\core\CodeIgniter.php on line 72

[12-Sep-2018 22:39:39 America/Denver] PHP Fatal error:  require_once(): Failed opening required 'C:/projects/tcgpgm/system/core/Config.php' (include_path='.;C:\php\pear') in C:\projects\tcgpgm\system\core\Common.php on line 163

---CodeIgnitor errors log---

ERROR - 2018-09-07 01:16:04 --> Severity: Warning --> require_once(C:\projects\tcgpgm): failed to open stream: Permission denied C:\projects\tcgpgm\system\core\Common.php 163
ERROR - 2018-09-07 01:16:04 --> Severity: Compile Error --> require_once(): Failed opening required 'C:/projects/tcgpgm/system/core/Output.php' (include_path='.;C:\php\pear') C:\projects\tcgpgm\system\core\Common.php 163
ERROR - 2018-09-07 01:16:24 --> Severity: error --> Exception: Class 'CI_Output' not found C:\projects\tcgpgm\system\core\Common.php 196

ERROR - 2018-09-12 22:39:39 --> Severity: Warning --> require_once(C:\proje): failed to open stream: No such file or directory C:\projects\tcgpgm\system\core\Common.php 163
ERROR - 2018-09-12 22:39:39 --> Severity: Compile Error --> require_once(): Failed opening required 'C:/projects/tcgpgm/system/core/Config.php' (include_path='.;C:\php\pear') C:\projects\tcgpgm\system\core\Common.php 163
Reply
#2

@JoeBob,

I'm going to ask the obvious questions.
Does the new PHP version have the same features enabled?
Are the directory/file permissions set the same?
What version of PHP did you originally have? New version?
Reply
#3

(09-13-2018, 09:04 AM)php_rocs Wrote: @JoeBob,

I'm going to ask the obvious questions.
Does the new PHP version have the same features enabled?
Are the directory/file permissions set the same?
What version of PHP did you originally have?  New version?

Yes
Yes
7.1 on the old server and also this server. 7.2.8 now but still had the same issue when it was 7.1
Reply
#4

@JoeBob,

What version of CI did you originally have and what version did you upgrade to?
Also, did you check the forums and github to see if any one was having similar issues?
Reply
#5

(09-13-2018, 01:00 PM)php_rocs Wrote: @JoeBob,

What version of CI did you originally have and what version did you upgrade to?
Also, did you check the forums and github to see if any one was having similar issues?

I don't remember which version we had on the previous server. However we have had 3.1.7 on this one and now have 3.1.9.

I do remember we had to upgrade to 3.1.7 because apparently there are known issues with older versions of codeigniter and iis 10.

I've searched all over the internet and have not found anything that explains the issue we're having.
Reply
#6

@JoeBob,

Is IIS configured the same on both servers?
Reply
#7

(09-13-2018, 02:04 PM)php_rocs Wrote: @JoeBob,

Is IIS configured the same on both servers?

Yes
Reply
#8

@JoeBob,

This is very odd because the errors that you are seeing usually have to do with a permissions issue.
Reply
#9

@JoeBob,

oooooooohhhhhh, wait a minute. I just noticed something in your PHP error messages. I noticed that you have \ and / in a path. That may be a good starting point.
Reply
#10

(09-13-2018, 02:57 PM)php_rocs Wrote: @JoeBob,

oooooooohhhhhh, wait a minute.  I just noticed something in your PHP error messages.  I noticed that you have \ and / in a path. That may be a good starting point.
Maybe a little more insight will help. So there are 4 total web applications under 1 domain name. They are all virtual directories in IIS. 

Only 2 of the 4 have this issue however all 4 have the same configuration in codeigniter. 

I checked the permissions again and they all have the same permissions however, again only 2 of the 4 randomly stop working and it is always 1 at a time. 

As far as the \ and / go that is only showing up in the errors for one web app where the other one doesn't have that error. Also I would think if it was a path issue it would always be an issue and not some random occurrence.

Like I said before the web apps work fine and people access them everyday all day but for some reason they randomly throw a error 500 and no one can access that 1 web app while the other 3 still work fine. The only errors I can find on the whole system is the php and codeigniter logs.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB