FPDF错误“无法创建输出文件"; [英] FPDF error "Unable to create output file"

查看:118
本文介绍了FPDF错误“无法创建输出文件";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在与fpdf libray合作,以提供pdf文件.我项目的一部分包括使用此库为消费者生成pdf文件. 我们正在"ovh"下进行服务器测试.我在"ovh"中的空间呈树状:/www/betatest.

I'm working with fpdf libray for providing pdf files. A part of my project consists of using this library to generate pdf files for consumers. We are working with a server test under "ovh". The arborescence of my space in "ovh" is : /www/betatest.

一个名为upload的文件夹,其中包含工厂的文件夹,所有工厂的pdf文件都将存放在该文件夹中. 因此,当我尝试在固件文件夹中生成pdf文件时,在网络浏览器中会显示我:

A folder named upload which contains factures's folder where all the facture's pdf files will be there. So, when i try to generate a pdf file inside the factures folder, in a web browser it displays me :

警告:fopen(upload/factures/facture_98.pdf)[function.fopen]:无法打开流:在/homez.742/coplayer/www/betatest/library/fpdf/中成功第1025行的fpdf.php

Warning: fopen(upload/factures/facture_98.pdf) [function.fopen]: failed to open stream: Success in /homez.742/coplayer/www/betatest/library/fpdf/fpdf.php on line 1025

FPDF错误::无法创建输出文件:upload/factures/facture_98.pdf.

FPDF error: Unable to create output file: upload/factures/facture_98.pdf.

我尝试了很多在此网站上找到的东西,但是没有用. 请帮我.非常感谢! :)

I tried a lot of things that i found in this web site but does not work. Please help me. Thank's a lot! :)

推荐答案

确保目录至少具有755.另外,在路径中使用$_SERVER['DOCUMENT_ROOT']定位好目录:

Make sure the directory have at least a 755. Also, use $_SERVER['DOCUMENT_ROOT'] with your path to target the good directory :

$nomFacture = $_SERVER['DOCUMENT_ROOT']."upload/factures/facture_".$idFacture.".pdf";

这将产生类似

/homez.742/coplayer/www/betatest/upload/factures/facture_12.pdf

/homez.742/coplayer/www/betatest/upload/factures/facture_12.pdf

这篇关于FPDF错误“无法创建输出文件";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