PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.smarty.general > Problem when moving directories
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Problem when moving directories

Réponse
 
LinkBack Outils de la discussion
Vieux 01/05/2006, 21h22   #1
Tony K.
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Problem when moving directories

I have been developing a website using smarty on my local (linux)
server. It has been working OK so far. I have a file called setup.php
which includes:

************************************************** *
define('SMARTY_DIR', '/usr/share/php/smarty/libs/');
require(SMARTY_DIR . 'Smarty.class.php');

class Smarty_Test extends Smarty {

function Smarty_Website(){

$this->Smarty();
$this->template_dir = '/var/www/html/foobar/public_html/templates';
$this->compile_dir = '/var/www/html/foobar/public_html/templates_c';
$this->config_dir = '/var/www/html/foobar/public_html/configs';
$this->cache_dir = '/var/www/html/foobar/public_html/cache';

$this->caching = true;
$this->assign('app_name', 'test');
}
}
************************************************** *

This file is required() by the index.php page.

However, when I tried moving all the directories (cache, config,
template, template_c) and associated files except the index.php page
to one level above public_html (../) I get the following error
message:

(Warning: Smarty error: unable to read resource: "type1.tpl" in
/usr/share/php/smarty/libs/Smarty.class.php on line 1088)

"type1.tpl" is my index.tpl page.

I changed the references from...

$this->template_dir = '/var/www/html/foobar/public_html/templates';
$this->compile_dir = '/var/www/html/foobar/public_html/templates_c';
$this->config_dir = '/var/www/html/foobar/public_html/configs';
$this->cache_dir = '/var/www/html/foobar/public_html/cache';

to...
$this->template_dir = '/var/www/html/foobar/templates';
$this->compile_dir = '/var/www/html/foobar/templates_c';
$this->config_dir = '/var/www/html/foobar/configs';
$this->cache_dir = '/var/www/html/foobar/cache';

Is there another configuration that needs to be changed that I am not
thinking about? Again, this works fine before trying to move the
directories.

Any ideas?
  Réponse avec citation
Vieux 01/05/2006, 22h42   #2
Danilo Buerger
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Problem when moving directories

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Permissions set correctly?

Tony K. schrieb:
> I have been developing a website using smarty on my local (linux)
> server. It has been working OK so far. I have a file called setup.php
> which includes:
>
> ************************************************** *
> define('SMARTY_DIR', '/usr/share/php/smarty/libs/');
> require(SMARTY_DIR . 'Smarty.class.php');
>
> class Smarty_Test extends Smarty {
>
> function Smarty_Website(){
>
> $this->Smarty();
> $this->template_dir = '/var/www/html/foobar/public_html/templates';
> $this->compile_dir =
> '/var/www/html/foobar/public_html/templates_c';
> $this->config_dir = '/var/www/html/foobar/public_html/configs';
> $this->cache_dir = '/var/www/html/foobar/public_html/cache';
>
> $this->caching = true;
> $this->assign('app_name', 'test');
> }
> }
> ************************************************** *
>
> This file is required() by the index.php page.
>
> However, when I tried moving all the directories (cache, config,
> template, template_c) and associated files except the index.php page
> to one level above public_html (../) I get the following error
> message:
>
> (Warning: Smarty error: unable to read resource: "type1.tpl" in
> /usr/share/php/smarty/libs/Smarty.class.php on line 1088)
>
> "type1.tpl" is my index.tpl page.
>
> I changed the references from...
>
> $this->template_dir = '/var/www/html/foobar/public_html/templates';
> $this->compile_dir =
> '/var/www/html/foobar/public_html/templates_c';
> $this->config_dir = '/var/www/html/foobar/public_html/configs';
> $this->cache_dir = '/var/www/html/foobar/public_html/cache';
>
> to...
> $this->template_dir = '/var/www/html/foobar/templates';
> $this->compile_dir = '/var/www/html/foobar/templates_c';
> $this->config_dir = '/var/www/html/foobar/configs';
> $this->cache_dir = '/var/www/html/foobar/cache';
>
> Is there another configuration that needs to be changed that I am not
> thinking about? Again, this works fine before trying to move the
> directories.
>
> Any ideas?
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEVoDFtyx3EHt/UjARAr71AJ90Mdb98G7tJfxbuOgj7ici9nKKfwCfTr1R
sB8GNhfHrsWqa8a9Ktvyrno=
=PxH1
-----END PGP SIGNATURE-----
  Réponse avec citation
