Error 500

Hi Everyone,

I’m new here, and also very new to PHP so I’m glad to find such a useful resource as this on the web!
I hope someone can help. I’ve installed a new website (an “off-the-shelf” job) but get an Error 500 when I click links on the site.

My host is 1and1.com and they say there is a problem with the index.php file, but I have no idea what could be wrong. I ran their CGI Output Monitor app on index.php and it gave me this result:

Result:

  • 2 CGI returned nonzero status
    /kunden/homepages/14/d294886850/htdocs/cccg/index.php: line 1: ?php: No such file or directory
    index.php :

/kunden/homepages/14/d294886850/htdocs/cccg/index.php: line 3: //script: No such file or directory
/kunden/homepages/14/d294886850/htdocs/cccg/index.php: line 4: syntax error near unexpected token (' /kunden/homepages/14/d294886850/htdocs/cccg/index.php: line 4: /*$mtime = microtime();’
STDOUT OK STDERR OK

I’ve set permissions to 755 recursively from the root folder and also added:

AddType x-mapp-php5 .php

to all .htaccess files, as the host is still running php4. (1and1’s help system suggested adding that line.)

This is a copy of the index.php file :

<?php //script duration /*$mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $starttime = $mtime;*/ //--- require_once 'php.init.php'; global $root_address, $root_extra, $root_dir, $media_address, $media_dir, $storage_path, $pear_path, $rewrite, $http_mode, $session, $operating_system, $ffmpeg_path, $ffmpeg_command, $flvtool_path, $flvtool_command; //access log logAccess(); //check for restrictions if (accessGranted()) { //check session validity if (param('session_hash')==validateSessionHash('INDEX')) { //check https restriction $http_valid = 1; if ($http_mode == 'https') { if (@$_SERVER['HTTPS'] != 'on') { $http_valid = 0; } } if ($http_valid == 1) { //valid http protocol //referer id from invite link setInviteRefererCookie(); //moneyguru_popup if (!isset($_COOKIE['moneyguru_popup'])) { $smarty->assign('moneyguru_popup', true); setcookie('moneyguru_popup', 'moneyguruskiller', time() + 60 * 60 * 240, '/'); } //request $request = @$rewrite[0]; if ((file_exists("request.$request.php")) || (file_exists($smarty->template_dir . "/request.$request.tpl"))) { //cool request } else { $request = 'home'; } //download should not output anything if ($request == 'download') { include "request.$request.php"; } else { //assign seo details for software pages if ($request == 'software') { $soft_id = intval(after('soft')); $sql = "SELECT * FROM soft WHERE soft_id = '".$soft_id."' LIMIT 1"; $seo_soft = get_select($sql, 1); if ($seo_soft['soft_meta_description'] == '') { $des = explode('.', $seo_soft['soft_description']); $seo_soft['soft_meta_description'] = $des[0]; } if ($seo_soft['soft_meta_keywords'] == '') { $seo_soft['soft_meta_keywords'] = $seo_soft['soft_title']; } $smarty->assign('seo_soft', $seo_soft); } $smarty->assign('request', $request); general_display('index.tpl'); } savesession(); } else { //invalid http protocol - redirect to root redirect($root_address); } } //end check session validity } else { //access not granted - IP restriction echo '
'.stripslashes(param('site_name')).'
is temporarily unavailable
'; } //end check for restrictions //end script duration /*$mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $endtime = $mtime; $totaltime = ($endtime - $starttime); echo " ".round($totaltime, 3)." ";*/ //--- ?>

If anyone can help, or point me in the right direction I would be very grateful, and please let me know if you need more information.

Many thanks,

Mark

Sponsor our Newsletter | Privacy Policy | Terms of Service