Jump to content

Solution: Path is not the same between your browser and you server.


Recommended Posts

Hi all. I'm using PrestaShop 1.1 for the first time at the moment and certainly do not classify myself as a coder!

However, I've been getting this error on the Admin Login page and could not find an easy solution to remove it:

Path is not the same between your browser and you server :



The below solution does not stop the error, but 'hides' it so it does not look unsightly on the login page.
I would first ensure the following and only use this solution if these points are all checked:

1. You can still log in fine and everything else works ok
2. You've entered all subdomains for your site under Tools > Subdomains
3. You've checked your file/folder permissions are all correct


Then, if you are still getting the error it can be hidden by commenting out lines 24, 25, 26 and 27 on login.php (in your admin folder) so it looks like this, with // at the beginning of each line:


// if (strcmp($pathServer, $pathUser))
//    $errors[] = Tools::displayError('Path is not the same between your browser and you server:').'

'.
//                Tools::displayError('- Server:').'
'.htmlentities($pathServer).'

'.
//                Tools::displayError('- Browser:').'
'.htmlentities($pathUser);



If one of the team members can confirm this is ok to do that would be great as I'm quite a novice but it seems to work ok. And sorry if this has been addressed somewhere else, though I've not been able to find an answer in the forums.

PS. I am using clustered/grid based hosting, not sure if this makes a difference or not?

Link to comment
Share on other sites

No problem. Hope it helps people.

I can confirm that this was happening on our installation with no subdomain. The clustered hosting may or may be a factor in this but has caused a few similar issues relating to paths and IP addresses before.

Link to comment
Share on other sites

  • 1 month later...

In my login.php file in admin the lines 24 through to 27 isn't the same as in your example (see below)

{
case 'fr':
$l = array(
'Administration panel' => 'Panneau d\'administration',

as I am getting this error could you point me in the right direction.

Many thanks

Link to comment
Share on other sites

Hi amanuensis.

I'm not too sure what's going on there. I can't see that code anywhere in my version. It is version 1.1 you are using isn't it?

If it helps, the 3 lines immediately above the ones I commented out (lines 21-23) look like this...

// Checking path
$pathServer = ereg_replace('^/', '', $_SERVER['PHP_SELF']);
$pathUser = ereg_replace('^/', '', str_replace($_SERVER['DOCUMENT_ROOT'], '', $_SERVER['SCRIPT_FILENAME']));



In other words, it is the 'Checking path' section you are looking for.

Hope this helps.

Link to comment
Share on other sites

  • 2 months later...
If one of the team members can confirm this is ok to do that would be great

I don't think they would say so. If they wrote these lines of code, they must have had a good reason...

this is not a way to solve the problem !!!!!!!!!!!!!!!!!!!!!!!!!

I agree. Hidding error messages is not a solution at all...
Link to comment
Share on other sites

  • 1 month later...
Il y a 1 erreur

Path is not the same between your browser and you server :

- Server:
adminbonzai/login.php

- Browser:
usr/vhome/b/o/n/bonzaico.com/www/adminbonzai/login.php


how should i do, if like erro that.???
make me crazy.
and how can i do if the sql server is
version()
4.0.27-log

amazing that when i see the phpinfo(), mysql
Client API version    5.0.45


some one can tell me?

Link to comment
Share on other sites

  • 2 months later...

My Database in production server is NOT a set as localhost.

Back Office
Path is not the same between your browser and you server
During the last couple of days I was researching the web looking for the correct answer to this issue, and I couldn’t found it yet. I can use it and I updated the entire site, always with this message every-time that I logged in.

Front Office.
Everything looks ok, until a new user visit the site again an try to log in again, it didn’t work at all.
New user works until the user log out. When this new user become in an existing user this user can not log in again.
I re-install the system around 5 times, and I went over each file and folder permission.

Finally I decide to install the system in another Internet Provider with also Linux Server.
PrestaShop worked GREAT and smooth, everything! No error at all.

What the difference between my real Production Server and the Server that I use as a test is?

The difference is: the test server has DATABASE is SET as a LOCALHOST.

So.

How can I fix the problem on the my real server, where the Path is not the same between your browser and you server is not the same????

In Somewhere, should be able to set those variables.

Thanks.

Link to comment
Share on other sites

  • 3 weeks later...
Hi all. I'm using PrestaShop 1.1 for the first time at the moment and

Then, if you are still getting the error it can be hidden by commenting out lines 24, 25, 26 and 27 on login.php (in your admin folder) so it looks like this, with // at the beginning of each line:


// if (strcmp($pathServer, $pathUser))
//    $errors[] = Tools::displayError('Path is not the same between your browser and you server:').'

'.
//                Tools::displayError('- Server:').'
'.htmlentities($pathServer).'

'.
//                Tools::displayError('- Browser:').'
'.htmlentities($pathUser);



THX,function

Link to comment
Share on other sites

  • 4 weeks later...

Same issue for me!

Error: Path is not the same between your browser and you server :
- Server: admin/login.php
- Browser: custompartyfavor.com/admin/login.php

URL: custompartyfavors.com
Hosting: GoDaddy
- clustered hosting
- /custompartyfavor.com is a folder off of the main root /
- main root account is postal-zipcodes.com

FYI- I installed PS on postal-zipcodes.com and no errors occurred.

I have not found a solution to this issue..
~~~~~~~~~~~~~~~~~~~~
Update: i contacted GoDaddy and confirmed their hosting is setup as an "Alias" hosting account.

Possible Resolution: PS needs a way to during setup (and within Admin) to point PS to the correct folder location on the server. Currently, PS is assuming that it's files are residing at the root. However, in my instance, the files are located within /custompartyfavor.com folder off of the root.

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
  • 1 month later...

Hi,
This problem causes another problems. Be careful. This error message not for fun.
I found a problem when installing language pack to prestashop.
it's causes internal server errror 500. When selected installed language.
I'm feairng its also affect module uploads and other uploads.
Pro's please interest with this error message.


İf you want to hide error, this is more easy:
find and replace this in login.php
if (strcmp($pathServer, $pathServer))
And dont think to change Preferences -> PS directory
--But it's no solve problem.---

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...