Path error: FRAMEWORK_PATH /vendor/silverstripe/framework not within BASE_PATH /public
Hi guys,
I decided to create site using latest Silverstripe 4.5, I have used composer to download files to my local machine, then I copied files via ftp to server, server is shared, I have files is subfolder.
when visiting site to continue installation (http://www.djjordan.eu/) I have error, something with base path and framework path, any ideas?
**Fatal error** : Uncaught Exception: Path error: FRAMEWORK_PATH /vendor/silverstripe/framework not within BASE_PATH /public in /vendor/silverstripe/framework/src/includes/constants.php:171 Stack trace: #0 /vendor/composer/autoload_real.php(70): require() #1 /vendor/composer/autoload_real.php(60): composerRequire255b08803ee1331d7b87efdb9db900ab('795b01cf23ed94c...', '/vendor/compose...') #2 /vendor/autoload.php(7): ComposerAutoloaderInit255b08803ee1331d7b87efdb9db900ab::getLoader() #3 /public/index.php(9): require('/vendor/autoloa...') #4 {main} thrown in **/vendor/silverstripe/framework/src/includes/constants.php** on line **171**
From the error it looks like something has got confused in the file paths in the autoloader. Is the file structure on your server similar to that in your dev environment? eg. if you are working on a subdirectory on the server, were you working in a subdirectory on dev, etc.
My file structure is rather similar on local machine and web server.
I have just tried to create folder ‘public’ and I put all files inside it, somehow error message disappeared, I managed to do dev/build but have problem with stylesheets, they are not loaded.
Assuming your web host is using a Linux based OS, then I’d say its going to the wrong path, /vendor would tell the system to go all the to the root of the file system which if your on shared you don’t have access to.
Likely you wanted it to go to vendor/ or ~/vendor/
For now I have decided to use older version of Silverstripe 4.3.3, I have used it before and it works.
Next time I will give 4.5 another shot, just to summary what I have done with 4.5 issue:
I have created subfolder ‘public’ and moved my files there it solved errors.
Reason I switched back to 4.3.3 is because my back end doesn’t support symlinks which are used for stylesheets and javascript files so no styles were being load.
Hey DorsetDigital thanks for help, I neither know why 4.5 doesn’t work when 4.3.3 does, will try again on next project… and thanks for tip with symlinks.