Error establishing a database connection

Status
Not open for further replies.

doltrin1

New Member
Messages
9
Reaction score
0
Points
0
Hi to all.i made a stupid mistake.i had just finished my site and i decided to check if i can create a wordpress blog in a sub directory.i used the softaculous and during the installation i forgot to change the install path to the subdirectory so i installed in the directory of my site.so when i type my site adress it directs me to my blog.i erased the database of the wordpress blog i created hoping that when i type my site adress it will directs me right into my site.But i see only a message "Error establishing a database connection"
.Whata can i do so i have access again to my previous site.i can login to my administrator page of the site but i cannot see the site when i type the adress.thanks in advance
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
1. Remove all the files and folders the blog installed. That should leave you with just your original site.
2. Rename .htaccess to .htaccessBAK ... installation software often adds lines to .htaccess. If you know what you are doing, you can edit it.
 

doltrin1

New Member
Messages
9
Reaction score
0
Points
0
Thanks for the fast reply.Ive done that.but nothing changed.i then checked the htaccess file and the index file.both files had diffrent referrences in there.i mean that after the second installation th original index had changed to index2.
i made some changes and now when i type the web adress it says "Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 bytes) in /home/doltrin/public_html/index.php on line 15"
 

doltrin1

New Member
Messages
9
Reaction score
0
Points
0
No i mean that after i installed the blog i saw that index name has changed to index2.i deleted every file including the database of the blog,and now i have only the files of my joomla installation.i can login to my joomla administrator page.i have access to all my files and database through the administrator page.the only thing it doesnt seem to work is the first page when i type the adress of the site.here is the adress if you want to check "http://fsko.x10hosting.com/".
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Where does index.php come from?
What does it do?
What does your .htaccess look like?
 

doltrin1

New Member
Messages
9
Reaction score
0
Points
0
##
# @version $Id: htaccess.txt 10492 2008-07-02 06:38:28Z ircmaxell $
# @package Joomla
# @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##


#####################################################
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations. It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file. If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's. If they work,
# it has been set by your server administrator and you do not need it set here.
#
#####################################################

## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

#
# mod_rewrite in use

RewriteEngine On

########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits

# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root)

# RewriteBase /


########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section



Im not sure now where the index.php come from.i assume its for the first page for my site but im not sure.
Edit:
when i rename the index.php check the previous site what happens
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
.htaccess looks like the normal Joomla stuff.

Clicking on indexbak.php now produces an error because it tries to include index.php...which has been renamed. That might have been the out of memory problem...it includes itself, which include itself, etc until it runs out of memory.

does the file look like:

PHP:
<?php
/**
* @version		$Id: index2.php 11407 2009-01-09 17:23:42Z willebil $
* @package		Joomla
* @copyright	Copyright (C) 2005 - 2009 Open Source Matters. All rights reserved.
* @license		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.
*/

$_REQUEST['tmpl'] = 'component';
include('index.php');

If it does, rename it index2.php I have attached a zipped copy of index.php from a fresh Joomla install. Upload, unzip, and see if that helps.
 

Attachments

  • index.php.zip
    1 KB · Views: 17
Last edited:

doltrin1

New Member
Messages
9
Reaction score
0
Points
0
Excellent.Thanks a lot.yes you were right.eventhough i changed some things in the index file it didnt work.i rename the index file i upload the fresh copy and the first page appeared again.
Thanks a lot again.:fruit:
 
Status
Not open for further replies.
Top