Re: [SMARTY] OS X issues?
| From: | Monte Ohrt | Date: | Tue, 30 Apr 2002 18:06:56 +0000 |
| Subject: | Re: [SMARTY] OS X issues? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-3937@lists.php.net to get a copy of this message | ||
We installed it on an Max OS X box here at the office. After making the template_c directory owned by www:www, it worked fine. (?)
Monte
Ed Finkler wrote:
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: /*======================================================================*\-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.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!