I’ve been using the Advanced Improved Template (https://github.com/nenad-zivkovic/yii2-advanced-template) to set up my application on my localhost. One of the main reasons I went with that as opposed to the standard advanced template structure was the fact that all of the non public files are stored in a _protected folder which we can put outside of the webroot.
I’ve uploaded all of the files (well I think I have but have to do it via FTP lol) - and have adjusted the index.php file to reflect the fact that I have the _protected folder outside of the web root (public_html)
Many thanks for getting back. I’ve uploaded a fresh install of the template to the server - it’s fine. The problem relates to the Composer files - I’ll do some more digging.
Many thanks for getting back to me. Sorry - could you give me some more guidance - running composer install on a shared host (can I do this) and changing the path as you mention in the composer script. On my localhost the _protected folder is within the project folder, but on the server I’ve moved out of the webroot. Many thanks!
I’ve done this - moved the vendor folder outside of the webroot on the localhost so it’s now on c:/wamp/vendor to match what I would have on the public server.
Now I have more problems eg
Invalid Parameter – yii\base\InvalidParamException
The file or directory to be published does not exist: C:\wamp\www\yii2-advanced-template-improved-testing\_protected/vendor\bower/jquery/dist
in C:\wamp\vendor\yiisoft\yii2\web\AssetManager.php at line 407
398399400401402403404405406407408409410411412413414415416
public function publish($path, $options = [])
{
$path = Yii::getAlias($path);
if (isset($this->_published[$path])) {
return $this->_published[$path];
}
if (!is_string($path) || ($src = realpath($path)) === false) {
throw new InvalidParamException("The file or directory to be published does not exist: $path");
}
if (is_file($src)) {
return $this->_published[$path] = $this->publishFile($src);
} else {
return $this->_published[$path] = $this->publishDirectory($src, $options);
}
}
I have changed the paths in the production environment - these are pointing to the _protected folder outside of the root eg /home/sites/somedomain.com/_protected/vendor etc
The backend is working fine - the problem is with the front end
Sorted it now - might be an idea to provide a clearer explanation for people hosting on a shared host who want the (protected) vendor folder outside of the webroot due to Composer bakeing the paths when it writes the autoloads.?
Anyway - many thanks for you help - much appreciated