Running as root, yet permission denied

From: jn (usenet*spamistehsuckremovetoreply*_at_jasonnorris.net)
Date: 02/28/04


Date: Sat, 28 Feb 2004 11:30:27 GMT

They have a server here that runs PHP as root (which is probably bad). I
wrote a test script that tries to create a text file.

 echo "<B>I'm running as user: " . $_ENV['USER'] . "</B><BR/><BR/>";

 //open the file
 echo "<B>Opening file text.txt for writing:</B>";
 $fp = fopen('text.txt',w);
 echo "<BR/>";

 if(!$fp){
  echo "<B>UNABLE TO CREATE THE FILE!</B>";
  exit;
 }

I get a permission denied error. The directory is CHMOD 755.



Relevant Pages

  • Re: [PHP] Find MAC Address in PHP
    ... Also, i have Apache running as root, so i can execute everything i want:) ... > PHP script ... ... > development server, but don't use it on production server;) ... Davi Vidal ...
    (php.general)
  • Repost: PHP,filesys,IIS
    ... does anyone know how to handle file and directory paths on a IIS 5.0 ... Problem is that the server has multi-domain and each domain has an ... a global document root that is valid for all domains and subdomains. ... they mix up FrontPage and PHP. ...
    (php.general)
  • Repost: Help needed on PHP+IIS+filesys
    ... does anyone know how to handle file and directory paths on a IIS 5.0 ... Problem is that the server has multi-domain and each domain has ... a global document root that is valid for all domains and subdomains. ... they mix up FrontPage and PHP. ...
    (php.general)
  • Re: Looking for general advice on security
    ... with the words "and be security conscious by using SSL" on the last page which is what most adviice I've found so far boils down to. ... I've located standard advice such as using PHP strip-tags on input fields and other PHP specific stuff but was wondering how best to get interactive with the security. ... Set safe mode on if it's not already the default mode on your server. ... Of course only applicable if you have access to your own server as root. ...
    (comp.lang.php)
  • Re: Lost novice
    ... Ewa wrote: ... > The service is now being moved to another server (PHP 4) and also I ... > root, so I can simply use paths relative service root. ...
    (comp.lang.php)