|
|
1
5
经过长期的斗争,我终于找到了我已经讨论过的这个问题的原因 here . 这个问题主要是由于“allow\u url\u fopen”设置没有为我的服务器启用,我已经通过使用CURL解决了这个问题。我给出了解决这个问题的一步一步的程序,因为这对像我这样的人来说可能有用,可以避免浪费时间(找到解决方案)。 1. Create a temporary file in the local system with write permission.
Ex: $fp = @fopen($local_file_path, 'x');
fclose($fp);
2. Get the remote location file contents using CURL and write that to local file
which is created in the previous step.
Ex: $curl = new CurlWrapper($remote_file_path);
$curl->copyToFile($local_file_path);
3. Now send this local file path to FPDF function(image) then the corresponding
PDF will get generate for the file without any issues.
我认为这是一个解决这个问题的方法,如果有人知道一些其他的方法,那么你可以把它们贴在这里,这样这个问题可能对某人有用。 |
|
|
2
2
只需添加: 允许打开 在php.ini上(如果不存在,则创建新的)解决了这个问题。 http://www.solo-technology.com/blog/2010/04/07/quick-fix-for-url-file-access-is-disabled-issues/ |
|
|
3
0
任何人都可以使用此代码来解决。也许会有用。因为有些情况可能会不同。在我的情况下,我得到了同样的问题,但使用后。我解决了我的问题。。
$pdf->图像() 函数,也可以指定文件扩展名,如(PNG或JPG)。对我来说 '' 他在工作。因为我在裁剪图像,所以图像有时会出错。所以在那之后,我的问题得到了解决,我用不同的图像进行了测试。 |