Re: [SMARTY] OS X issues?

From: Date: Thu, 02 May 2002 14:47:12 +0000
Subject: Re: [SMARTY] OS X issues?
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-3990@lists.php.net to get a copy of this message
Hi, Thanks for your help. I changed $template_dir to './templates_c' but sadly no joy. My web root is Mac OS X's version of public_html /Users/ben/Sites/. Smarty is installed in another folder that is in my include_path (along with PEAR), the templates, templates_c and configs folder and my test PHP file are in my working dir, /Users/ben/Sites/Smarty. Hitting http://localhost/~ben/Smarty results in the errors as before. I just thought I 'd go through everything in case I've made some stupid mistake. Ben On Thursday, May 2, 2002, at 03:39 PM, Monte Ohrt wrote:
*) make sure that templates_c exists in your include path. Also make sure that "." is in your include_path (or change $template_dir to "./templates_c" or "/absolute/path/to/templates_c") *) make sure templates_c is writable by the web server user. Ben Godfrey wrote:
Hi, I installed Smarty on my OS X machine yesterday. I similarly tried every permutation of access privileges. The errors I get are: Warning: stat failed for templates_c/117/1172603085/0.php (errno=13 - Permission denied) in /System/Library/PHP/Smarty.class.php on line 858 Warning: Smarty error: problem writing 'templates_c/117/1172603085/0.php.' in /System/Library/PHP/Smarty.class.php on line 546 Warning: Failed opening 'templates_c/117/1172603085/0.php' for inclusion (include_path='.:/System/Library/PHP') in /System/Library/PHP/Smarty.class.php on line 641 There were more than that, but I seem to have lost some. Anyway, I'm using Marc Liyanage's build of PHP 4.2.0 (http://www.entropy.ch/software/macosx/php/). He did some patching to the source to make it build. I haven't tried the Fink PHP version, or the last Apple release but I probably could do if this remains a bugger. Thanks, Ben Godfrey On Thursday, May 2, 2002, at 10:41 AM, Dominique Peretti wrote:
I've been using Smarty on OS X for months and don't have any problem. What messages do you get ?
I'm curious to know if anyone has attempted using Smarty under OS X. Yesterday, I attempted to set Smarty up under PHP 4.2.0 on my TiBook running OS X. I followed the Quickstart instructions closely, setting the permissions and ownership for the template_c directory to 700/www:www, respectively (Apache on OS X runs as the www user by default). When I tried to view the example described in the Quickstart file, though, I got a ton of permission errors on the stat and mkdir commands. I checked in template_c, and found that the subdirectories that it was producing appeared to have *no* permissions set. I tried pretty much any permutation I could think of to let Smarty write in there, including a chmod on the dir to 777, and changing the _create_dir_structure fuction to make sure the umask is zeroed out: /*==================================================================== == *\ Function: _create_dir_structure Purpose: create full directory structure \*==================================================================== == */ function _create_dir_structure($dir) {
       if (!file_exists($dir)) {
           $dir_parts = preg_split('!/+!', $dir, -1, PREG_SPLIT_NO_EMPTY);
           $new_dir = ($dir{0} == '/') ? '/' : '';
           foreach ($dir_parts as $dir_part) {
               $new_dir .= $dir_part;
               echo "Setting umask to 0000<br>";
               $old_umask = umask(0000); // eliminate umask and backup
existing setting
               if (!file_exists($new_dir) && !mkdir($new_dir, 0771)) {
                   $this->trigger_error("problem creating directory
\"$dir\"");
                   return false;
               }
               echo "Setting umask back to $old_umask<br>";
               umask($old_umask); // restore existing umask setting
               $new_dir .= '/';
           }
       }
} This didn't seem to help. However, if I set up the Quickstart examples under a Linux server running PHP 4.1.2, it works without a hitch. The TiBook is behind a tight firewall, so I saved the OS X-serverd page in question (with a dump of the $smarty class instance's properties, as well as a phpinfo() dump) to: http://www-test.cerias.purdue.edu/smarty.php.html Thanks in advance! -- Ed Finkler Web and Security Archive Administrator CERIAS - Purdue University http://www.cerias.purdue.edu/ v: 765.496.6771 f: 764.496.3181 -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc. -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


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