Comments (2)
已经解决了。是我不懂PHP配置的原因贴一下解决办法吧。
先docker ps
查看一下laradock_php-fpm_1的ID
然后docker inspect containerID
(可查看container内部IP以及port信息) 查看laradock_php-fpm_1在IP地址,填在下面的配置中
server {
listen 80;
server_name example.com; # 因为我这里是Ubuntu下的docker,所以填的是Ubuntu的地址,在局域网访问,本机随意
root /var/www/laradock/dsshop/api/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;填laradock_php-fpm_1 的地址,默认端口9000
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
还要一个问题,需要给storage文件夹777权限
chmod -R 777 /dsshop/api/storage
chmod -R 777 /dsshop/api/bootstrap
mysql容器问题
我通过手动运行mysql解决的密码问题,因为docker小白,没有root密码,面向百度编程也没找到进入mysql建库的方法,索性手动新建一个mysql容器,指定root密码
docker run -d -it --name=laradock_mysql_1 -e MYSQL_ROOT_PASSWORD=zhang123 laradock_mysql
from dsshop.
了解下laradock和docker-compose,你会发现另一片天空
from dsshop.
Related Issues (20)
- 轮播管理中的图片
- docker-compose up -d 报错 HOT 1
- 多商户作者会考虑吗
- 后台目前支持视频上传吗?只看到图片上传
- 提问前必看! 提问前必看! 提问前必看!
- 插件模块中的菜单如何从工具里转移到顶级栏目
- PHP8.1 Support HOT 1
- 部分文件名首字母应为大写 HOT 1
- win10/DSSHOP 3.0/PC端编译后进入登录页面缺少dsshop.json HOT 1
- docker-compose up -d报错 HOT 5
- 傻瓜式安装,在最后一步遇到脚本错误 HOT 1
- 请问,优惠券插件在哪?另外,微信交流群二维码不可用。 HOT 1
- 添加插件,添加数据表时报错“表注释不带参数的话,请不要用":"” HOT 1
- 您好,移动端装修的后端源码没开吗? HOT 1
- 3.2.2版本傻瓜式安装,提示找不到redis环境 但是我已经装了 换了几个版本都不行
- 使用的是centos 系统 在最后一步的安装的时候直接报错了不知道怎么解决 求大佬解决一下 HOT 17
- docker部署后服务端报错
- 后端build错误 HOT 1
- 安装后后台和h5页面均无法使用 HOT 3
- 后台vue启动不起来 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dsshop.