500 - Internal Server Error

Hello,

I am having problems accessing the SuitCRM after upgrading to the latest version 7.10, I’m getting 500 - Internal Error There is a problem with the resource you are looking for, and it cannot be displayed.

My setup is as follows:

SVR - 2008R2 x64
CRM - 7.10
IIS - 7.5
PHP - 7.1.15
MySQL - 5.6

After upgrading my system I was still running PHP version 5.6 which worked to some degree, apart from the admin page is blank and a few others.
I read upgrading PHP fixes this, but after upgrading PHP to 7.1 I get the 500 - internal serve error.

When I come to check the PHP logs for Version 5.6 I am seeing no fatal errors. But when I come to check the error log for 7.1 there isn’t one! it’s not even using PHP, it doesn’t get to that stage or it doesn’t work I’m not sure.

IUSR has full control on the CRM folder within the root of the inetpub folder.

I have also checked through the upgrade wizard log it’s showing as successful, see below.

[UpgradeWizard] - Upgrade started. At start.php
[UpgradeWizard] - at unlinkUWTempFiles()
[UpgradeWizard] - finished!
[UpgradeWizard] - resetting $_SESSION

I have also tried all versions of PHP from 7.0 onwards, same 500 error - internal server error.

Any help will be greatly appreciated.

There seems to be a problem with the link between PHP and web server.

On Windows, sometimes you find useful IIS info on Event Viewer. You need to find out exactly what it’s complaining about…

Hi,

Thanks for your response, I managed to get this working by creating a server 2012r2 VM and using IIS 8.5 and PHP 7.1 and migrating the database but now I have a blank admin page.

I have checked the PHP logs and I’m not getting any warnings / errors.

Do you have any ideas on how to fix a blank admin page? as I now cant update to 7.10.2.

Thanks.

We need some clue from the logs, otherwise we won’t know what going wrong.

Have you checked suitecrm.log, errors.log (or whatever it’s called in IIS), or perhaps Windows Event Viewer it has an IIS section?

Hi,

I have just looked at the suitcrm.log and have managed to find a few errors, please see below.

Thu Mar 15 16:19:27 2018 [556][93f57474-57d9-fccf-265e-568e30332af7][FATAL] Exception handling in C:\inetpub\CRM\include\MVC\Controller\SugarController.php:402
Thu Mar 15 16:19:27 2018 [556][93f57474-57d9-fccf-265e-568e30332af7][FATAL] Exception in Controller: DateTime::__construct(): Failed to parse time string (18/09/2015) at position 0 (1): Unexpected character
Thu Mar 15 16:19:27 2018 [556][93f57474-57d9-fccf-265e-568e30332af7][FATAL] backtrace:
#0 C:\inetpub\CRM\custom\modules\Opportunities\views\view.edit.php(72): DateTime->__construct(‘18/09/2015’)
#1 C:\inetpub\CRM\include\MVC\View\SugarView.php(207): OpportunitiesViewEdit->display()
#2 C:\inetpub\CRM\include\MVC\Controller\SugarController.php(432): SugarView->process()
#3 C:\inetpub\CRM\include\MVC\Controller\SugarController.php(375): SugarController->processView()
#4 C:\inetpub\CRM\include\MVC\SugarApplication.php(109): SugarController->execute()
#5 C:\inetpub\CRM\index.php(52): SugarApplication->execute()

As mentioned in previous post nothing within PHP logs.

I have just checked EventViewer Administrative Events and Server Roles (IIS) and no errors within there.

Thanks.

Hi

that error is in an Opportunity edit view, and it’s in your own custom code:

custom\modules\Opportunities\views\view.edit.php (line 72)

There’s something about that date in the Opportunity, or the way it is being handled by your code, that seems to break things.

That is probably not related at all to the admin screen. You should scan your logs for things happening at the time of the blank screen.

Hi,

Here is the code within that file, any idea’s on what I’ve got to amend in the code to fix this issue.

