Fatal error: Root site directory have to be readable and writable. in /home/public/sitecake/2.4.7/config/check.php on line 24

The hosting provider I chose does not allow scripts to write to anything. Instead of running a chgrp command to allow sitecake to modify all contents, I decided to set up the FTP settings in the sitecake config. I believe I set up the FTP settings correctly.

But I still get this error. Any ideas as to what might be causing this?

The hosting provider in question is Nearly Free Speech.

This is their pertinent FAQ entry: https://members.nearlyfreespeech.net/faq?keywords=chgrp&submit=Search+for+Keywords&form=1

However, I don’t think I would need to change the group if I already gave Sitecake FTP access. Am I right?

Or is there any way to use SFTP instead? I know you guys are busy but I would really appreciate a reply, I don’t know how to fix this and Googling isn’t being very helpful.

Hi, problem is that root site dir is being checked for read/write permission, no matter what adapter you are using for filesystem.
What you could do is to comment out lines #22, #23, #24 and #25 in sitecake/2.4.7/config/check.php.
Currently only FTP and Local adapters are supported.

Thanks, but I actually did try this in the mean time. I get no error now, but after going to http//…sitecake.php, I now just get a blank page. View Page Source also shows nothing, completely blank.

FTP just doesn’t seem to be working, even though I definitely enabled it on the server side, and my username and password in the Sitecake config are definitely correct.

I can’t even check logs because Sitecake would need write permission in order to update the logs. I am stumped.

Can you try to set debug config var to true to see if you will get any error message?

Warning: ftp_chdir(): /fs7b/joga/public/: No such file or directory in /home/public/sitecake/2.4.7/vendor/league/flysystem/src/Adapter/Ftp.php on line 152

Fatal error: Uncaught exception 'LogicException' with message 'Could not ensure that the directory /sitecake/logs is present and writable.' in /home/public/sitecake/2.4.7/src/Sitecake/Log/Engine/FileLog.php:93 Stack trace: #0 /home/public/sitecake/2.4.7/config/bootstrap.php(104): Sitecake\Log\Engine\FileLog->__construct(Object(League\Flysystem\Filesystem), Object(Silex\Application)) #1 /home/public/sitecake/2.4.7/vendor/pimple/pimple/src/Pimple/Container.php(118): {closure}(Object(Silex\Application)) #2 /home/public/sitecake/2.4.7/config/bootstrap.php(106): Pimple\Container->offsetGet('logger') #3 /home/public/sitecake/2.4.7/src/app.php(6): require('/home/public/si...') #4 /home/public/creva.php(1): require('/home/public/si...') #5 {main} thrown in /home/public/sitecake/2.4.7/src/Sitecake/Log/Engine/FileLog.php on line 93

So I first tried creating the logs directory in /home//public/sitecake/, and made it writable by the web group (for php scripts) with chgrp -R web /home/public/sitecake/logs

But no change. Then I read the ftp.php file in sitecake/2.4.7/vendor/league/flysystem/src/Adapter/Ftp.php and it seems I may have messedup with the root var in the config file. By root, is it meant root of website? Because the root of the website is /home/public/.

On the hosting site, I have two options: Apache Site root which is /fs7b/joga/, and Apache Document root which is /fs7b/joga/public/. When I log in via ssh on WinSCP, the website directory is /home/public/

I tried all 3 options in the Sitecake config, and I get the same error message each time.

So I removed the root var from the ftp adapter configuration in the Sitecake config file. And now Siecake works, but it is PAINFULLY SLOW. I timed it on my phone. Logging in took between 35-45 seconds, and publishing a simple text change in an HTML paragraph took between 45-55 seconds.

This is unusable to be honest. Is this normal for FTP?? I used the FTP protocol to test it in WinSCP and changes made are instantaneous. There must be something else going on here.

I love Sitecake but if I can’t use it, that would really suck…

Did you check out documentation regarding .scignore? There’s no much, but point is if you have any files/dirs (like external libraries or framework) in your site root dir that you don’t want sitecake to handle, you should add those in .scignore file in your site root dir. Each fiel/dir in new line.

There are also several topics dicussing this on forum, so just search for .scignore
https://forum.sitecake.com/search?q=.scignore

It’s a really simple site, and I have nothing on there that I don’t want Sitecake to handle, with the exception of the header, menu, and footer php files, which are tiny. I load bootstrap and everything else I need via CDN.

I trawled through your forum and I found one other guy who had a similar issue. Sitecake speed question

I just don’t know whether he used FTP or the local filesystem adapter… I would realy love to get this to work properly on nearlyfreespeech just because they are so cheap and reliable.

Ok Predraze, I am getting tired of nearlyfreespeech. I don’t understand why it is so blazingly fast serving me my website but so painfully slow working with Sitecake.

I changed the config back to local filesystem adapter, and ran the chgrp -R web /home/public/ command via ssh.

Sitecake works more quickly now, but it still takes more than 10 seconds to log in, and more than 20 seconds to publish a simple text change. I don’t get it. And I don’t like having my entire directory writable by any script.

Can you guarantee that Sitecake works as well on Fastcomet as it does on localhost? If so, then I will migrate over there. I just found out today that Sitecake is free on there as they are affiliated with you. Ah well.

I can’t figure out how to edit comments on here. I wanna say, expecting something to work as well as it does on localhost may be unfair. So let me change that to “can a small sitecake site work as quickly on fastcomet as it does in your demo?”

Other than that, I thought more about this and I think that you guys should really invest some time into security at some point. Requiring a root directory to be writable by scripts is pretty risky, and as much as it simplifies installation, just saying “sitecake is tiny, nobody will want to hack it” isn’t a good enough defense. Sitecake won’t be tiny forever (hopefully), I mean it’s a great idea and it should get big.

Furthermore, supporting only the outdated and insecure FTP as an alternative is kind of shitty, especially since the credentials need to be stored in plain text inside the web directory. That’s even less secure than having the entire directory writable by any script.

I am not making a big deal site, it’s just a small business site as a present for my parents who have grown tired of wordpress. But I still don’t want it to get pwned by phishers.

My final post from this tirade:

I paid for Fastcomet, transferred my site there, and it works fantastically. I wish I knew why nearlyfreespeech was so bad comparably, it doesn’t seem like they have much more inferior hardware. But in any case, thanks for an awesomely user friendly CMS.

@bogz I’m glad you managed to solve your problem. I’m not sure about nearlyfreespeech. I never heard of it until now.
As for security, there were few discussions, but we figured that Sitecake is secure enough as is. Maybe we’ll throw in username at some point, but it’s just because there is a plan to have multiple user account per sitecake instance. Our philosophy is simplicity and databaseless approach so Sitecake has to write to filesystem. Also the idea to be able to download your site at any time and just upload it to another place without any additional work demands to write all changes to page files directly, so thus need for writtable site root dir :slight_smile: .

I’m glad you like sitke and hope you’ll enjoy using it.