Vieux 02/05/2006, 00h56   #3
Jochem Maas
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Problem when moving directories

Tony K. wrote:
> I have been developing a website using smarty on my local (linux)
> server. It has been working OK so far. I have a file called setup.php
> which includes:
>
> ************************************************** *
> define('SMARTY_DIR', '/usr/share/php/smarty/libs/');
> require(SMARTY_DIR . 'Smarty.class.php');
>
> class Smarty_Test extends Smarty {
>
> function Smarty_Website(){
>
> $this->Smarty();
> $this->template_dir = '/var/www/html/foobar/public_html/templates';
> $this->compile_dir =
> '/var/www/html/foobar/public_html/templates_c';
> $this->config_dir = '/var/www/html/foobar/public_html/configs';
> $this->cache_dir = '/var/www/html/foobar/public_html/cache';


I suggest you make the above self-determining or at least define a
constant like SMARTY_DIR in your config to point to the root of your
smarty data dirs.

> $this->caching = true;
> $this->assign('app_name', 'test');
> }
> }
> ************************************************** *
>
> This file is required() by the index.php page.
>
> However, when I tried moving all the directories (cache, config,
> template, template_c) and associated files except the index.php page


I assume that your not moving the files in cache and templates_c - I'd
let them be auto-regenerated.

the permissions, as someone else pointed out, is a good point to consider.
  Réponse avec citation
Vieux 02/05/2006, 02h10   #4
Tony K.
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Problem when moving directories

Thanks for all the input.

I think I may have figured out my problem. The function
"Smarty_Website" is a constructor and needs to be the same name as the
class "Smarty_Test", which it is not. I changed the names to be the
same and it now appears to locate the moved directories.

I still have a problem with the permissions, and must set the
directories (cache and templete_c) to 777. The documentation
suggests that I can use 775, but my user and group are assigned to my
user account and not the web-server user name.

On 5/1/06, Tony K. <tony.kruse@gmail.com> wrote:
> I have been developing a website using smarty on my local (linux)
> server. It has been working OK so far. I have a file called setup.php
> which includes:
>
> ************************************************** *
> define('SMARTY_DIR', '/usr/share/php/smarty/libs/');
> require(SMARTY_DIR . 'Smarty.class.php');
>
> class Smarty_Test extends Smarty {
>
> function Smarty_Website(){
>
> $this->Smarty();
> $this->template_dir = '/var/www/html/foobar/public_html/templates';
> $this->compile_dir = '/var/www/html/foobar/public_html/templates_c';
> $this->config_dir = '/var/www/html/foobar/public_html/configs';
> $this->cache_dir = '/var/www/html/foobar/public_html/cache';
>
> $this->caching = true;
> $this->assign('app_name', 'test');
> }
> }
> ************************************************** *
>
> This file is required() by the index.php page.
>
> However, when I tried moving all the directories (cache, config,
> template, template_c) and associated files except the index.php page
> to one level above public_html (../) I get the following error
> message:
>
> (Warning: Smarty error: unable to read resource: "type1.tpl" in
> /usr/share/php/smarty/libs/Smarty.class.php on line 1088)
>
> "type1.tpl" is my index.tpl page.
>
> I changed the references from...
>
> $this->template_dir = '/var/www/html/foobar/public_html/templates';
> $this->compile_dir = '/var/www/html/foobar/public_html/templates_c';
> $this->config_dir = '/var/www/html/foobar/public_html/configs';
> $this->cache_dir = '/var/www/html/foobar/public_html/cache';
>
> to...
> $this->template_dir = '/var/www/html/foobar/templates';
> $this->compile_dir = '/var/www/html/foobar/templates_c';
> $this->config_dir = '/var/www/html/foobar/configs';
> $this->cache_dir = '/var/www/html/foobar/cache';
>
> Is there another configuration that needs to be changed that I am not
> thinking about? Again, this works fine before trying to move the
> directories.
>
> Any ideas?
>

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 20h04.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11981 seconds with 12 queries