Jump to content

[SOLVED] Error on registration (blank page)


Recommended Posts

Hi,

Firstly, thanks to the PrestaShop team for this great piece of software! I've had fun setting it up and I'm continually impressed by the features and general slickness.

I have run into a problem I'm not confident about fixing though.

I recently switched hosts due to needing SSL, however SSL is not the problem. When user details are entered into the customer registration screen and the "Register" button clicked, we are presented with a blank page. As per someone else's thread, I switched on error reporting in the config file and tried again. The error I get is:-

Warning: require_once(/home/mydir/public_html/tools/swift/Swift/../Swift/Plugin/Decorator/Replacements.php) [function.require-once]: failed to open stream: No such file or directory in /home/mydir/public_html/tools/swift/Swift/ClassLoader.php on line 35

Fatal error: require_once() [function.require]: Failed opening required '/home/mydir/public_html/tools/swift/Swift/../Swift/Plugin/Decorator/Replacements.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mydir/public_html/tools/swift/Swift/ClassLoader.php on line 35


The problem here is that "/home/mydir/public_html/tools/swift/Swift/../Swift/Plugin/Decorator/Replacements.php" should be "/home/mydir/public_html/tools/swift/Swift/Plugin/Decorator/Replacements.php". Notice the extra "/../Swift" in the incorrect path?

Investigating further, I opened up the ClassLoader.php file to check out line 35:

require_once SWIFT_ABS_PATH . "/" . str_replace("_", "/", $name) . ".php";



This didn't clear things up so I looked up "SWIFT_ABS_PATH" and found that line 11 had defined it:

if (!defined("SWIFT_ABS_PATH")) define("SWIFT_ABS_PATH", dirname(__FILE__) . "/..");



It appears that it adds the "/.." part at this point. Why, I don't know. I am also not clear how the extra "/Swift" is being added either.



I did a search for this problem on this forum and I found someone else with the same issue here. However, they were able to fix this by creating the directory structure referenced. I can't do this and so I believe I'm left with having to change the code.



If anyone can help me I would greatly appreciate it and please be gentle with your replies! Logical thinking got me this far but I have no experience with php!


Thanks in advance,

Chris



PS. I would post a link to my shop for testing purposes, but I am not sure if it would be appropriate. Whilst my shop doesn't sell or display pornography, it does sell adult products.

Link to comment
Share on other sites

I've just read back my original post, I know it's a bit big but if someone could help me it would be most appreciated. After my shop has been down for several days whilst I switch hosts I'm desperate to get it live again.

As an update, I had a quick fiddle with ClassLoader.php and took out the part that added the "/.." to the path. It now looks like this:

if (!defined("SWIFT_ABS_PATH")) define("SWIFT_ABS_PATH", dirname(__FILE__));



However, it hasn't fixed the problem as "/Swift" is still being added to the file name. I'm guessing it's coming from the "$name" referenced in line 35 quoted in my original post.

Please help! :)

Link to comment
Share on other sites

Well I've managed to get rid of the registration error through brute force. I reinstalled Prestashop as per the upgrade instructions in the Prestashop WIKI. I'm putting it down to the transferring of hosts. Whether something got corrupted along the way or server differences caused it I don't know.

Not the most elegant of solutions; I would have preferred to have tackled the problem at the source, but I suppose I no longer have the issue so I'll put [sOLVED] in the title.

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