Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

RE: [SMARTY] Upgrade to debian testing breaks smarty sites
Yes, that correctly outputs the contents of the file.

Similarly, replacing:

$smarty->display('index.tpl');

With

$smarty->display($smarty->template_dir . '/index.tpl');

works (for the test script, not my apps, but one step at a time!)

Hum. Somehow the template_dir variable is getting 'lost'?

Ben

-----Original Message-----
From: Monte Ohrt [mailto:monte@newdigitalgroup.com]=20
Sent: 14 April 2005 15:55
To: Sims, Benjamin
Cc: Smarty
Subject: Re: [SMARTY] Upgrade to debian testing breaks smarty sites


See if you can read the index.tpl file:

readfile($smarty->template_dir . '/index.tpl');





Sims, Benjamin wrote:

>Thanks,
>=20
>I don't think it is an include problem, since the error is being thrown

>from smarty itself.
>=20
>I tried adding to the include path as you mention, but result is the=20
>same.
>=20
>Ben
>
>-----Original Message-----
>From: Riviere Informatique SARL [mailto:svdb@rivinfo.com]
>Sent: 14 April 2005 15:12
>To: Sims, Benjamin
>Cc: smarty-general@lists.php.net
>Subject: Re: [SMARTY] Upgrade to debian testing breaks smarty sites
>
>
>Ah. Maybe you should include the following line in your php.ini
>(/etc/php4/apache/php.ini)
>include_path =3D "/usr/share/php/smarty/libs"
>
>That way you don't need to add a complete path in your include but can=20
>just do
>include('Smarty.class.php')
>
>There's loads of other programs in that directory that Smarty probably=20
>needs. Don't forget to stop/start your apache after this.
>
>I'm running this on Debian unstable and it runs fine.
>
>Regards,
>Steven.
>
>Sims, Benjamin wrote:
>
>Thanks, it is www-data but this is what it was before. I have set up=20
>the
>
>following simple script as a test:
>
>
>
>//php code -----------------------------------------------------------
>
><?php
>
>include('/usr/share/php/smarty/libs/Smarty.class.php');
>
>
>
>// create object
>
>$smarty =3D new Smarty;
>
>
>
>//config
>
>$smarty->template_dir =3D
>
>'/var/www/ioc3.unesco.org/www/apps/test/templates/';
>
>$smarty->compile_dir =3D
>
>'/var/www/ioc3.unesco.org/www/apps/test/templates_c/';
>
>$smarty->cache_dir =3D '/var/www/ioc3.unesco.org/www/apps/test/cache/';
>
>$smarty->config_dir =3D=20
>'/var/www/ioc3.unesco.org/www/apps/test/configs/';
>
>
>
>// display it
>
>$smarty->display('index.tpl');?>
>
>//end code -----------------------------------------------------------
>
>
>
>The index.tpl file contains only:
>
>
>
>'This is a test'
>
>
>
>I have also executed (to be sure):
>
>
>
>Chown -R www-data /var/www/myserver.com/www/apps/test
>
>Chmod 777 -r /var/www/myserver.com/www/apps/test
>
>
>
>
>
>Still cannot read resource! Is there any way I can alter Smarty.class=20
>to
>
>get a full path/name for the template it is going for?
>
>
>
>Ben
>
>
>
>
>
>
>
>-----Original Message-----
>
>From: Riviere Informatique SARL [mailto:svdb@rivinfo.com]
>
>Sent: 14 April 2005 14:07
>
>To: Sims, Benjamin
>
>Cc: smarty-general@lists.php.net
>
>Subject: Re: [SMARTY] Upgrade to debian testing breaks smarty sites
>
>
>
>
>
>Hi Benjamin,
>
>
>
>Check the access rights on the template directories and files. The user
>
>running your apache server may have changed. Go to /etc/apache and=20
>check
>
>the values of 'User' and 'Group' in the
>
>httpd.conf file (I believe the default is www-data).
>
>(Or do a 'ps -ef | grep apache')
>
>
>
>Regards,
>
>Steven.
>
>
>
>Sims, Benjamin wrote:
>
>
>
> =20
>
>I've had a rather catastrophic failure upgrading from Debian stable to
>
>testing (ie to PHP 4.3.3 and apache 1.3).
>
>
>
>I now receive a "Warning: Smarty error: unable to read resource:
>
>"index.tpl" in /usr/share/php/smarty/libs/Smarty.class.php on line
>
>1088" when accessing the home page.
>
>
>
>The templates are in the same place as before, but it seems they can no
>
>   =20
>
>
>
> =20
>
>longer be read.
>
>
>
>Any ideas much appreciated!
>
>
>
>Benjamin
>
>
>
>=20
>
>
>
>   =20
>
>
>
> =20
>
>
>
>
>
>
>!DSPAM:425e72da181122378111414!
>
> =20
>

Report this thread to moderator Post Follow-up to this message
Old Post
Benjamin Sims
04-14-05 09:00 PM


RE: [SMARTY] Upgrade to debian testing breaks smarty sites
Did you clear out your old compiled and cached files? I don't think I
saw whether you upgraded Smarty or not. What exact versions are you
using? Do your broken apps use template_dir or did they rely on a path
for template fetching (doesn't work anymore in more recent Smarty
versions)?

xo boots

--- "Sims, Benjamin" <B.Sims@unesco.org> wrote:

> Yes, that correctly outputs the contents of the file.
>
> Similarly, replacing:
>
> $smarty->display('index.tpl');
>
> With
>
> $smarty->display($smarty->template_dir . '/index.tpl');
>
> works (for the test script, not my apps, but one step at a time!)
>
> Hum. Somehow the template_dir variable is getting 'lost'?
>
> Ben
>
> -----Original Message-----
> From: Monte Ohrt [mailto:monte@newdigitalgroup.com]
> Sent: 14 April 2005 15:55
> To: Sims, Benjamin
> Cc: Smarty
> Subject: Re: [SMARTY] Upgrade to debian testing breaks smarty sites
>
>
> See if you can read the index.tpl file:
>
> readfile($smarty->template_dir . '/index.tpl');
>
>
>
>
>
> Sims, Benjamin wrote:
> 
> thrown
> 
> 
> can 
> probably 
> 
> ----------------------------------------------------------- 
> '/var/www/ioc3.unesco.org/www/apps/test/cache/'; 

Report this thread to moderator Post Follow-up to this message
Old Post
Boots
04-14-05 09:00 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Smarty Templates archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:06 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.