Jump to content

Having problem installing (error)


Recommended Posts

Hi,

I've been trying to install Prestashop for 3 days now with a friend but am stuck at one of the final steps. Before giving the error message I would like to state that I know virtually NOTHING about computer science, code, etc. (my friend does but even he is stuck hence why I am here) but chose Prestashop simply because I've used OSCommerce before on another website and want to try something different.

Anyway, this is the message I am receiving (I am past the CHMOD 777 stage and used file manager on my GoDaddy hosting control panel since I am using a Windows Hosting Plan if that helps):

Error while inserting data into the database:
'CREATE TABLE `ps_access` ( `id_profile` int(10) unsigned NOT NULL,
`id_tab` int(10) unsigned NOT NULL, `view` int(11) NOT NULL, `add`
int(11) NOT NULL, `edit` int(11) NOT NULL, `delete` int(11) NOT NULL,
PRIMARY KEY (`id_profile`,`id_tab`) ) ENGINE=MyISAM DEFAULT
CHARSET=utf8'
CREATE command denied to user \'Bizhan\'@\'188.121.41.103\' for table
\'ps_access\'(Error: : 1142)

My friend and I are both stuck and cannot progress any further. Can
you please help? I looked on this website for a solution for the past 48 hours but don't believe I've found the right one.

Any help would be greatly appreciated and I thank you profusely in advance.

Link to comment
Share on other sites

Hi again,

I've managed to successfully install Prestashop finally (YAY!). I have to admit that considering I know nothing about FTP, etc. it was pretty straightforward, albeit with a few mistakes in the process (which were eventually noted and fixed).

However I now have two problems:

1. I went to my front office but I don't see anything Prestshop-related (I still have the default Website coming soon page). What did I do wrong here or have I missed a step?

2. I went to my back office only for it to say:

There is 1 error

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

- Server:
admin/login.php

- Browser:
\admin\login.php


I'm sure this is a simple fix but would appreciate it if someone could point me where to go to make these changes (and what to do). (Note: I have since deleted my install folder and renamed admin to something else but that hasn'tl changed the / problem).

Thank you again, I appreciate everyone on this forum helping each other out.

Link to comment
Share on other sites

Any chance you have a "index.html" file in the same directory as Prestashop? Try calling the index page directly:

index.php

There is an order in which default index files are loaded by the webserver if you leave off the filename in the URL so the first one in the list is what you will see if you do not explicitly ask for a given file.

As to your second issue, not sure I understand the error but from the looks it is complaining about Windows style paths versus UNIX style paths. Any chance you entered in backslashes somewhere during the configuration process when you should have been entering forward slashes?

Cheers

Link to comment
Share on other sites

Hi,

I'll have to check with regards to index.html, you may be right and will let you know as soon as I find out (which'll be tomorrow since I need a break from the computer after so many hours trying to install).

With regards to Windows and UNIX, I was using Windows shared hosting as opposed to Linux. Will this be a big problem?

Thank you for everything, I greatly appreciate your reply as the possible solutions to this problem have eased my mind somewhat.

Link to comment
Share on other sites

I'm a bad guy to ask about that as I would normally say that a Windows host is *always* a bad choice.

=)

In any case, the problem is at the top of "./admin/login.php":

// Checking path
$pathServer = preg_replace('!^/!', '', $_SERVER['PHP_SELF']);
$pathUser = preg_replace('!^/!', '', str_replace($_SERVER['DOCUMENT_ROOT'], '', $_SERVER['SCRIPT_FILENAME']));
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);

What it is saying is that $_SERVER['PHP_SELF'] != $_SERVER['SCRIPT_FILENAME'] with the local filesystem path stripped off. What I am not immediately sure about is why this test is being done and what would go wrong if you disabled this check. Also, I do not see why these two values would necessarily be the same value in all cases since it depends somewhat on how the script is called and server configuration.

You should try searching the bug database and or the changelog file for "SCRIPT_FILENAME" maybe to see if it shows up when / why this check was added. You could always comment it out but until it is known why this is here it is best to leave it as is until you can be sure that removing it does not introduce a security issue somewhere.

My guess is that this is here to try to limit XSS attacks or something similar. . .I do wish it was better commented as I believe that the error shown is not correct.

Cheers

Link to comment
Share on other sites

Hi again,

Where did you get that code from? When I went back to my site the front office was up although I hadn't made any changes (I guess I just needed to wait). I am however now getting the very annoying problem of not being able to make changes in the back office. For example changing the Paypal e-mail address from [email protected] to my own account doesn't work (I click on update settings and am taken to the homepage of my back office) and changing the settings of the customer loyalty module then clicking on save once again takes me to the homepage of the back office. In fact anything I try to change takes me to the homepage of the back office with no actual change taking place. How do I fix this because I've spent the last half hour trying to implement changes that won't be implemented.

Link to comment
Share on other sites

Could be a Javascript related issue - any chance you have NoScript (for Firefox) or similar plugin running in your browser?

The behaviour you describe makes it sound like whatever arguments need to be passed back to the server are either missing or not getting parsed properly. That could be caused by any number of things - web server configuration, your browser, bad Prestashop settings, etc.

Without being able to see the example in action it is pretty hard to say for sure in your case.

Do any of the control panel settings function as expected or does every form lead back to the start page? If every form does then my guess is that you are running into something related to the initial path issue you were having - Prestashop is trying to sort out what page you want but after sanity checking you are left with the default index file instead of whatever specific action you wanted.

If it is being caused by the Windows "\" path separator then you could clean that up at the start of the script with a search and replace. But before you do anything like that I would search the forum for stuff related to running Prestashop under Windows since this has no doubt been encountered by others if that is the case.

Cheers

Link to comment
Share on other sites

I've been examining everything and am stumped - everything else works, the installation was correct, but I cannot change the modules and without the ability to even state where Paypal payments go to all my hard work has gone to waste - which makes this my worst day of the year since I also spent the past 8 hours looking for a CD which appears to have vanished.

The example in action is pretty simple - I click on modules then under "customer loyalty and rewards" click configure. I then change the numbers (e.g. instead of £10 = 1 reward point I set it to £1) and then click save. I am then redirected to the start page.

Link to comment
Share on other sites

Where you are in the control panel is handled by a value passed in the URI called "tab". This value gets parsed into a top level variable $tab in 'admin/init.php' and this then loads a handler to deal with that. The paypal module gets accessed with something like this:

admin/index.php?tab=AdminModules&configure=paypal&token=ab4ab3aba3ba3ba3ba3

If you can load the initial edit PayPal settings page then on the surface it looks like you should be able to edit it as well since the process should be the same as other pages that edit things. The only extra issue I see is that there is chance the path gets parsed out differently when working with modules.

I would start by viewing the source for the above page and see what the form action is does it have the full path or is the path different than what shows in the browser's address bar?

You could also try adding a debug statement to 'admin/init.php' to spit out the $tab value in a comment to try to see if at least that is getting parsed properly when you do a POST.

Cheers

Link to comment
Share on other sites