// GET LATEST CREDIT CHECK
		$lastCheckDate = null;
		$lastCheckResult = null;
		foreach ($this->bean->sa_creditchecks->getBeans() as $check) {
			$compareCheckDate = new DateTime($check->credit_check_date);
			if (is_null($lastCheckDate) || $compareCheckDate > $lastCheckDate) {
				$lastCheckDate = $compareCheckDate;
				$lastCheckResult = $check->credit_rating;

Thanks.

Check that “new DateTime” line. See what exactly it’s trying to use as a parameter, and make sure it’s a format that the function understands. you might need to set your locale in PHP. Or you might need to format the string better so it can understand which is the year, which is the month, etc.

Okay thanks, I will look into that another time. I will have to get back on the original subject of the Admin page not working.

I have enabled “display_errors” within the PHP.ini, please see below for the results I’m getting since enabling.

Administration

Notice: Undefined property: OutboundEmail::$smtp_from_name in C:\inetpub\CRM\modules\Administration\Administration.php on line 171 
Notice: Undefined property: OutboundEmail::$smtp_from_addr in C:\inetpub\CRM\modules\Administration\Administration.php on line 171 
Notice: Undefined property: OutboundEmail::$smtp_from_name in C:\inetpub\CRM\modules\Administration\Administration.php on line 171 
Notice: Undefined property: OutboundEmail::$smtp_from_addr in C:\inetpub\CRM\modules\Administration\Administration.php on line 171 
Notice: Undefined property: OutboundEmail::$smtp_from_name in C:\inetpub\CRM\modules\Administration\Administration.php on line 171 
Notice: Undefined property: OutboundEmail::$smtp_from_addr in C:\inetpub\CRM\modules\Administration\Administration.php on line 171 
Notice: Undefined property: OutboundEmail::$smtp_from_name in C:\inetpub\CRM\modules\Administration\Administration.php on line 171 
Notice: Undefined property: OutboundEmail::$smtp_from_addr in C:\inetpub\CRM\modules\Administration\Administration.php on line 171 

Fatal error: Uncaught Error: Call to undefined method SA_CreditCheckPaymentTerms_sugar::SA_CreditCheckPaymentTerms_sugar() in C:\inetpub\CRM\modules\SA_CreditCheckPaymentTerms\SA_CreditCheckPaymentTerms.php:47 
Stack trace: #0 C:\inetpub\CRM\include\MVC\SugarModule.php(111): SA_CreditCheckPaymentTerms->SA_CreditCheckPaymentTerms() 
#1 C:\inetpub\CRM\modules\Users\User.php(1636): SugarModule->loadBean() 
#2 C:\inetpub\CRM\modules\Users\User.php(1694): User->_getModulesForACL('dev') 
#3 C:\inetpub\CRM\modules\Administration\metadata\adminpaneldefs.php(246): User->getDeveloperModules() 
#4 C:\inetpub\CRM\modules\Administration\index.php(64): require('C:\\inetpub\\CRM...') 
#5 C:\inetpub\CRM\include\MVC\View\SugarView.php(807): include_once('C:\\inetpub\\CRM...') 
#6 C:\inetpub\CRM\include\MVC\View\views\view.classic.php(74): SugarView->includeClassicFile('modules/Adminis...') 
#7 C:\inetpub\CRM\include\MVC\View\SugarView.php(207): ViewClassic in C:\inetpub\CRM\modules\SA_CreditCheckPaymentTerms\SA_CreditCheckPaymentTerms.php on line 47 

It’s complaining about Incoming and Outgoing SMTP, would this cause a problem with the Admin page to be blank?

Thanks.

PHP Notices are usually safe to ignore. So don’t mind those SMTP messages.

FATAL errors, on the other hand, are PHP crashes and break the app. The one you have shows a non-standard function call failing. This is, again, some customization you have made that is breaking SuiteCRM. Either you asked someone to code stuff in your system, or you bought an add-on that adds this code, and now it’s broken with the upgrade.

In either case, these don’t seem to be upgrade-safe customizations, which is not a good practice (it has the consequences you are experiencing now). I mean, what is a custom module doing in the “modules” directory? Why isn’t it in “custom”?

Hello,

This CRM system was setup a few years ago by a previous IT Technician at the company I work for, I have been given no information what so ever, just dumped with me to sort.

I’m guessing the custom code was outsourced to another company and maybe the reason for custom modules not being in the correct directory, I’m really not sure.

Thanks for pointing out the reason I’m having these problems, is there an easy way to get this working correctly in it’s current state or does the custom code need updating or removing before the CRM will function correctly?

Thanks.

I think you definitely need a PHP developer looking at your installation to fix it. Probably the easiest route is to disable all custom code, your developer would just go around removing the function calls that are giving errors. But the proper route would be to re-work those customizations (which seem to be doing credit checks, I suppose you still need that functionality) and move them to the correct places.

1 Like

Thanks for your help, much appreciated. :slight_smile: