duan97689 2016-07-09 10:07
浏览 202
已采纳

上传图像SilverStripe时,PHP错误'Filesize为零字节'

I have just set up a new Centos 7 server and uploaded my SilverStripe project via a Capistrano deployment. All is working well except for the file upload where I get a 'Filesize zero bytes' when uploading images.

The assets folder is symlinked to a shared folder outside of the website root.

website
- current
- - (website root)
- shared
- - assets
- - - (uploads)
- - vendor
- - - (composer managed deps)

The file I am uploading is 16kb.

Permissions on all files and directories are set to deployer:apache 755 and permissions on the assets folder has been set to 775 (set it to 777 still with no luck).

There was another post I read that mention php config could be an issue. Here are some of the relevant php settings:

  • max_execution_time: 30
  • max_file_uploads: 20
  • max_input_time: 60
  • post_max_size: 8M
  • upload_max_filesize: 2M
  • upload_tmp_dir: /tmp

Not sure if there are any others that may be on interest, let me know and I will post them.

  • 写回答

1条回答 默认 最新

  • dorbmd1177 2016-07-11 00:07
    关注

    This is usually due to permissions on the assets directory.

    Change the owner of both the symlink and the folder it is linked to

    sudo chown -R deployer:apache assets
    sudo chown -R deployer:apache /path/to/assets
    

    You might also need to do sudo chmod g+w assets and sudo chmod g+w /path/to/assets to allow other group members to write to your directory.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分