Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP copy() error

Tags:

php

I'm getting error while using php function copy()

Warning: copy() [function.copy]: Couldn't resolve host name in

Warning: copy(http://www.foodtest.ru/images/big_img/sausage_3.jpg) [function.copy]: failed to open stream: operation failed in

what's wrong with that url?


2 Answers

Try enclosing the url withing quotes "".

like image 93
Raja Avatar answered Dec 12 '25 02:12

Raja


Try plugging in a destination argument and make sure to have the soft ticks around the arguments.

copy("http://www.foodtest.ru/images/big_img/sausage_3.jpg", "./file.jpg");
like image 40
a.stgeorge Avatar answered Dec 12 '25 03:12

a.stgeorge



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!