Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Possible permissions issue with PHP file on IIS

Options
  • 05-04-2009 8:55pm
    #1
    Registered Users Posts: 3,514 ✭✭✭


    Hi guys,
    I'm not too much in the know about IIS hosting and .NET stuff so I'm struggling with a little issue I have. My server supports PHP and I have uploaded the following file and a blank output.xml file:
    [PHP]
    <?php
    $url = "http://www.website.org/directory/rss?s=676&u=g225";
    $data = file_get_contents($url);
    $file = fopen("output.xml", "w+");
    fputs($file, $data);
    fclose($file);
    ?>
    [/PHP]

    The script is basically taking the contents of $url and puts it into a file called output.xml. When I run the PHP file, nothing happens. The .XML file doesn't update. I have logged onto my control panel and I have ticked all the boxes for permissions for both the PHP file and the output.xml.

    I'm thinking either I haven't correctly set the permissions or the "w+" statement is incorrect here: $file = fopen("output.xml", "w+");

    Any ideas? Thanks.


Comments

  • Closed Accounts Posts: 198 ✭✭sh_o


    If you try the following you can confirm if it is a permissions issue or otherwise....
    <?php 
    $data = "blah";
    $file = fopen("output.xml", "w+"); 
    fputs($file, $data); 
    fclose($file); 
    ?>
    


  • Registered Users Posts: 3,514 ✭✭✭Rollo Tamasi


    Hi sh_o,
    I made those changes but nothing happened.


  • Moderators, Politics Moderators Posts: 39,846 Mod ✭✭✭✭Seth Brundle


    does phpinfo work?


  • Registered Users Posts: 3,514 ✭✭✭Rollo Tamasi


    kbannon wrote: »
    does phpinfo work?
    Yup, it works.


  • Closed Accounts Posts: 198 ✭✭sh_o


    did you set the permissions for the user that runs the iis server:
    http://coppermine-gallery.net/tutorial/permissions/iis.php


  • Advertisement
  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    Most hosts have the "allow_url_fopen" option disabled in their PHP installs, and this prevents you from using the fopen() function to get the contents of web files.

    Have a look at the cURL library instead. It's a little more work than fopen() but much more powerful.


Advertisement