fopen(); “Remote host file access not accepted” on a local file?

前端 未结 7 816
-上瘾入骨i
-上瘾入骨i 2020-12-28 17:54

I am using the Tcpdf module and PHP to create dymanic PDF invoices from an ordering system.

The script should then save the invoice into a folder called \"invoices\"

7条回答
  •  粉色の甜心
    2020-12-28 18:38

    I found the issue was that the path for fopen has to be from the document root, and not from the PHP script location.

    C:\Website\www\script\invoice\invoice.pdf

    For example if the PHP script is inside the "script" folder, and you want to create the pdf inside the "invoice" folder, the script needs to have "\script\invoice\invoice.pdf".

提交回复
热议问题