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: 13183
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

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

Postby Schro3f » 23. July 2013 08:19

Hi there,

I jut started with xampp. And I've run into the same problem. Thing is when I execute the php from a flash file it does write. But when I execute it from a HTML file in the local host nothing happens. Other commands like download etc do work
Schro3f
 
Posts: 1
Joined: 23. July 2013 08:16
Operating System: Osx 10.6.8


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 8 guests