在服务器上面。运行docker时,php目录会发生权限问题解决方法如下:

1:进入php目录下面

docker exec -ti php56 /bin/bash #进入php容器

chown -R www-data:www-data /var/www/html #给定权限

/var/www/html/ #是你代码存放的目录

  

  

2:在运行容器的时候,给容器加特权,及加上 --privileged=true 参数:

docker run -i -t -v /soft:/soft --privileged=true 686672a1d0cc /bin/bash

  

docker 错误failed to open stream: Permission denied 解决方法的更多相关文章

  1. file_put_contents () failed to open stream: Permission denied 解决办法

    今天,帮朋友配置服务器thinkphp5的时候,直接访问“www.***.com/admin/index/index” : 出现以下错误: file_put_contents (/PHP/admin/ ...

  2. laravel he stream or file "..laravel-2019-02-14.log" could not be opened: failed to open stream: Permission denied

    错误:The stream or file "/var/www/jianshu/storage/logs/laravel-2019-02-14.log" could not be ...

  3. php上传文件时出现错误:failed to open stream: Permission denied

    尝试使用php写了一段小的上传程序,但是在使用的时候,在上传文件时出现这个错误,由于之前在写程序要读文件,曾经出现过这个问题,当时是因为要读的文件的权限不够,于是使用chmod 775 1.txt把文 ...

  4. failed to open stream: Permission denied in警告错误

    问题是文件所在目录的权限问题导致的.只需要将警告文件所在的目录权限更改为777(至少是006)即可 例如 (...a.log)failed to open stream: Permission den ...

  5. Warning: file_put_contents(data.txt): failed to open stream: Permission denied in /Library/WebServer/Documents/test.php on line 22

    最近在学习PHP 在保存文件的时候报Warning: file_put_contents(data.txt): failed to open stream: Permission denied in ...

  6. [置顶] PHP调用move_uploaded_file()提示 failed to open stream: Permission denied(Linxux环境,以Ubuntu12.04为例)

    在使用PHP上传文件之后,我们有时候还需要移动到特定的文件夹,这时候就要调用move_uploaded_file()函数,可是会出现如下错误: Warning: move_uploaded_file( ...

  7. easyhadoop:failed to open stream:Permission denied in /var/www/html/index.php

    今天又重新部署了下easyhadoop,结果apache后台服务器报这个错误: [Fri Dec 13 10:32:41 2013] [notice] SIGHUP received. Attempt ...

  8. file_put_contents() failed to open stream: Permission denied 问题解决

    很长时间没有写PHP了,今天突然有个需求要写一个保存文件的功能. function downloadFile( $url , $savePath = '' ) {     $fileName = ge ...

  9. Linux启动ftp服务器530 Permission denied解决方法(已试,行)

    Linux启动ftp服务器530 Permission denied解决方法重新在虚拟机下安装了linux.现在我想启动linux自带的ftp服务器:#service  vsftpd  start . ...

随机推荐

  1. FS获取KERNEL32基址的三种方法

    FS寄存器指向当前活动线程的TEB结构(线程结构) 偏移  说明 000  指向SEH链指针 004  线程堆栈顶部 008  线程堆栈底部 00C  SubSystemTib 010  FiberD ...

  2. ubuntu安装mysql 并对外暴露3306端口

    安装 sudo apt-get install mysql-client mysql-server vi /etc/mysql/mysql.conf.d/mysqld.cnf bind 127注掉 m ...

  3. window安装reidis完成之后,想要把数据存入redis,必须开扩展,不然报错,redis windows phpstudy 安装扩展

    redis windows phpstudy 安装扩展   1.http://windows.php.net/downloads/pecl/releases/redis/3.1.5rc1/ 2.htt ...

  4. 1、Monkey环境搭建

    步骤: 1.下载adb压缩包: 32位计算机,用这个包:64位计算机,用这个包: 2.把对应的adb压缩包在本地解压,然后把解压后的文件里面的文件夹拷贝到D盘(当然随便你放在哪个目录)根目录,注意路径 ...

  5. GDI及Windows的消息机制

    什么是GDI? GDI, Graphics Device Interface GDI在以下位置已经被微软列为Legacy Graphics,不建议使用来开发应用程序(http://msdn.micro ...

  6. D-Ubuntu中修改MySQL的默认数据集(client和server)

    Ubuntu16.04,MySQL5.7 1, sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf 使用vim编辑MySQL的配置文件,不同版本的MySQL配置文件 ...

  7. k小子串 SPOJ - SUBLEX 2

    题意: 求字典序第K大的子串 题解: 先求出后缀自动机对应节点 // 该节点后面所形成的自字符串的总数 然后直接模拟即可 #include <set> #include <map&g ...

  8. vue中beforeRouteEnter 执行的时机及运用的误区?

    beforeRouteEnter钩子 beforeRouteEnter (to, from, next) { console.log(this); //undefined,不能用this来获取vue实 ...

  9. Django-ORM初识

    Django之ORM基础 一.ORM简介: ORM概念: 对象关系映射(Object Relational Mapping,简称ORM)模式是一种为了解决面向对象与关系数据库存在的互不匹配的现象的技术 ...

  10. C++与JAVA语言区别

            转载自:http://www.cnblogs.com/cnryb/archive/2011/01/04/2004141.html "作为一名C++程序员,我们早已掌握了面向对 ...