PHP refuses to create a logfile

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cookspyder
    New Member
    • Jul 2007
    • 20

    #1

    PHP refuses to create a logfile

    please see second post...
    Last edited by cookspyder; Aug 16 '07, 03:08 PM. Reason: no longer occuring
  • cookspyder
    New Member
    • Jul 2007
    • 20

    #2
    I have iis, windows 2003 server, and php running on my server.

    In testingon my laptop, my code writes fine to the log file. However, now that I am on the server it will not write to the log file. All the files are the same as on the test machine. I am using wamp on the test laptop I write the code to.

    This is the sample code for the logging that works on my test laptop but not on the server.
    [code=php]
    @extract($_POST );
    $filename = "formdata.t xt";
    file_put_conten ts($filename, serialize($_POS T)."\r\n",FILE_ APPEND);
    [/code]
    Is there anything in IIS I need to change to allow the logging?

    Or maybe the file name needs to change to specify the exact location?


    Thanks!

    Comment

    • code green
      Recognized Expert Top Contributor
      • Mar 2007
      • 1726

      #3
      file_put_conten ts() only works with php 5.
      If version 4.x.x is on the server then it will throw an error.
      You will need fopen, fread, fwrite, fclose commands

      Comment

      • cookspyder
        New Member
        • Jul 2007
        • 20

        #4
        Yeah I did upgrade to 5 the other day.. I figured out the issue was not allowing php to create the file and that wasnt allowing php to write to it. I deleted it and it ran and created a new file.

        Comment

        • pbmods
          Recognized Expert Expert
          • Apr 2007
          • 5821

          #5
          Changed thread title to better describe the problem (did you know that threads whose titles contain three words or less actually get FEWER responses?).

          Comment

          Working...