To be honest I have no idea what any of what you said means (I'm basic when it comes to computers) but I did go to admin/index.php?tab=AdminModules&configure=paypal&token=ab4ab3aba3ba3ba3ba3 (obviously replacing admin with what I renamed it as) only to receive the error: " Invalid security token

Does this shed any light on the matter?

By the way I want to thank you profusely for all the help you are giving me, it really means a lot.

EDITED TO ADD: Would showing the page source on the customer loyalty module page help in any way?

Link to comment
Share on other sites

Sorry hollerme, troubleshooting this one is probably going to require at least some basic HTML knowledge.
When you submit a form there are two methods used - POST and GET. GET works the same way as when you click on a regular link - all the details are in the link itself. We know that GET is working for you as you are able to load the initial PayPal module page and that is via a link in the control panel.

What it seems like is happening is that when you hit submit after changing the PayPal details, not all of the form data is making it back to Prestashop which is why you are likely ending up on the start page again. The PayPal settings form submission is via a POST. Ky working theory is that variables are not getting passed properly via POST, at least when working with modules.

The form action will likely look something like this on the default PayPal module page if you view the HTML source (there is an option in your web browser for this):

<form action="admin/index.php?tab=AdminModules&configure=paypal&token=ab4ab3aba3ba3ba3ba3" method="post" [...]

If the stuff in the action attribute between the quotes does not look the same as the stuff in the address bar then that may be the problem. If they are identical then I am not sure what is going on. With trying being able to add debugging statements it is going to be pretty hard to guess what the problem is here.

As an aside what version of PHP is your server running?

Cheers

Link to comment
Share on other sites

The only form action lines I see on the actual Paypal module page are:

<form action="index.php?tab=AdminSearch&token=10668eafcde4601406c9054dd33b9c4f" method="post">

and


<form action="/admin/index.php" method="post" style="clear: both;">


On the main module page I see the following:

<form action="/basterd1/index.php?tab=AdminModules&token=29ed4d326da7fda1681abfe8d60ac9cc" method="post">

<form action="index.php?tab=AdminSearch&token=10668eafcde4601406c9054dd33b9c4f" method="post">

<form action="/basterd1/index.php?tab=AdminModules&token=29ed4d326da7fda1681abfe8d60ac9cc" method="post" enctype="multipart/form-data">






I am currently using PHP 5.2.5.

Link to comment
Share on other sites

Using the online demo I am going logging into the admin control panel and then clicking "Payment".

http://www.prestashop.com/demo/demo/index.php

On that tab I am clicking "Configure" for the module "PayPal 1.6". On the next page I am presented with a form that lets me customize PayPal settings. The form action for that specific form on the page looks like:

<form action="/demo/demo/index.php?tab=AdminModules&configure=paypal&token=blahblahblah" method="post" style="clear: both;">

If you are using the same module, you should be seeing the above (with a different token of course) in the HTML source. If you are using a different module, it should have something different for the configure argument but it should follow that format.

If you are missing the "configure=paypal" part then Prestashop will not know you are wanting to edit the PayPal module since that is how it tells what module you are changing. Are you sure that you are actually getting to the point of editing the module details? It sounds more like you are at the modules listing page and then not actually choosing a module to configure.

Cheers

Link to comment
Share on other sites

On the Prestashop demo I see:

<form action="index.php?tab=AdminSearch&token=094b1f6d2743b6939b1a38c9bb3b2fae" method="post"

and the one you were speaking of:

<form action="/demo/demo/index.php?tab=AdminModules&configure=paypal&token=6bd75b530da7187d8ebede1164a1086e" method="post" style="clear: both;">


On my own back office I see:

<form action="index.php?tab=AdminSearch&token=10668eafcde4601406c9054dd33b9c4f" method="post">

and

<form action="/admin/index.php" method="post" style="clear: both;">


which appears to be a problem, since the latter looks nothing like the code you showed.


I just now also spoke to my hosting provider and was told my IIS Windows hosting account was compatible with Prestashop so there was no need to switch to Linux (and if I did I would forfeit a month's payment even though I only joined at the end of last week) so the problem was definitely software-related, and any help you can give me to fix this problem would be very, very much appreciated.

Link to comment
Share on other sites

Ok. Looking at a few of the modules, the configuration process relies on the environment variable 'REQUEST_URI' including all GET style arguments passed by the browser. The actual PHP code looks like this:

<form action="'.$_SERVER['REQUEST_URI'].'" method="post">

Assuming the original link had these details in it:

http://www.prestashop.com/demo/demo/index.php?tab=AdminModules&configure=paypal&token;=[token here]

You should see the following in the resulting form on the edit page:

<form action=”/demo/demo/index.php?tab=AdminModules&configure=paypal&token;=[token here]” method=“post” style=“clear: both;”>

If you look at your local module page, do the "Configure" links include all of the above arguments? If the initial link is fine but the subsequent form is missing stuff then it sounds to me like something is funny with your hosts' configuration and how it deals with environment variables (a way that some information is made available to PHP).

Try creating a script called "tester.php" or similar. In it add this:

<?php phpinfo(); ?>

Access the script like this:

tester.php?foo=bar&bar=foo

On the resulting page, do a search for "REQUEST_URI" and see what is there. If it only shows the filename then the problem is that on your host REQUEST_URI is not including variables passed via GET. You should also try a test like this:

<form method="post" action="tester.php?foo=bar&bar=foo">
<input type="submit" value="test GET versus POST" />
</form>

This will emulate how Prestashop gets your data back (a POST with variables also sent via the URI).

If this is the only thing that is wrong, a workaround would be to add a small code snippet to config/config.inc.php to fix up REQUEST_URI so that the GET string is actually in there.

Cheers

Link to comment
Share on other sites

Okay, I have Prestashop now. GoDaddy are useless and I switched hosting providers - voila! It installed without a hitch.

I have a question that is off-topic though (but still related to sites). I'm using cPanel to try to generate an SSL certificate signing request (I have an SSL bought from GoDaddy (!) but need to move it to my new server. The instructions state that I need to state the domain name but I don't see it listed in the form which are:

Generate a New Certificate Signing Request

Host: No Keys Exist
Country
State
City
Company
Company Division
Email
Pass Phrase



How can I specify the domain it is for if there is no field for me to say it? Or am I doing something wrong?

Link to comment
Share on other sites

Very much off topic. That said. . .

Host is what you want but from the way it looks in your paste, it seems like cPanel is expecting you to choose the domain from a select list. So the "no keys exist" means that you probably have to add the domain first somewhere else for it to appear in that list.

http://twiki.cpanel.net/twiki/bin/view/AllDocumentation/CpanelDocs/SslTlsManager#Generate_a_New_Key

Cheers

Link to comment
Share on other sites

  • 3 weeks later...

codegrunt,

"If this is the only thing that is wrong, a workaround would be to add a small code snippet to config/config.inc.php to fix up REQUEST_URI so that the GET string is actually in there. "

I have the exact same problem with the paypal module.
Here is the result from 'tester.php':

_SERVER["REQUEST_URI"] /shopping/tester.php

The paypal module form's POST method only goes to <form action="/shopping/admin1955/index.php" method="post" style="clear: both;">

How exactly should I change the config/config.inc.php to help fix this problem?

Any help would be great, thanks

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...