PHP always writes data to a data

Source: Internet
Author: User
PHP always writes data to a file
Title, I recently want to write a PHP, is to keep writing data to a file until the disk is full
The requirement is how to get the PHP code to go by itself, without the need for outside action.


------Solution--------------------
If your data volume itself is not very large, now the hard disk is very large, it is not easy AH
------Solution--------------------
Do you want to attack the server? Write files very slow, rather than directly generate large files, execute the copy file ...
------Solution--------------------
PHP can also be converted to execute files, but it is not as direct as C or assembly, writing files is very bad, especially with a very short data constantly to write, directly let the system card that, did not wait for the full to be restarted (now the big hard disk, in that way to write half a long time). Direct operation Fat32/ntfs Generating large files is very fast, and at least writing with large memory buffers is not only faster but also allows the system to respond to some operations without being suspended.
------Solution--------------------
In the dead loop, write it in append mode.

But the first push is always needed. God is too busy to push for you.
------Solution--------------------
PHP will time Out
------Solution--------------------
Reference:
PHP will time out

Yes, you can't just consider the execution method, PHP has a run time limit.
------Solution--------------------
Reference:
PHP will time out
Ignore_user_abort ();
Set_time_limit (0);
------Solution--------------------
Start or need manual ah, script can not self-run!
------Solution--------------------
"Until the disk is full."
Very curious about the intentions of the landlord
------Solution--------------------
This demand ... A bit of a spoof meaning Ah, but always return to say that PHP is not automatically executed, you can use PHP call shell or bat to manipulate the file
------Solution--------------------
PHP timed execution can solve your question.
  • 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.