Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Blank Pages in templates_c 0kb files - perm prob

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
jaslorax
Smarty n00b


Joined: 05 Jun 2009
Posts: 4

PostPosted: Fri Jun 05, 2009 1:51 am    Post subject: Blank Pages in templates_c 0kb files - perm prob Reply with quote

Getting blank pages served (0kb files being created in templates_c)

Here's the situation:
We are setting up a new server (latest smarty stable release 2.6.25) and are having a problem with read/write and owner settings (form smarty template engine created files) that work or don't work depending on the user apache runs as (Due to Verio's [our host ] compile of suexec/apache we have to run apache as "user www group www" and smarty fails this way).

I am using the smarty_test.php and the test class as found here: double-u(3)-dot-phpinsider-dot-com/smarty-forum/viewtopic.php?t=4500 (sorry my user level doesn't permit url's yet)

I receive 2 errors: both are unable to write (to "templates_c" and "cache" directories). The test script creates the file "test_file" in the "cache" and "templates_c" directory and when the test passes it removes the created files. When I receive an error the created files have a user/group of www/www and permissions of 644.

If I do the following to the files that it creates in the above directories and run again then it works:
# chown myUser test_file
# chmod 664 test_file

If I run apache as User/Group of myUser/myUser it works - but this kills our cgi script execution as stated previously.

I have tried setting the SUID/GUID of the directories in question as well as setting umask to 2, but none of that had any effect on the files created in those directories. Is there some dependency I am missing? Why does the test script say it can't write when the files are clearly being created? Have also tried setting the directories to 777 - currently 775 and that has no effect - seems to be primarily a file permissions issue but I am uncertain exactly how smarty creates those files and how to control the process in a place with less effect on the security of my server - in other words without changing how suexec/apache runs . . .

Current Server:

httpd
Server version: Apache/2.2.11 (Unix)
Server built: Jan 6 2009 12:04:11

php
PHP 5.2.9 with Suhosin-Patch 0.9.7 (cli) (built: Mar 16 2009 18:29:43)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies


FYI - Old Server History:
On our old server smarty had been working while running apache as www/www with a user/group of myUser/myUser set in the virtual host section of httpd.conf - some error recently occurred there (no clue what) and smarty stopped working so I set apache to run as user/group of myUser/myUser and now smarty works there - it did not affect our cgi on that server presumably because it is not using suexec, but I am uncertain of all of that servers settings as I did not take part in its configuration. The files of the user directory were originally set to user/group of myUser/www so that is what I have done on the new server - myUser is not a member of www group nor is www a member of myUser group . . .

-- update

set umask to 2 and that part works but then:

I was surprised to get a different result with a simple php write script then with the one smarty forums provided (here: www-dot-phpinsider-dot-com/smarty-forum/viewtopic.php?t=4500).

The one from the link above fails to write, but with a simple php write script (link below) with an already created file - & all the same permissions as the smarty test one I get success. Why would the smarty one fail when I can clearly read and write a file?

The Simple PHP script that writes successfully is from : us3-dot-php-dot-net/manual/en/function.fwrite.php - Example #1 . . .
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP