[英]Laravel production: The file “/home/forge/default/storage/app/geoip.mmdb” does not exist or is not readable
I have the following error when moving my site to production. 将网站移至生产环境时出现以下错误。
The file "/home/forge/default/storage/app/geoip.mmdb" does not exist or is not readable. (View: /home/forge/default/resources/views/layouts/extra_scripts.blade.php) (View: /home/forge/default/resources/views/layouts/extra_scripts.blade.php) (View: /home/forge/default/resources/views/layouts/extra_scripts.blade.php)
It is related with this package: Torann/laravel-geoip 它与此软件包有关: Torann / laravel-geoip
The default laravel .gitignore file ignores the storage folder and therefore the file is missing in production: 默认的laravel .gitignore文件将忽略存储文件夹,因此该文件在生产中丢失:
/vendor
/node_modules
/public/storage
Homestead.yaml
Homestead.json
.env
My question is: Should I remove /public/storage from .gitignore? 我的问题是:我应该从.gitignore中删除/ public / storage吗? Is it a good practice to include this file in my project? 将这个文件包含在我的项目中是一种好习惯吗? Is there another way to make this package work? 还有其他方法可以使此程序包起作用吗?
From my understanding after skimming the documentation, you should be able to just run php artisan geoip:update
and it will re-create the database for you. 根据我对文档的了解,您应该能够运行php artisan geoip:update
,它将为您重新创建数据库。 No need to keep it in your git repo. 无需将其保留在您的git仓库中。
Optimization Tip: When using the database option I don't like having the downloaded database in my git repository, so I have my deploy system run the
geoip:update
during the build process before it's deployed to the servers. 优化提示:使用数据库选项时,我不喜欢将下载的数据库存储在git信息库中,因此在将其部署到服务器之前,请让我的部署系统在构建过程中运行geoip:update
。
http://lyften.com/projects/laravel-geoip/doc/services.html http://lyften.com/projects/laravel-geoip/doc/services.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.