Failure to create cache folder / multiple installation issues

In a previous project I used an older version of Elgg. I wanted to use the new one in this project but I can not make it work.  I'll explain what has happened in case it matters to this issue. I have read through multiple posts but none of the solutions seem to work and many of them were more than a year old.  
 
First off I am a reasonably competent person in Linux command line, I have full root SH access to my VPS.  

VPS Specs  

KVM virtualization
4 GB ram 
4 cores 


The cli / composer install failed. It seemed there were multiple folders missing in vendor including  the elgg folder   The final step of the cli install gave multiple errors referring to missing files. So I unzipped and copied the files in place using sftp. 

I am using Nginx and fpm with Php 7.3  Once I manually made the changes required to the openbasedir and the rewrite rules I thought i was off and running.

Install repeatedly told me that it would not connect to the database though I was able to connect via cli and PHPMyAdmin. I copied the sample settings file but could not get that to sort out, gave many errors.   renamed that file and then oddly the web based install worked using the same db info as before after two tries.    Oddly it seemed to fail whenever I properly set the timezone. 

Anyway, when I go to my site I  get a fatal exception.  Fatal error in exception handler. Check log for Exception at time 1590168670  

Logs indicate this is related to tedivm regarding the inability to create stash path.   

PHP message: [2020-05-22 17:31:10] ELGG.CRITICAL: Exception at time 1590168670:
Stash\Exception\InvalidArgumentException: Failed to create cache path. in /home/wordsmith/web/wordsmithcollective.com/public_html/vendor/tedivm/stash/src/Stash/Utilities.php:223
Stack trace:
#0 /home/wordsmith/web/wordsmithcollective.com/public_html/vendor/tedivm/stash/src/Stash/Driver/FileSystem.php(171): Stash\Utilities::checkFileSystemPermissions('/home/wordsmith...', 504)




In the admin section  I get a page that is absent any style. 

Administer

 

 
I read one article that suggested I delete all the cache files   and run upgrade,PHP   This results in the message unable to create cache path 
 
I have set permissions on the data directory to 777 though I don't relish the idea of leaving them there.  Owner of that and the public_html directory where the install is located is set to www-data and permissions seem to be correct recursively. 

There is a folder created in the ellg data directory named caches and in there a folder called stash so the folders are being created.  Permissions on those folders is 777 and they are owned by www-data. However, the folders inside the stash directory which I assume related to sessions as they have random names are 750.  

Hoping someone can help sort this out 

Meanwhile I am deleting the whole damn thing and will use SFTP to recopy.  

Or should i just use the old version which seemed to work without all this rigmarole 


 
 
 
 
 
 

 

  • Sounds like you had a problem with the rights permissions during installation.

    Elgg should create files (incl. settings.php) and folders automatically.

    You can create all neccesary folders manually.

    Let's say your /data folder in this directory:

    /home/wordsmith/data

    Then you must create these directories:

    /home/wordsmith/data/1
    /home/wordsmith/data/1/1
    /home/wordsmith/data/caches
    /home/wordsmith/data/caches/views_simplecache
    /home/wordsmith/data/caches/stash

    Now set the permissions:

    chmod -R 750 /home/wordsmith/data/
    
    chown -R www-data:www-data /home/wordsmith/data/

    That's all!

  • Thanks  I ended up scrubbing the server and doing the install purely via ftp  rather than using composer and it all works now