# Solved: HTTP 403 please help



## caroleanneh (Sep 8, 2007)

I just inherited a website that uses Joomla as a content management program in 
connection with MySQL database.

I had to go into MySQL to reset the Joomla super password. The reset process was successful, but now when I go to the site (www.paulcraver.com) and login via the Administrator link, the following HTTP 403 error appears:

Warning: main(/mnt/web_w/d21/s06/b017b7f7/www/administrator/components/com_admin/admin.admin.php) [function.main]: failed to open stream: No such file or directory in /mnt/w0303/d21/s06/b017b7f7/www/administrator/index2.php on line 62

Fatal error: main() [function.require]: Failed opening required '/mnt/web_w/d21/s06/b017b7f7/www/administrator/components/com_admin/admin.admin.php' (include_path='.:/usr/local/nf/lib/php') in /mnt/w0303/d21/s06/b017b7f7/www/administrator/index2.php on line 62

What do I need to do?


----------



## Sequal7 (Apr 15, 2001)

Open administrator/index2.php in notepad and count to line 62 and post what it has, more than likely a bad password, directory or file reference.


----------



## caroleanneh (Sep 8, 2007)

I'm sorry; As I've counted, there doesn't seem to be a password in line 62. Would you take a look at the entire code? Thanks so much...

<?php
/**
* @version $Id: index2.php 2509 2006-02-21 04:37:29Z stingrey $
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// Set flag that this is a parent file
define( '_VALID_MOS', 1 );

if (!file_exists( '../configuration.php' )) {
header( 'Location: ../installation/index.php' );
exit();
}

require_once( '../globals.php' );
require_once( '../configuration.php' );
require_once( $mosConfig_absolute_path . '/includes/joomla.php' );
include_once( $mosConfig_absolute_path . '/language/'. $mosConfig_lang .'.php' );
require_once( $mosConfig_absolute_path . '/administrator/includes/admin.php' );

// must start the session before we create the mainframe object
session_name( md5( $mosConfig_live_site ) );
session_start();

$option = strtolower( mosGetParam( $_REQUEST, 'option', '' ) );

// mainframe is an API workhorse, lots of 'core' interaction routines
$mainframe = new mosMainFrame( $database, $option, '..', true );

// admin session handling
$my = $mainframe->initSessionAdmin( $option );

// initialise some common request directives
$task = mosGetParam( $_REQUEST, 'task', '' );
$act = strtolower( mosGetParam( $_REQUEST, 'act', '' ) );
$section = mosGetParam( $_REQUEST, 'section', '' );
$no_html = strtolower( mosGetParam( $_REQUEST, 'no_html', '' ) );
$id = intval( mosGetParam( $_REQUEST, 'id' ) );

$cur_template = $mainframe->getTemplate();

// default admin homepage
if ($option == '') {
$option = 'com_admin';
}

// set for overlib check
$mainframe->set( 'loadOverlib', false );

// precapture the output of the component
require_once( $mosConfig_absolute_path . '/editor/editor.php' );

ob_start();
if ($path = $mainframe->getPath( 'admin' )) {
require_once ( $path );
} else {
?>









<?php
}

$_MOS_OPTION['buffer'] = ob_get_contents();
ob_end_clean();

initGzip();

// start the html output
if ($no_html == 0) {
// loads template file
if ( !file_exists( $mosConfig_absolute_path .'/administrator/templates/'. $cur_template .'/index.php' ) ) {
echo 'TEMPLATE '. $cur_template .' NOT FOUND' ;
} else {
require_once( $mosConfig_absolute_path .'/administrator/templates/'. $cur_template .'/index.php' );
}
} else {
mosMainBody_Admin();
}

// displays queries performed for page
if ($mosConfig_debug) {
echo $database->_ticker . ' queries executed';
echo '';
foreach ($database->_log as $k=>$sql) {
echo $k+1 . "\n" . $sql . '

';
}
}

doGzip();
?>


----------



## treydx (Jan 4, 2006)

if ($path = $mainframe->getPath( 'admin' )) {
require_once ( $path );
}

$path is set, not tested for equality, is it supposed to do that??


----------



## caroleanneh (Sep 8, 2007)

No, I don't think it's supposed to... Whatv should I do to correct it?


----------



## Sequal7 (Apr 15, 2001)

You need to specify the path...this may be in any one of these files;

```
require_once( '../globals.php' );
require_once( '../configuration.php' );
require_once( $mosConfig_absolute_path . '/includes/joomla.php' );
include_once( $mosConfig_absolute_path . '/language/'. $mosConfig_lang .'.php' );
require_once( $mosConfig_absolute_path . '/administrator/includes/admin.php' );
```
I assume this a joomla setting, have you changed any of the code?


----------



## caroleanneh (Sep 8, 2007)

Yes, it's a Joomla code...but no, I haven't modified it. I'm new at Joomla (in case you haven't noticed ). Where in the code do I need to specifiy a path? And should the path be specified as index2.php?

Thanks.


----------



## caroleanneh (Sep 8, 2007)

OK, I'm sorry...like I said, I'm new with this. I commented out the code. Instead of the firstmessage, now I get this one on login:

Fatal error: Call to undefined function: mosgetparam() in /mnt/w0303/d21/s06/b017b7f7/www/administrator/index2.php on line 27

I'm including the new code below:

<?php
/**
* @version $Id: index2.php 2509 2006-02-21 04:37:29Z stingrey $
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// Set flag that this is a parent file
define( '_VALID_MOS', 1 );

if (!file_exists( '../configuration.php' )) {
header( 'Location: ../installation/index.php' );
exit();
}
//require_once ( $path );

// must start the session before we create the mainframe object
session_name( md5( $mosConfig_live_site ) );
session_start();

$option = strtolower( mosGetParam( $_REQUEST, 'option', '' ) );

// mainframe is an API workhorse, lots of 'core' interaction routines
$mainframe = new mosMainFrame( $database, $option, '..', true );

// admin session handling
$my = $mainframe->initSessionAdmin( $option );

// initialise some common request directives
$task = mosGetParam( $_REQUEST, 'task', '' );
$act = strtolower( mosGetParam( $_REQUEST, 'act', '' ) );
$section = mosGetParam( $_REQUEST, 'section', '' );
$no_html = strtolower( mosGetParam( $_REQUEST, 'no_html', '' ) );
$id = intval( mosGetParam( $_REQUEST, 'id' ) );

$cur_template = $mainframe->getTemplate();

// default admin homepage
if ($option == '') {
$option = 'com_admin';
}

// set for overlib check
$mainframe->set( 'loadOverlib', false );

// precapture the output of the component
require_once( $mosConfig_absolute_path . '/editor/editor.php' );

ob_start();
if ($path = $mainframe->getPath( 'admin' )) {
require_once ( $path );
} else {
?>









<?php
}

$_MOS_OPTION['buffer'] = ob_get_contents();
ob_end_clean();

initGzip();

// start the html output
if ($no_html == 0) {
// loads template file
if ( !file_exists( $mosConfig_absolute_path .'/administrator/templates/'. $cur_template .'/index.php' ) ) {
echo 'TEMPLATE '. $cur_template .' NOT FOUND' ;
} else {
require_once( $mosConfig_absolute_path .'/administrator/templates/'. $cur_template .'/index.php' );
}
} else {
mosMainBody_Admin();
}

// displays queries performed for page
if ($mosConfig_debug) {
echo $database->_ticker . ' queries executed';
echo '';
foreach ($database->_log as $k=>$sql) {
echo $k+1 . "\n" . $sql . '

';
}
}

doGzip();
?>


----------



## Sequal7 (Apr 15, 2001)

Hi, glad you got it working.

Could you post your solution?


----------

