Support

Akeeba Backup for Joomla!

#9183 admin cant access to backend after restore in other directory

Posted in ‘Akeeba Backup for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Akeeba Backup version
n/a

Latest post by nicholas on Saturday, 03 December 2011 05:25 CST

user51972
Mandatory information about my setup:

Have I read the related troubleshooter articles above before posting (which pages?)? Yes a few of them
Have I searched the forum before posting? Yes, I have learnt a lot
Have I read the documentation before posting ? Yes
Joomla! version: 1.7.3
PHP version: PHP Version 5.2.9-1.illimite (but with the help of line
AddType application/x-httpd-php5 .php
in htaccess file domain root directory
MySQL version: 5.1.41
Host: (optional, but it helps us help you) online.net
Akeeba Backup version: Core 3.3.7

EXTREMELY IMPORTANT: Please attach your Akeeba Backup log file in order for us to help you with any backup or restoration issue.
Sorry, but Where can I find it ?

Description of my issue: (sorry for my poor englisg)

I build a new version of site in a subdirectory of the domain, with the idea to move it to the main domain directory when it is ready. After reading, I know it's not a good idea.

I used Akeeba to backup the whole Joomla site once built and kickstart to restore to the main domain directory.
After a few .htaccess file problem, I discover (one of yours posts) it was a bad idea to restore from subdirectory to directory in same domain. It sounds bad, exactly what i tried....

I restore using kickstart the same archive to another small host (gandi.net). Every thing is perfect, front-end and back-end. So I used akeeba to make a new backup from the site restored on gandi hosting. And tried to restore this new backup to my main domain. it was better now, front-end seems to run ok.

But when I try to log in backend I get a error message :
JPath::check Snooping out of bounds @ /administrator/components/com_login/views
(cf. attached file)

nicholas
Akeeba Staff
Manager
This error message is a little odd. It actually means that your host is reporting the wrong filesystem path to your site. It tells your site that the path to the site's root is / (the filesystem root) which is, of course, wrong. I've seen that problem again and it was a problem with the host's setup. Even if you try installing a fresh Joomla! installation (new, blank site) you will receive the same problem. Do you have any other Joomla! 1.7 site on that host?

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user51972
Thank you for your so quick answer.

In fact, I have not any other J1.7 running site on the host. I just build the whole J1.7 site in a subdirectory of the domain on this host (to renew a static website). I began this to let the client having a look at developpement and for collaborating work.

Trying to restore the site in different ways (kickstart, or file by file). I erase the subdirectory.

When I started Joomla was 1.6, and soon it became 1.7, etc.

The site was running perfectly

nicholas
Akeeba Staff
Manager
There is an easy way to see if the problem is with the host or with the site. Try restoring it on a local host. Instructions for setting up a local host can be found at https://www.akeebabackup.com/documentation/quick-start-guide/restoring-backups.html#preparing-a-local-server

Before doing that, you may want to try renaming the .htaccess file on the root of your site and/or any php.ini file you may have in your site's root in your administrator directory. These files can contain directives which cause the server to report the wrong path to Joomla! and trigger this problem.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user51972
After a first attempt with no success, I restored to another host (not local) and everything was ok.
Then I made a backup of this site (on another host) and tried to restore to my domain.

I'm gonna try to a local host.

I know very little about htaccess file. You say I " may want to try renaming the htaccess file'... should I ?

There is only one .htaccess file (one line to handle php5) and there is no php.ini (hosting don't give access to them, it seems)

when the J1.7 was running in subdirectory of my domain, there was : a htaccess file in root directory to made php running (advise from hosting)
and a htaccess file in the directory of J1.7 to turn on SEF url.


nicholas
Akeeba Staff
Manager
Since your site did restore correctly to a different host I think that my original hunch was correct: you have a host issue. This means that your site will not work on gandi.net but it will work on the other hosting provider you developed it on and the one you last tried to restore it (and it worked).

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user51972
Hi Nicolas and thank you for your quick answers.

I' m afraid that's not so simple. Maybe I have not expressed me correctly or in a comprehensive way. My english is poor.

I first developed in a subdirectory. site was found there : domain.fr/subdirectory/ (on a hosting company called Online)

Then I tried to restore to domain.fr/ on same host. It was terrible. I read many posts here. I learned it was a bad idea to restore from subdirectory to directory.

So I try to restore my backup archive to another host. It works perfectly on gandi.
Then I made a new backup from this restored working site on Gandi

And, last step, I tried to restore this backup archive to domain.fr/ on Online.
It works better, but no access to backend when I log in. I get a bizarre error message (cf. file added)

As I developed on Online, it was working on Online with J1.7.
What's wrong ?

Thanks for your help

nicholas
Akeeba Staff
Manager
Not being able to log in to the back-end after restoration is a very common mistake with Joomla! 1.6/1.7 and later versions. What you probably not remember is that you modified the cookie setup parameters in your site's Global Configuration page. The thing is, if you modify the cookie domain name and/or path, it's very likely that you will no longer be able to log in to your site if the domain name, subdomain or directory changes - exactly what happens when you restore a site to anywhere except its original location! Luckily, the workaround is very simple.

Please edit the configuration.php file in the root of your site and find the lines starting with public $cookie_domain and public $cookie_path. Modify them so that they read:
public $cookie_domain = '';
public $cookie_path = '';

Note: Instead of public it may read var, but it's the same thing.

Also, check the live_set parameter on the same file. Normally, it should read something like
public $live_site='';
or
public $live_site='http://www.example.com';
where www.example.com is your domain name (with www –if you're using www in your login URL– but without a slash at the end!). I suggest trying an empty live_site parameter first, i.e.
public $live_site='';


Save the file, clear your browser's cookies and cache, quit and restart your browser and try logging in to your site. You should be able to login without any problem now.

Another thing that you should be aware of is that the same problem could be caused by your .htaccess file. It's always a good idea to at least temporarily rename .htaccess to something else (e.g. htaccess.bak) when you're trying to troubleshoot a login issue. A .htaccess file may define redirections which get in the way during login.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user51972
Hello,
I don't understand your last answer (What you probably not remember is that you modified the cookie setup parameters in your site's Global Configuration page).

But I followed strictly your advises concerning $cookie_domain and son on.

Everything was fine as it should be.

I still can't access to the administrator page of my site.

When I try to go to mydomain.fr/administrator or mydomain.fr/administrator/index.php : I still get that weird error message I sent in attached file.

I may have express unprecisely : my problem is not that I can't login, but I can't access to the admin login page.

When I try to modify configuration.php (as you advise in last answer) I set once public $live_site to public $live_site='http://www.mydomain.fr';
Then when I try to access to admin page, browser downloads a file without name (unknown) with a few html lines (see attached file).

I'm not very happy with the idea of re-building from scratch the site because restoration doesn't work properly.

What can I do ? What are my options ?

nicholas
Akeeba Staff
Manager
Even though this sounds like an issue with a third party plugin and not anything I have written, I may still be able to help you. I will need you to send me a Personal Message with the following information:
- The URL of this thread so that I know what you're talking about
- The URL to your site's administrator page (for the RESTORED site)
- FTP connection information for the restored site
- Super Administrator username and password
so that I can take a look.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

nicholas
Akeeba Staff
Manager
Thank you for your PM and the FTP access! I was able to verify what I fear. Joomla! can not work on the root of your site. It can only work in subdirectory.

You don't have to believe me. Try to install a fresh copy of Joomla! 1.7.3 on your site's root. As you will see, it will fail miserably. Akeeba Backup simply has nothing to do with this issue which is caused by Joomla!'s core code.

Technical explanation: your host makes the domain's root appear as the filesystem root, i.e. an empty string. However, Joomla!'s internal path checker (JPath::clean) can not work under these circumstances. In fact, when called to operate under such an environment, it thinks that you are a hacker trying to snoop outside the site's root. When you are developing your site in a subdirectory Joomla! has no problem, because the site's root is a non-empty string equal to the name of your subdirectory.

What I can do: I will try to find some time to submit a bug report and a patch to the Joomla! Platform project. Don't hold your breath, though, the solution –if accepted– may not even make it to Joomla! 2.5, given the very tight schedule. By the way, that issue was a nice catch! Too bad it means that your site doesn't work on the root of your domain. If someone else had reported that on the Joomla! forum the last 11 months this bug exists, we (I mean, the community of Joomla! developers) would have solved it much earlier. Well, better late than never.

What you can do: There are to alternatives.

1. Install your site in a subdirectory. This is the quick'n'dirty approach. Install the site in a subdirectory and simply create a .htaccess or a landing page on the domain's root.

2. Use a different hosting provider (recommended). I would suggest using a Joomla!-optimised host like iRedHost, CloudAccess.net or Rochen.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user51972
Ok, not really good news...

I'd like to thank you for your invaluable help.

nicholas
Akeeba Staff
Manager
The only good news is that I made the pull request to the Joomla! Platform and it was accepted, so at least Joomla! 2.5 should have this fixed. Meanwhile, you only have the two choices I mentioned :(

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!