Nginx + PHP文件上传问题(Nginx + PHP File Upload issue)
通过phpMyAdmin,MODx或Wordpress上传文件时遇到以下问题。 在PHP应用程序本身,我收到一条成功消息但该文件未上传。 nginx error.log打印以下消息:
[warn][..] a client request body is buffered to a temporary file... FastCGI sent in stderr: "PHP message: PHP Warning: File upload error - unable to create a temporary file in Unknown on line 0...
我使用Nginx 1.8.0和PHP 5.4.16运行CentOS Linux版本7.2.1511(核心版)。 在从CentOS 7.1更新到7.2之前,此设置正在运行。
以下是我已经尝试解决问题的步骤:
- sys_get_temp_dir() - > / tmp
- / tmp具有权限1777
- PHP以用户nginx身份运行
- 它有足够的可用磁盘空间
- post_max_size,upload_max_filesize和client_max_body_size都设置为50m
我的想法已经不多了......
提前致谢
I am experiencing the following issue when uploading a file via phpMyAdmin, MODx or Wordpress. In the PHP application itself I am receiving a success message but the file is not uploaded. The nginx error.log prints the following messages:
[warn][..] a client request body is buffered to a temporary file... FastCGI sent in stderr: "PHP message: PHP Warning: File upload error - unable to create a temporary file in Unknown on line 0...
I am running CentOS Linux release 7.2.1511 (Core) with Nginx 1.8.0 and PHP 5.4.16. This setup was working before updating from CentOS 7.1 to 7.2.
Here are the steps that I already tried to solve the problem:
- sys_get_temp_dir() -> /tmp
- /tmp has permissions 1777
- PHP is running as user nginx
- it is plenty of free disk space available
- post_max_size, upload_max_filesize and client_max_body_size are all set to 50m
I am running out of ideas...
Thanks in advance
原文:https://stackoverflow.com/questions/34612962
最满意答案
将pojo类声明移动到outter类。 奥里卡无法处理内部阶级。
Move your pojo class declarations to outter classes. Orika cannot handle inner classes.
相关问答
更多-
Orika - 映射可选对象(Orika - mapping Optional object)[2022-07-24]
您不需要将Optional传递给Orika映射器。 可选是monad,一种容器类型,允许您在容器内执行操作。 换句话说,不要在findById方法中使用Optional,而是将findById代码放在Optional :)中 例如,如果您的Entity Repo方法findBy(id)返回Optional final TypetodoType = new TypeBuilder () {}.build(); final Type todoDtoType = new ... -
Orika null to List(Orika null to List)[2023-07-09]
这是因为Orika将使用byDefault设置动态创建映射器。 当Orika找到具有相同名称和兼容类型的字段时,它实际上是安全的(A到B的集合的列表,然后为A到B创建另一个映射器,它看起来有一个共同的字段名:String)。 如果它不符合您的口味,您可以使用useAutoMapping(boolean useAutoMapping)禁用此“魔法”; http://orika-mapper.github.io/orika-docs/mapper-factory.html This happen because ... -
Orika使用BoundMapperFacade而不是MapperFacade(Orika using BoundMapperFacade instead of MapperFacade)[2024-04-11]
MapperFactory通过决定参数为您提供正确的类。 如果你使用方法getMapperFacade()和你要映射的类以及要映射到的类,它会为你提供BoundMapperFacade : BoundMapperFacademapper = mapperFactory.getMapperFacade(From.class, To.class); MapperFactory gives you the correct class by deciding on the parameters ... -
奥里卡班无法进入(Orika class is not accessible)[2023-12-13]
当映射配置不正确时可能会发生此错误。 错误可能是非常非常具有误导性的。 导致错误的配置: factory.classMap(MyEntity.class, MyEntity.class).byDefault().register(); 修复 factory.classMap(MyEntity.class, MyEntityDTO.class).byDefault().register(); 我考虑删除这个问题,因为它不是任何库的问题,但基本上是我的映射配置中的拼写错误/副本。 但由于XKCD最好描述的原 ... -
Orika嵌套属性扁平化(Orika nested properties flattening)[2022-05-24]
实际上Orika可以处理这个问题,但是你应该通过为DefaultFieldMapper提供一个实现来提供这种自动映射策略 在Orika源代码/测试中,有一些例子。 In fact Orika can handle this, but you should provide this automatic mapping policy by providing an implementation for DefaultFieldMapper In the Orika source code / tests, th ... -
如何在orika mapper中映射时包含或排除属性?(how to include or exclude attributes while mapping in orika mapper?)[2023-06-09]
您可以通过定义映射来包含属性。 请查看“ 用户指南” 。 您可以使用byDefault()自动映射具有相同名称的字段,使用field("fieldA", "fieldB")显式定义双向映射field("fieldA", "fieldB")或使用fieldAtoB("fieldA", "fieldB")和fieldBtoA("fieldB", "fieldA")明确定义单向映射fieldBtoA("fieldB", "fieldA") 。 如果要从映射中明确排除字段(例如,使用byDefault() ),则可 ... -
Orika必须有公共制定者(Orika must have public setter)[2022-01-08]
在默认的Orika配置中,映射的对象必须遵循带有getter / setter的JavaBean规范。 另一种可能的方式是拥有公共领域。 要更改此行为,您可以编写自己的PropertyResolverStrategy并对其进行配置。 DefaultMapperFactory build = new DefaultMapperFactory.Builder() .propertyResolverStrategy(new MyCustomPropertyResolvingStrategy ... -
将pojo类声明移动到outter类。 奥里卡无法处理内部阶级。 Move your pojo class declarations to outter classes. Orika cannot handle inner classes.
-
在Orika中定义映射时,实际上是否可以使用泛型?(Is it actually possible to use generics when defining mappings in Orika?)[2022-02-27]
您可以使用MapperFactory#classMap(Type, Type)而不是MapperFactory#classMap(Class, Class) 。 你可以在generics包中的Orika测试中找到很多例子。 要构造一个Type实例,您可以使用TypeBuilder的就地匿名子类: Type> type = new TypeBuilder 我终于意识到问题不在于Orika,而是我对PaymentPlanMapper的实现和enum-singleton的不合适的设计模式。 结果是 PaymentPlannerMapper从未初始化 我的自定义映射从未在MapperFactory中注册 Okira已经自动生成了PaymentPlan / ShopifyRecurring的映射器......当facade.map(..)被调用时 Orika的自动生成让我很难发现自己的错误,因为orika的大多数事情看起来都很好。 调试自动生成的映射器('Orika ...相关文章
更多- nginx基本运行命令
- Nginx配置文件详解
- PHP 中dirname(_file_)
- nginx开机启动
- nginx下载与安装
- fancyupload实现文件上传问题
- nginx的平滑重启
- 使用solr报错,错误信息 include(SolrClient.php): failed to open stream: No such file or directory
- file_get_contents 无法读取https的问题解决!
- 基于debian(ubuntu)的nginx安装实录-vps环境搭建实录(三)
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)