RE: [SMARTY] permissions hell

From: Date: Thu, 30 May 2002 18:37:22 +0000
Subject: RE: [SMARTY] permissions hell
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4465@lists.php.net to get a copy of this message
Thanks for the responses-- just what I needed. I went through the steps Zzd outlined below (--yeah, my Apache runs as 'nobody') and it fixed the problem. Voila! Thanks. best Eric http://ericmueller.org http://themepark.com -----Original Message----- From: zzd [mailto:craigduncan@nc.rr.com] Sent: Wednesday, May 29, 2002 11:05 AM To: Eric Mueller; smarty-general@lists.php.net Subject: Re: [SMARTY] permissions hell The template directory should probably be owned by the same user that is running the apache httpd deamon. To figure this out, try the following: ps -ef | grep httpd This should produce a result like the following ps -ef | grep httpd apache 7566 7558 0 12:26 ? 00:00:04 httpd -DHAVE_PHP4 -DHAVE_SSL -DH apache 7567 7558 0 12:26 ? 00:00:02 httpd -DHAVE_PHP4 -DHAVE_SSL -DH apache 7568 7558 0 12:26 ? 00:00:03 httpd -DHAVE_PHP4 -DHAVE_SSL -DH apache 7569 7558 0 12:26 ? 00:00:03 httpd -DHAVE_PHP4 -DHAVE_SSL -DH apache 7571 7558 0 12:26 ? 00:00:02 httpd -DHAVE_PHP4 -DHAVE_SSL -DH apache 7572 7558 0 12:26 ? 00:00:04 httpd -DHAVE_PHP4 -DHAVE_SSL -DH apache 7573 7558 0 12:26 ? 00:00:05 httpd -DHAVE_PHP4 -DHAVE_SSL -DH Clearly, my web server is being run by the user apache (your server may be run by user nobody). Change the owner of all files in the templates_c directory as follows: chown -R apache:apache templates_c Assuming that it is a permissions issue, this should resolve it for you. On Wednesday 29 May 2002 01:28 pm, Eric Mueller wrote: > Hi guys-- I am having a Unix permissions problem with Smarty... the > pages are generating ok, but they're interspersed with this error: > > "Warning: chmod failed: Operation not permitted in > /home/www_server/gearcrew.com/www/Smarty.class.php on line 1379" > > That piece of code is: > > if ( strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' || (flock($fd, > LOCK_EX)) ) { > fwrite( $fd, $contents ); > fclose($fd); > chmod($filename, 0644); // <- line 1379 > } > > What's up? Like I said-- the pages are generating just fine-- but the > chmod error message is mixing into the output so it looks bad. > > On this box I believe apache runs as root (--how can I tell for > sure?). My templates_c directory looks like this: > > drwx------ 42 nobody nobody 4096 May 28 19:48 > templates_c > > > THANK YOU-- > > best, > Eric Mueller

« previous php.smarty.general (#4465) next »