HTTP Error 500

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
buck1942
Veteran Member
Posts: 31
Joined: 2016-08-04 02:38

HTTP Error 500

Post by buck1942 » 2019-09-20 16:04

I have been using Appgini for years, but in recent months, on two different servers, I have been getting:
=======================================================================
This page isn’t working buckswebsite.net is currently unable to handle this request.
HTTP ERROR 500 :|
=======================================================================
I have not developed anything new for a long time. It is strange the same problem is on two separate servers.

I have several applications on each server, but they all return the same error.

Any tho'ts would be a big help.

Buck

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: HTTP Error 500

Post by pbottcher » 2019-09-20 18:32

Hi,

can you have a look at the webserver error log to see what causes that error.
Did the environment on the server change, eg. new PHP version?
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

buck1942
Veteran Member
Posts: 31
Joined: 2016-08-04 02:38

Re: HTTP Error 500

Post by buck1942 » 2019-09-21 01:06

Follows is information from the error.log... I have this same problem on two different websites that I maintain
I appreciate your taking a look.

This is the error reported from /home/bucksweb/public_html/appgini/rmb2019a/header.php
-------
[20-Sep-2019 19:19:34 UTC] PHP Warning: Use of undefined constant datalist_db_encoding -
assumed 'datalist_db_encoding' (this will throw an Error in a future version of PHP)
in /home/bucksweb/public_html/appgini/rmb2019a/header.php on line 8

=======================================================================================
here is part of /home/bucksweb/public_html/appgini/rmb2019a/header.php showing line 8
=======================================================================================

<!DOCTYPE html>
<?php if(!defined('PREPEND_PATH')) define('PREPEND_PATH', ''); ?>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="<?php echo datalist_db_encoding; ?>"> <<--------------LINE 8
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

...

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: HTTP Error 500

Post by pbottcher » 2019-09-21 06:25

Hi,

thanks, what version of AppGini are you using?

can you add

if(!defined('datalist_db_encoding')) define('datalist_db_encoding', 'UTF-8');

to the header.php and maybe replace UTF-8 with whatever you DB encoding is set to.

<!DOCTYPE html>
<?php if(!defined('PREPEND_PATH')) define('PREPEND_PATH', ''); ?>
if(!defined('datalist_db_encoding')) define('datalist_db_encoding', 'UTF-8');
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: HTTP Error 500

Post by onoehring » 2019-09-21 08:10

Hi buck1942,

I would also think it's some problem with a new php version. I suppose all sites are running on the same host. This will probably mean, all sites are using a newer php version as well.

Did you post the contents from the header.php file or from the browser source window?
My header.php looks different (first lines only):

Code: Select all

<?php if(function_exists('set_headers')) { set_headers(); } ?><!DOCTYPE html>
<?php if(!defined('PREPEND_PATH')) define('PREPEND_PATH', ''); ?>
<?php if(!defined('datalist_db_encoding')) define('datalist_db_encoding', 'UTF-8'); ?>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
	<head>
		<meta charset="<?php echo datalist_db_encoding; ?>">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="description" content="">
As pbötcher suggested, there is some php code before that line 8 you are talking about that actually defines that variable. As I am using AppGini since version 5.75, maybe it's because your AG Version is old (and thus generating old code)?

Olaf

buck1942
Veteran Member
Posts: 31
Joined: 2016-08-04 02:38

Re: HTTP Error 500

Post by buck1942 » 2019-09-25 15:24

I thank you for your suggestions... I have tried them all, to no avail.

I upgraded to Appgini 5.76 and that did not help.

I am going to wait, months or so, to see if things settle down. I am tired of debugging and I am sure, at least at different levels, the problem is shared by PHP 7.xx and newer versions Appgini.

I'm sure this too will pass...

Buck

p.s. Applications I write outside of Appgini, in php, work well on PHP 7.xx. In all fairness, what I write in noway compares to the complexity of Appgini, which is a fine product

buck1942
Veteran Member
Posts: 31
Joined: 2016-08-04 02:38

Re: HTTP Error 500

Post by buck1942 » 2019-10-11 04:05

ALAS... my error 500 is fixed.

I wrote a simple app that would read and display a database to help isolate the problem.

I contacted my website provider... he had set some parameter incorrectly. He fixed it in matter of minutes and I am, once again, a happy camper.

I am running PHP 7.27 and Appgini 5.80 (the problem was fixed before I upgraded to 5.80...) looking forward to trying the math functions in 5.80... I have wanted that feature for years.

Thanks again to those that tried to give me a helping hand.

Buck


Post Reply