Pawan
Pawan

Reputation: 3864

Move Laravel to another server error

I am trying to move a laravel project to a new server. Before moving on to the new server I am testing it on localhost. I am getting the error like this: file_put_contents(/megashopping_dk_files/storage/framework/views/d2f79fe2bf4361439b4c43509087ad6167dfffd9.php): failed to open stream: No such file or directory

The original path in config.php was 0 => '/var/zpanel/hostdata/zadmin/public_html/megashopping_dk_files/resources/views', which I have changed to 0 => '/megashopping_dk_files/resources/views',

I have already deleted all the files in the folders cache sessions and views in storage/framework

Again I have got two root folders with file structure like this:

1st root Folder - megashopping_dk
backend
compaign
css
fonts
img
js
library
....
2nd Root Folder - megashopping_dk_files
app
bootstrap
config
database
public
resources
storage
....

From the above what I understand is that the contents of the First Root Folder should go in the root and the contents of the second Root Folder should go alongwith the folder in contains.

Please advise me the right path?

Upvotes: 0

Views: 1440

Answers (2)

Danyal Sandeelo
Danyal Sandeelo

Reputation: 12391

Remove the cached data. Go to storage\framework and remove all the files in sessions, cache and views

Once you are done with that, give proper permissions to your storage folder recursively.

Upvotes: 0

sumit
sumit

Reputation: 15464

TRY chmod -R guo+w storage

Few explanations

chmod -R guo+w storage : Whenever we add new service provider the cache folder for that service provider will be created in inside storage/framework . we need to make them writable from our application

php artisan optimize : to reuse all frequently used classes php will make an cached class in cache/service.php. So we if add new service we need to run it. We need to use it whenever we add new dependency without using composer.

php artisan cache:clear : clear all the above cache and remap everything

For more information read https://sentinelstand.com/article/laravel-5-optimization-commands

Upvotes: 1

Related Questions