The file_put_contents cannot be executed in thinkphp.

Source: Internet
Author: User
The file_put_contents cannot be executed in thinkphp.
$ Img = file_get_contents ("http://img04.taobaocdn.com/bao/uploaded/i4/T1NlTRFLtcXXXXXXXX !! 0-item_pic.jpg "{{{ret}@file_put_contents('1.jpg ', $ img );

This code cannot be executed in the thinkphp module code. what is the problem? file_put_contents is useless. why?


Reply to discussion (solution)

Check the folder permissions.

According to your current statement, write to the current directory to check whether the current directory has no read/write permissions. it is recommended to save it to the readable directory to be saved.

1. Are you sure you have performed this?
2. if yes, do you have the permission?

How do you call it? Is the write action method?

Remove "@" to see if any error is reported.
Print_r (error_get_last ());

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.