Tag: 拉德洛克

在Docker容器上的应用程序之间拒绝curl连接

我有一个网站(ZF1)和运行在同一个Docker(Laradock)容器上的API(Laravel)。 我可以通过浏览器分别访问,但是当我从网站向应用程序发出cURL请求时,我得到一个空的响应,并且头返回0.如果我输出cURL错误,那么我得到这个: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, '[API_ENDPOINT]'); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_close ($ch); echo curl_strerror(curl_errno($ch)); (7) Failed to connect to [API_HOST] port 80: Connection refused 但是,如果我从应用程序向https://www.google.com发出cURL请求,则会返回结果。 我也尝试使用file_get_contents(),但我没有收到任何回应,并提出以下警告: [Thu May 18 21:41:33.828737 2017] [proxy_fcgi:error] [pid 949:tid 139999802541824] [client 172.20.0.1:49652] AH01071: Got error 'PHP message: PHP Warning: file_get_contents ([API_ENDPOINT]): failed […]

无法使用Laradock获取MySQL容器

信息: docker版本( $ docker –version docker $ docker –version ):17.03.1-ce,build c6d412e Laradock提交( $ git rev-parse HEAD ):38fb49bccc5124dfa26b92b809ea6efbd6307eba 系统信息(Mac,PC,Linux):macOS Sierra 10.12.4 问题: 我想我正确地遵循了这个指示。 但是我得到服务'mysql'未能build立:请提交之前提交源图像 预期的行为: Php-fpm,nginx,mysql和laradock-workspace应该可以工作,并且在我的浏览器中查看myapp.dev:8888上的myapp.dev:8888主视图 复制: git clone https://github.com/Laradock/laradock.git cd laradock docker-compose up -d workspace docker exec -it laradock_workspace_1 /bin/bash composer create-project laravel/laravel myapp exit docker-compose stop 更改docker-compose.yml和nginxconfiguration文件,但没有感人的mysql设置 docker-compose up -d nginx mysql phpmyadmin

Laradock不能使用mysql

我不明白如何让Laradock正确使用MySQL数据库。 我遵循laradock文档并安装了所有东西,使用容器 docker-compose up -d nginx mysql 我有这样的多个项目版本布局 project +laradock-spa PHP方面似乎工作,我可以得到laravel欢迎页面,但是获取数据库连接正在导致我的问题。 首先,我应该在哪里运行php artisan migrate这样的php artisan migrate命令? 应该从我的机器在项目文件夹中运行,还是从Docker容器中运行? 当我从我的项目文件夹运行它,它的工作原理,我可以进入MySQL容器,看到初始数据库表,如migration和user 。 但是,我不能得到一个初步的邮政信箱数据库工作邮递员 – 我得到错误SQLSTATE[HY000] [2002] No such file or directory (SQL: insert into users (… 所以我想也许我应该从工作区容器中运行migrate命令,所以我进入工作区,但从这里php artisan migrate命令错误与[Illuminate\Database\QueryException] SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schem a.tables where table_schema = spa and table_name […]