Reputation: 14649
I will execute this command in Command Prompt
php C:\xampp\htdocs\dl.php
These are the properties of my htdocs directory:
However, under the sharing tab, I have write permissions under all users:
I've restarted apache after each permission modification with no success. How do I fix this?
My PHP script downloads an XML file via an API and writes the XML file into the root directory of the server. When I execute www.mydomain.com/dl.php, the downloaded XML is written into the root directory; however, when I execute the PHP file (dl.php) via the command prompt, it will not write the downloaded file into the root directory.
PHP file:
$today = date("F j, Y").".xml";
$ch = curl_init ("");
$fp = fopen("ipod_car_connectors2.xml", "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
Upvotes: 0
Views: 1057
Reputation: 6919
Try changing it to:
$fp = fopen("c:\xampp\htdocs\ipod_car_connectors2.xml", "w");
Upvotes: 1