Jump to content

Fatal error after transfer to new server


Recommended Posts

I have just transferred a ps-store to a VPS environment. First I did receive just blank pages both front and back office, so I turned on error reporting. I am now receiving the following:

 

Fatal error: Uncaught exception 'SmartyException' with message 'unable to write file /var/www/byggbutik/cache/smarty/compile/f9/ac/41/wrt52ad933d5a3eb8.27519117' in /var/www/byggbutik/tools/smarty/sysplugins/smarty_internal_write_file.php:44 Stack trace: #0 /var/www/byggbutik/tools/smarty/sysplugins/smarty_internal_template.php(201): Smarty_Internal_Write_File::writeFile('/var/www/byggbu...', 'compileTemplateSource() #2 /var/www/byggbutik/classes/module/Module.php(1623): Smarty_Internal_TemplateBase->fetch() #3 /var/www/byggbutik/modules/blocksearch/blocksearch.php(99): ModuleCore->display('/var/www/byggbu...', 'blocksearch-top...', 'blocksearch-top...') #4 /var/www/byggbutik/classes/Hook.php(423): BlockSearch->hookTop(Array) #5 /var/www/byggbutik/classes/controller/FrontController.php(426): HookCore::exec('displayTop') #6 /var/www/byggbutik/controllers/front/IndexController.p in /var/www/byggbutik/tools/smarty/sysplugins/smarty_internal_write_file.php on line 44

 

Is this a permission related problem? I have no idea about how to solve this so any help would be greatly appreciated!

 

 

Link to comment
Share on other sites

I've changed accordingly and now getting the following at front:

 

Warning: mkdir(): Permission denied in /var/www/byggbutik/modules/loffullslider/loffullslider.php on line 150 Fatal error: Uncaught exception 'RuntimeException' with message 'File not writeable: /var/www/byggbutik/cache/cachefs/loffullslider/940_383_head1.jpg' in /var/www/byggbutik/modules/loffullslider/libs/phpthumb/GdThumb.inc.php:662 Stack trace: #0 /var/www/byggbutik/modules/loffullslider/libs/group_base.php(86): GdThumb->save('/var/www/byggbu...') #1 /var/www/byggbutik/modules/loffullslider/libs/group_base.php(58): LofSlideShowDataSourceBase->resizeImage('http://31.216.3...' Array) #2 /var/www/byggbutik/modules/loffullslider/libs/groups/custom/custom.php(52): LofSlideShowDataSourceBase->generateImages(Array, Object(LofParams)) #3 /var/www/byggbutik/modules/loffullslider/loffullslider.php(202): LofSlideShowCustomDataSource->getListByParameters(Object(LofParams), '') #4 /var/www/byggbutik/modules/loffullslider/loffullslider.php(71): loffullslider->processHook(Array, 'top') #5 /var/www/byggbutik/classes/Hook.php(423): loffullslider->hooktop(Array) #6 /var/www/byggbutik/classes/controller/FrontController.php(426): HookCore::exe in /var/www/byggbutik/modules/loffullslider/libs/phpthumb/GdThumb.inc.php on line 662

 

But I am now getting access to backoffice! Getting this error message in backoffice as well though:

 

Warning: file_put_contents(/var/www/byggbutik/config/xml/default_country_modules_list.xml): failed to open stream: Permission denied in /var/www/byggbutik/controllers/admin/AdminHomeController.php on line 672

Link to comment
Share on other sites

Thanks for your input Benjamin. I realize this myself but am struggling to get hold of prestashop standard permissions. I guess that setting the target folder to 777 temporarly (after install 775) should work? Also, since no permissions are changed on the old server since the installation of prestashop, these should be correct as well? Correct me if I'm wrong here though.


Link to comment
Share on other sites

how did you create the domain folder with your vps?  did you use cpanel/plesk or did some webmaster create it?  If you have to set anything to 777, to get 'something' to work...then you need to address the root problem...

 

using putty for example, and within your domain directory check that your domain name (without www) is the owner...use ls -l

 

nominally you want folders at 755 and files at 644 (with addition of .htaccess hidden)

 

if this is the first prestashop you are using on this vps I suggest a quick test.

 

create a subdomain or other test url

download your version of native priestashop you can get your version here; https://code.google.com/p/prestashop/downloads/list

create a test db on your vps include user/pwd

install the native prestashop, this will check your server compatibility and tell you of any problems...

 

this really can save you lots of time when you know in advance what if any server changes may be needed to support your shop transfer

Link to comment
Share on other sites

Thanks El Patron! I will definitely try that. The root was created by the hosting company and I've created 4 sub folders for 4 different sites (1 is a prestashop site) inside that. I will report back the results as soon as I've followed your suggestion.

Link to comment
Share on other sites

I second that 755 for folders and 644 for files is the standard permission set that PrestaShop will work well with. However, some hosts have different settings for permissions but more often than not 755 and 644 should work fine.

 

For installations and server transfers, I've seen that many times you need to loosen the permissions, it's not recommended but if that's the standard way the hosts permissions work, I would double check with your hosting to make sure it is safe. 

Link to comment
Share on other sites

El Patron, I've followed your suggestion and get errors as shown in the attached file. Should I change these folders to 755?

 

 

you will need to determine the 'owner'  of the directory and change to your domain (without www).  This may differ on some servers but this is the general ways things should be set up.  it very important that the group be  something link psacln and the owner your domain (without www).

 

some vps's are 'smarter' than other vps's...it's really a matter of having a quality hosting control panel, which when you add a new domain/sub-domain creates correctly the domains file structure.

 

If you are using a free hosting control panel and your hosting offers a 'paid' hosting control panel...the paid is worth every penny...

Link to comment
Share on other sites

El Patron, I've followed your suggestion and get errors as shown in the attached file. Should I change these folders to 755?

 

before asking to change to 755 it's best to tell us what they are now.

 

and remember when you change folder permissions always think irecursive, same with files...well unless you are going to change every folder and file individually

Link to comment
Share on other sites

I've been in contact with the host and ownerships has to be changed using ssh. It's not possible using the cpanel :/ I have to confess my knowledge is very limited here, but have read a bit and guess we're talking about a chown -R command for the prestashop directory, right? If anyone could put me in the right direction here, it would we very appreciated!

 

Also, since the shop is in this subdirectory now: 31.216.37.192/byggbutik

Does the ownership have to be changed again when I point the right domain-names to this server?

Link to comment
Share on other sites

I've been in contact with the host and ownerships has to be changed using ssh. It's not possible using the cpanel :/ I have to confess my knowledge is very limited here, but have read a bit and guess we're talking about a chown -R command for the prestashop directory, right? If anyone could put me in the right direction here, it would we very appreciated!

 

Also, since the shop is in this subdirectory now: 31.216.37.192/byggbutik

Does the ownership have to be changed again when I point the right domain-names to this server?

 

re ssh......this is one of the things they don't 'tell' you about...else you pay for a manged vps. 

 

search and download putty, this is a good interface for your ssh

 

welcome to web-mastering

----------------

Also, since the shop is in this subdirectory now: 31.216.37.192/byggbutik

Does the ownership have to be changed again when I point the right domain-names to this server?

 

until you know who the directory owner is then it's not certain that this is the issue, yes?

Link to comment
Share on other sites

hopefully you can find the owener using ls -l and report back soon to see if this is the actual issue.

 

here is a php cli I wrote that after copying a ps bundle to a new domain it then has to set the owner and group, note how I also handle the .htaccess (most files are 644) but with 666 we hide it as well.

        function PS_CREATE_DOMAIN_ROOT($group,$etiendaurl,$parent_url,$doc_root,$bundle_name)
        {
                $cmd_copy = 'yes | cp -r /usr/bundle/'.$bundle_name.'_httpdocs/. /var/www/vhosts/'.$etiendaurl.'.'.$parent_url.'/httpdocs/';

//              $cmd_copy = 'yes | cp -r /var/www/vhosts/'.$parent_url.'/subdomains/'.$bundle_name.'/httpdocs/. /var/www/vhosts/'.$etiendaurl.'.'.$parent_url.'/httpdocs/';
                echo "<br />".$cmd_copy;
                shell_exec($cmd_copy);
                /*
                * When we copy the bundle the owner/group are the bundle owner, change owner/group for this user
                */
                $cmd_grp = 'chown -R '.$etiendaurl.':'.$group.' '.$doc_root.'/httpdocs/*';
                echo "<br />".$cmd_grp;
                shell_exec($cmd_grp);
                // set the correct permission for .htaccess
                $cmd_chmod = 'chmod 666 '.$doc_root.'/httpdocs/.htaccess';
                echo $cmd_chmod;
                shell_exec($cmd_chmod);
                return;
        }

Link to comment
Share on other sites

the invalid user is  'you' :)

 

You are almost never logged in as root when using a system- the root login is strictly for configuration and administration of your system.  Why?  Because in one command you can destroy your entire server, so one must switch users

 

after you log in you will need to 'su'

http://en.wikipedia.org/wiki/Su_%28Unix%29

 

you will need to find out what the log in is for your 'super user', like administrator

 

having fun yes?

Link to comment
Share on other sites

Haha, the simple answer to your question is no ;) But I'm learning, which is more important..

 

Really?! To be exact, it looks like this:

post-738604-0-44610200-1387396139_thumb.png

 

Sounds a bit illogical to me that a user named "root" doesn't have root access. But anyways, if this user is not authorized I guess I have to request login details from the host to be able to achive this?

Link to comment
Share on other sites

Haha, the simple answer to your question is no ;) But I'm learning, which is more important..

 

Really?! To be exact, it looks like this:

attachicon.gifSkärmavbild 2013-12-18 kl. 20.48.24.png

 

Sounds a bit illogical to me that a user named "root" doesn't have root access. But anyways, if this user is not authorized I guess I have to request login details from the host to be able to achive this?

 

Way to keep up.  I am sticking with my last answer as I don't have a better 'guess'.

 

What is your control panel?  When you create a domain or subdomain, the control panel should create the correct file owner.  I only ever needed to do this for php cli (running server side sfw) that created domains/subdomains or for some customers that had one of them roll your own environments...

 

If you resolve the issue with control panel creation...you should never really need ssh access.

Link to comment
Share on other sites

Think the cpanel is their own thing for their elastic cloud servers. I haven't created any domains/subdomains at all, the only thing I've done is to create subfolder in root using sftp. I thought I could just point the different domains to the right folder when all sites where ready.

 

This is what I've got:

post-738604-0-97940200-1387401760_thumb.png

post-738604-0-19296100-1387401821_thumb.png

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