The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> 500 Internal Server Error
sanoj96
post Jun 23 2014, 01:51 PM
Post #1


Advanced Member
****

Group: Members
Posts: 109
Joined: 18-September 12
Member No.: 17,803



Hi, i got a few problems with my webserver, and i cant figur out what it can be... as you see in the topic of this post its an 500 Internal Server Error.
i have taken out some information of the logs, so it might get easyer for you guys to help me.

here is the logs:
CODE

xx.xxx.xx.xxx - - [23/Jun/2014:16:06:50 +0400] "GET / HTTP/1.1" 500 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36"
xx.xxx.xx.xxx - - [23/Jun/2014:16:06:50 +0400] "GET /favicon.ico HTTP/1.1" 500 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36"


and here is the website url "http://www.friendilizeit.com/index.php"
Thanks!

This post has been edited by sanoj96: Jun 23 2014, 02:00 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Jun 23 2014, 02:15 PM
Post #2


Programming Fanatic
********

Group: Members
Posts: 1,672
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Where is your code? We need to see that before anyone can help.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
sanoj96
post Jun 23 2014, 03:44 PM
Post #3


Advanced Member
****

Group: Members
Posts: 109
Joined: 18-September 12
Member No.: 17,803



Code to what ? the script ?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
sanoj96
post Jun 23 2014, 03:48 PM
Post #4


Advanced Member
****

Group: Members
Posts: 109
Joined: 18-September 12
Member No.: 17,803



Well if you mean php here is the script

CODE
<?php
session_start();
require_once('./includes/config.php');
require_once('./includes/skins.php');
require_once('./includes/classes.php');
require_once(getLanguage(null, (!empty($_GET['lang']) ? $_GET['lang'] : $_COOKIE['lang']), null));
$db = new mysqli($CONF['host'], $CONF['user'], $CONF['pass'], $CONF['name']);
if ($db->connect_errno) {
    echo "Failed to connect to MySQL: (" . $db->connect_errno . ") " . $db->connect_error;
}
$db->set_charset("utf8");

if(isset($_GET['a']) && isset($action[$_GET['a']])) {
    $page_name = $action[$_GET['a']];
} else {
    $page_name = 'welcome';
}

// Extra class for the content [main and sidebar]
$TMPL['content_class'] = ' content-'.$page_name;

require_once("./sources/{$page_name}.php");

$resultSettings = $db->query(getSettings());
// Added to verify whether the user imported the database or not
if($resultSettings) {
    $settings = $resultSettings->fetch_assoc();
} else {
    echo "Error: ".$db->error;
}

// Store the theme path and theme name into the CONF and TMPL
$TMPL['theme_path'] = $CONF['theme_path'];
$TMPL['theme_name'] = $CONF['theme_name'] = $settings['theme'];
$TMPL['theme_url'] = $CONF['theme_url'] = $CONF['theme_path'].'/'.$CONF['theme_name'];

$TMPL['intervalm'] = $settings['intervalm'];

if(isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
    $loggedIn = new loggedIn();
    $loggedIn->db = $db;
    $loggedIn->url = $CONF['url'];
    $loggedIn->username = (isset($_SESSION['username'])) ? $_SESSION['username'] : $_COOKIE['username'];
    $loggedIn->password = (isset($_SESSION['password'])) ? $_SESSION['password'] : $_COOKIE['password'];
    
    $verify = $loggedIn->verify();
}

if(!empty($verify['username'])) {
    $TMPL['menu'] = menu($verify);
} else {
    $TMPL['menu'] = menu(false);
}

$TMPL['content'] = PageMain();

$TMPL['url'] = $CONF['url'];
$TMPL['footer'] = $settings['title'];
$TMPL['year'] = date('Y');
$TMPL['powered_by'] = 'Version: 1.0.2 (Beta)';
$TMPL['language'] = getLanguage($CONF['url'], null, 1);

$skin = new skin('wrapper');

echo $skin->make();

mysqli_close($db);
?>


