0
我打算從一個單一的URL通過PHP加載圖像。我用這個file_put_contents
:PHP獲取「權限被拒絕」,而allow_url_fopen在
$url = 'http://www.example.com/test.jpg';
$img = 'C:\xampp\htdocs\myproject\assets';
file_put_contents($img, file_get_contents($url));
也是我php.ini
我有這樣的:
allow_url_fopen=On
但我得到這個錯誤:
Severity: Warning
Message: file_put_contents(C:\xampp\htdocs\trendkala\fereydoon\assets): failed to open stream: Permission denied
Filename: controllers/admin.php
Line Number: 55
Backtrace:
File: C:\xampp\htdocs\trendkala\fereydoon\application\controllers\admin.php
Line: 55
Function: file_put_contents
將'$ img ='C:\ xampp \ htdocs \ myproject \ assets';'改爲'$ img ='C:\ xampp \ htdocs \ myproject \ assets \ test.jpg';' –
謝謝@ChetanAmeta –