简体   繁体   English

Laravel生产:文件“ /home/forge/default/storage/app/geoip.mmdb”不存在或不可读

[英]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.

相关问题 "message": "关键路径 \\"file:///app/storage/oauth-private.key\\" 在 Laravel 6 中不存在或不可读" - "message": "Key path \"file:///app/storage/oauth-private.key\" does not exist or is not readable" in Laravel 6 laravel 文件不存在或不可读 - laravel file does not exist or is not readable 密钥路径“file:///home/vagrant/code/ ... /storage/oauth-private.key”不存在或不可读 - Key path “file:///home/vagrant/code/ … /storage/oauth-private.key” does not exist or is not readable laravel 文件上传 - "" 文件不存在或不可读 - laravel file upload - The "" file does not exist or is not readable laravel 文件上传会引发错误“文件不存在或不可读”。 - laravel file upload throws an error “file does not exist or is not readable.” 方法 App\\Http\\Controllers\\HomeController::home 不存在。 [Laravel 8] - Method App\Http\Controllers\HomeController::home does not exist. [Laravel 8] 方法App \\ Http \\ Controllers \\ homeController :: home()在laravel中不存在错误 - Method App\Http\Controllers\homeController::home() does not exist error in laravel 当图像已上传到文件夹中时,如何解决 laravel 中的“文件不存在或不可读” - how to solve “file does not exist or is not readable” in laravel while the image have been uploaded in folder 无法上传 Laravel 中的图像:““C:\xampp\tmp\php38A9.tmp“文件不存在或不可读。” - Unable to upload image in Laravel: “The ”C:\xampp\tmp\php38A9.tmp“ file does not exist or is not readable.” 如何解决此 Laravel 问题 - “/tmp/phpY14gRo”文件不存在或不可读? - How to resolve this Laravel issue - The “/tmp/phpY14gRo” file does not exist or is not readable?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM