Using mkdir, fopen, fwrite, etc with PHP

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Using mkdir, fopen, fwrite, etc with PHP

Postby osol » 22. September 2011 19:12

My php script uses mkdir, fopen, fwrite, etc. to write a log to a text file. This works fine on a live online server, but using it on my mac with xampp is not working. The permissions aren't the problem, it's that no files/folders are ever created... nothing happens. What's the problem??

Code: Select all
      if (!is_dir($path)) {
         mkdir($path,0755, true);
      }

   $openfile = fopen($path."/".$filename, 'a');
   fwrite($openfile, $logcontent);
   fclose($openfile);   
osol
 
Posts: 2
Joined: 22. September 2011 19:08

Re: Using mkdir, fopen, fwrite, etc with PHP

Postby Nobbie » 22. September 2011 22:26

osol wrote:The permissions aren't the problem,


Sure? How can you know?
Nobbie
 
Posts: 4720
Joined: 09. March 2008 13:04

Re: Using mkdir, fopen, fwrite, etc with PHP

Postby osol » 22. September 2011 22:56

Because I initially received a permissions error, but I gave the folder read and write permissions along with all "enclosed items". I no longer receive the permissions error, now nothing happens at all.
osol
 
Posts: 2
Joined: 22. September 2011 19:08


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 4 guests