and if you mean .htaccess

here is the code

CODE

RewriteEngine on
RewriteCond %{request_filename} -f
RewriteRule ^(.*) $1 [L]
RewriteRule ^(([^/]*)+)(/([^/]{0,32})(/.+)?)?$  index.php?a=$1&q=$3    [L]
php_flag magic_quotes_gpc off
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Jun 23 2014, 04:12 PM
Post #5


Programming Fanatic
********

Group: Members
Posts: 1,672
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Well, I don't do .htaccess so someone else will have to jump in for that. As for the code, I'm talking about all code required for someone to see what is going on regarding your problem (you can attach files to your post).

I see 1 problem right now, your if ($db->connect_errno) only echoes an error message, the rest of the code continues to run even if there is no database connection. Maybe it would be better to put the rest of the code in an else statement, like:
CODE
if ($db->connect_errno) {
   echo "Failed to connect to MySQL: (" . $db->connect_errno . ") " . $db->connect_error;
}
else
{
   the rest of the code to run when a database connection is successful.
}
Also, this line tells me nothing that I can use: '$resultSettings = $db->query(getSettings());'. Where is getSettings(), what does it do?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
sanoj96
post Jun 23 2014, 04:30 PM
Post #6


Advanced Member
****

Group: Members
Posts: 109
Joined: 18-September 12
Member No.: 17,803



The files shuld work fine, becouse it worked on the prev web server i had, but i changed to another one for 2 day ago, but this error "500 inter......" error, so the files shuld work fine!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
sanoj96
post Jun 23 2014, 04:32 PM
Post #7


Advanced Member
****

Group: Members
Posts: 109
Joined: 18-September 12
Member No.: 17,803



Allso every thing happens in a "classes.php" the index file is the file that just echo out every thing...
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
sanoj96
post Jun 23 2014, 04:35 PM
Post #8


Advanced Member
****

Group: Members
Posts: 109
Joined: 18-September 12
Member No.: 17,803



But i added your code, and made some modificatons, but it is still an 500 inter... error...
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Jun 23 2014, 05:00 PM
Post #9


Programming Fanatic
********

Group: Members
Posts: 1,672
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



If all the code worked before then maybe the problem is in the .htaccess file.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
sanoj96
post Jun 23 2014, 05:05 PM
Post #10


Advanced Member
****

Group: Members
Posts: 109
Joined: 18-September 12
Member No.: 17,803



yes, maybe, but i cant figout why... becuse it all worked before...
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Jun 23 2014, 06:55 PM
Post #11


Programming Fanatic
********

Group: Members
Posts: 1,672
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



QUOTE(sanoj96 @ Jun 23 2014, 04:35 PM) *

But i added your code, and made some modificatons, but it is still an 500 inter... error...

BTW, I was only pointing out a logic error in the code. Anyway, you will have to wait until someone that knows about .htaccess rules to help.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
jimlongo
post Jun 23 2014, 09:22 PM
Post #12


This is My Life
*******

Group: Members
Posts: 1,125
Joined: 24-August 06
From: t-dot
Member No.: 16



500 covers a lot of errors, could be file or directory permissions, and don't take that to mean they need to have higher permissions, sometimes it requires lower permissions.
It could be firewall restrictions.

Taking a look at the error logs might give you a hint.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
sanoj96
post Jun 25 2014, 05:44 PM
Post #13


Advanced Member
****

Group: Members
Posts: 109
Joined: 18-September 12
Member No.: 17,803



i have solved the problems! Thanks!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Jun 25 2014, 06:22 PM
Post #14


Programming Fanatic
********

Group: Members
Posts: 1,672
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



And you can't share the answer? Someone else might be helped in the future by this thread.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
sanoj96
post Jul 7 2014, 03:10 PM
Post #15


Advanced Member
****

Group: Members
Posts: 109
Joined: 18-September 12
Member No.: 17,803



The error was file permissions.... haha sorry for that, hehe
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 17th October 2019 - 11:31 PM