Answer the question
In order to leave comments, you need to log in
What can I replace \r\n\ with in php or how to detect a carriage return in linux?
Hello gentlemen, here is the file disk2.
When I write manually, the kvm server starts without problems.
If I create a file via php, then the kvm server does not start.
Moreover, if you do cat disk2 created manually or through php, then it displays the same thing in the console:
php code:
$file = $_SERVER["DOCUMENT_ROOT"].'/base/tmp/disk'.$i;
$fp = fopen($file, "w");
$mytext = "KVM_VM_DISK_$i=\"$devicename\"\r\nKVM_VM_DISK_SIZE_$i=\"$sizes[$key]\"\r\n";
$test = fwrite($fp, $mytext);
Answer the question
In order to leave comments, you need to log in
in PHP there is a constant PHP_EOL - the string value of the carriage return for the platform on which the code works.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question