compile problems from non-newbie

From: Date: Wed, 19 Feb 2003 03:11:55 +0000
Subject: compile problems from non-newbie
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-7855@lists.php.net to get a copy of this message
Hello Everyone, I've been running Smarty for about 6 months now without any problem at all on a number of sites. It's been in use on an intranet site for the past two months, and had no problems until I went to change a single page. When I did this, I deleted all files in templates_c to reinvoke compilation of all pages (maybe a wrong move?) As soon as I did this, no pages would compile. The first problem was the following: Warning: Smarty error: problem creating directory "/home/cservice/public_html/htdocs/smarty/templates_c/%%183/%%1836865061" in /usr/local/lib/php/smarty/Smarty.class.php on line 999 Warning: Smarty error: problem writing '/home/cservice/public_html/htdocs/smarty/templates_c/%%183/%%1836865061/tes t.tpl.php.' in /usr/local/lib/php/smarty/Smarty.class.php on line 999 My Slackware linux server (Apache 1.3.27,php 4.3.0) appears to suddenly not be able to create these directories. Since I first set up this Smarty-based system, I have upgraded from php 4.2 to 4.3 -- would that affect anything? In case something happened with permissions, I've gone overboard and chmodded to 777 everything, along with a chown to nobody:nobody to no avail. PHP/Smarty just can't create multiple directories at once! My next step was to disable subdirs, hoping that it could at least write to the basic templates_c directory, and it did with some success. That is, every file it created was empty. No errors appeared, but each time I went to call a script (I dummied it down to a simple "Hello {$name}" type script), nothing would compile, and thus nothing would come up on the screen. Strangely, the only way I've been able to compile is by the php -q filename.php function -- since the site requires hundreds of database calls a day though, this is not a solution. I've even used the same script over on a Redhat 7.1/PHP4.1 system, to try and replicate my problems, but got different errors still. Even though in all cases I've used full paths, and both templates and templates_c are under the same directory, on this system Smarty is trying to create a compiled directory such as:"/%%962/%%962176964" instead of from a proper path: Warning: MkDir failed (Permission denied) in /usr/local/lib/php/smarty/Smarty.class.php on line 1604 Warning: Smarty error: problem creating directory "/%%962/%%962176964" in /usr/local/lib/php/smarty/Smarty.class.php on line 589 Warning: Smarty error: problem writing '/%%962/%%962176964/test.tpl.php.' in /usr/local/lib/php/smarty/Smarty.class.php on line 589 Warning: Failed opening '/%%962/%%962176964/test.tpl.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr/local/lib/php/smarty/Smarty.class.php on line 686 (one more thing to show...) I've finally broken down, forgotten about the extended setup, and created a test file with the following contents: test.php: <?php require('/usr/local/lib/php/smarty/Smarty.class.php'); $smarty = new Smarty; $smarty->template_dir = '/home/cservice/public_html/htdocs/smarty/templates/'; $smarty->compile_dir = '/home/cservice/public_html/htdocs/smarty/templates_c/'; $smarty->assign('te','Tesssssst'); $smarty->display('test.tpl'); ?> test.tpl: <html><body> This is a {$te} </body></html But of course, I've still got errors (special not of the double "//" that I get every time I declare the compile directory to have a slash at the end... if I remove the slash, the same errors appear though): Warning: Smarty error: problem creating directory "/home/cservice/public_html/htdocs/smarty/templates_c//%%183/%%1836865061" in /usr/local/lib/php/smarty/Smarty.class.php on line 999 Warning: Smarty error: problem writing '/home/cservice/public_html/htdocs/smarty/templates_c//%%183/%%1836865061/te st.tpl.php.' in /usr/local/lib/php/smarty/Smarty.class.php on line 999 Warning: touch() [function.touch]: Unable to create file /home/cservice/public_html/htdocs/smarty/templates_c//%%183/%%1836865061/tes t.tpl.php because No such file or directory in /usr/local/lib/php/smarty/Smarty.class.php on line 1518 Warning: fetch(/home/cservice/public_html/htdocs/smarty/templates_c//%%183/%%18368650 61/test.tpl.php) [function.fetch]: failed to create stream: No such file or directory in /usr/local/lib/php/smarty/Smarty.class.php on line 1112 (My apologies for the length of description) I've used the extended setup in the installation guide, and followed everything to a "T" with both Smarty 2.3.1 and 2.4.2. If someone -- anyone could help me with some tips, I would appreciate it as I've been working on this 12 solid hours with nothing to show for it. Thanks in advance! Charlie

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