Giter VIP home page Giter VIP logo

Comments (2)

LF-Wow avatar LF-Wow commented on September 28, 2024

已经解决了。是我不懂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.

dspurl avatar dspurl commented on September 28, 2024

了解下laradock和docker-compose,你会发现另一片天空

from dsshop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.