franzonal Posted December 15, 2013 Share Posted December 15, 2013 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 More sharing options...
vekia Posted December 15, 2013 Share Posted December 15, 2013 can you please check permissions to directory: /cache/smarty/compile/ Link to comment Share on other sites More sharing options...
franzonal Posted December 15, 2013 Author Share Posted December 15, 2013 (edited) Many thanks for your quick reply! The folder has 755 and index.php (inside) has 644. The rest of the nested folders seems to have 766. Edited December 15, 2013 by franzonal (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted December 15, 2013 Share Posted December 15, 2013 can you try to change permissions recursively for whole directory to 777 ? (files and subdirectories) Link to comment Share on other sites More sharing options...
franzonal Posted December 15, 2013 Author Share Posted December 15, 2013 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 More sharing options...
vekia Posted December 16, 2013 Share Posted December 16, 2013 You've got serious problem with chmods try to change chmod to 777 for: /modules/loffullslider/ - recursively for files and subdirectories Link to comment Share on other sites More sharing options...
franzonal Posted December 16, 2013 Author Share Posted December 16, 2013 Many thanks for your patience! I've now changed the permissions but exactly the same message appears. What might have caused this? Do you recon uploading again could help? Link to comment Share on other sites More sharing options...
franzonal Posted December 16, 2013 Author Share Posted December 16, 2013 Changing config/xml folder to 777 and files to 644 in that folder solved error in backoffice. Don't know if that could be kept that way on VPS host though? Link to comment Share on other sites More sharing options...
benjamin utterback Posted December 16, 2013 Share Posted December 16, 2013 Permissions is crucial settings to get right. I suspect that correctly adjusting the permissions of both servers before the transfer will solve this problem. Link to comment Share on other sites More sharing options...
franzonal Posted December 16, 2013 Author Share Posted December 16, 2013 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 More sharing options...
El Patron Posted December 16, 2013 Share Posted December 16, 2013 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 More sharing options...
franzonal Posted December 16, 2013 Author Share Posted December 16, 2013 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 More sharing options...
benjamin utterback Posted December 16, 2013 Share Posted December 16, 2013 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 More sharing options...
franzonal Posted December 16, 2013 Author Share Posted December 16, 2013 El Patron, I've followed your suggestion and get errors as shown in the attached file. Should I change these folders to 755? Link to comment Share on other sites More sharing options...
El Patron Posted December 16, 2013 Share Posted December 16, 2013 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 More sharing options...
El Patron Posted December 16, 2013 Share Posted December 16, 2013 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 More sharing options...
franzonal Posted December 16, 2013 Author Share Posted December 16, 2013 They seem to be 755 and 644 respectively, so should be fine then. Couldn't find anywhere to change owner i the cpanel so I've sent an email to the host. I will let you know the result. Once again, many thanks for your help. Greatly appreciated! 1 Link to comment Share on other sites More sharing options...
franzonal Posted December 17, 2013 Author Share Posted December 17, 2013 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 More sharing options...
El Patron Posted December 17, 2013 Share Posted December 17, 2013 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 More sharing options...
El Patron Posted December 17, 2013 Share Posted December 17, 2013 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 More sharing options...
franzonal Posted December 17, 2013 Author Share Posted December 17, 2013 Thanks! Do you know if there is any Mac alternative, or is it just terminal? Link to comment Share on other sites More sharing options...
El Patron Posted December 17, 2013 Share Posted December 17, 2013 don't know mac at all..sorry Link to comment Share on other sites More sharing options...
franzonal Posted December 17, 2013 Author Share Posted December 17, 2013 Ran ls -l /var/www in terminal and got this: Owner and user is "root" for all folders, no? Link to comment Share on other sites More sharing options...
El Patron Posted December 17, 2013 Share Posted December 17, 2013 correct, owner is root group is root (you group is odd but some servers differ)... now try change owner to domain without www Link to comment Share on other sites More sharing options...
franzonal Posted December 17, 2013 Author Share Posted December 17, 2013 All-right, is that "31.216.37.192" or "31.216.37.192/byggbutik" in this case (ps in that subfolder)? Link to comment Share on other sites More sharing options...
El Patron Posted December 17, 2013 Share Posted December 17, 2013 not used to working with ip addresses as part of the directory structure... but your target of course is the directory of the domain files Link to comment Share on other sites More sharing options...
franzonal Posted December 17, 2013 Author Share Posted December 17, 2013 Ok, in this case the domainname is still pointing to the old server so I can't use that. The ip is the only thing I've got. What's the normal procedure for this when transferring ps? Should I get a temporary domain name? Link to comment Share on other sites More sharing options...
franzonal Posted December 17, 2013 Author Share Posted December 17, 2013 chown -R 31.216.37.192 /var/www/byggbutik returns "invalid user" Link to comment Share on other sites More sharing options...
El Patron Posted December 17, 2013 Share Posted December 17, 2013 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 More sharing options...
franzonal Posted December 18, 2013 Author Share Posted December 18, 2013 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: 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 More sharing options...
El Patron Posted December 18, 2013 Share Posted December 18, 2013 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: Skä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 More sharing options...
franzonal Posted December 18, 2013 Author Share Posted December 18, 2013 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: Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now