Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [smarty] problem writing temporary file
rzseattle
post 20.08.2003, 21:49:07
Post #1





Grupa: Przyjaciele php.pl
Postów: 554
Pomógł: 0
Dołączył: 4.04.2002
Skąd: Tychy

Ostrzeżenie: (0%)
-----


no wlasnie po przeniesieniu calej stronki z localhost na serw wyswietla sie komunikat
Kod
Warning: Smarty error: problem writing temporary file 'templates_c/%%501/%%501481606/3f43db05160c3' in /engine/smarty/Smarty.class.php on line 1042

i wlasciwie nie za bardzo wiem co z tym zrobic gdy proboje w total zmienic atrybuty katalogu z 755 na 777 to :
Cytat
SITE chmod 777 templates_c
500 'SITE CHMOD 777 templates_c': command not understood.

moze mi ktos podpowie co z tym mam zrobic


--------------------
"Real children don't go hoppity-skip unless they are on drugs."
Go to the top of the page
+Quote Post
adwol
post 20.08.2003, 21:58:59
Post #2





Grupa: Zarejestrowani
Postów: 691
Pomógł: 0
Dołączył: 6.08.2003

Ostrzeżenie: (0%)
-----


Cytat
Cytat
SITE chmod 777 templates_c
500 'SITE CHMOD 777 templates_c': command not understood.

moze mi ktos podpowie co z tym mam zrobic

Pewnie próbujesz zmieniać prawa via ftp, a na tym serwerze są wyłączone site-komendy. Zaloguj się tam shellowo (jeśli możesz) i popraw, a jak nie możesz to być może nie musisz zmieniać praw w ogóle. FTP u niektórych providerów na stałe ma ustawioną maskę i daje dobre prawa do uploadowanych plików.
Go to the top of the page
+Quote Post
rzseattle
post 20.08.2003, 22:06:50
Post #3





Grupa: Przyjaciele php.pl
Postów: 554
Pomógł: 0
Dołączył: 4.04.2002
Skąd: Tychy

Ostrzeżenie: (0%)
-----


nie moge sie tam zalogowac shellowo - przynajmniej nic mi o tym nie wiadmomo ,, ja chce tylko baby mi smarty w katalogu mogl zapisywac swoje pliki wiec moze jakies konkretniejsze rozwiazanie


--------------------
"Real children don't go hoppity-skip unless they are on drugs."
Go to the top of the page
+Quote Post
spenalzo
post 20.08.2003, 22:16:44
Post #4





Grupa: Zarejestrowani
Postów: 2 064
Pomógł: 1
Dołączył: 22.01.2003
Skąd: Poznań

Ostrzeżenie: (0%)
-----


Może przy pomocy php się da?
[php:1:44b9fde046]<?php
chmod("templates_c",0777);
?>[/php:1:44b9fde046]


--------------------

Go to the top of the page
+Quote Post
FiDO
post 20.08.2003, 22:30:48
Post #5





Grupa: Przyjaciele php.pl
Postów: 1 717
Pomógł: 0
Dołączył: 12.06.2002
Skąd: Wolsztyn..... Studia: Zielona Góra

Ostrzeżenie: (0%)
-----


Ewentualnie usun templates_c, i stworz go skryptem php, bedzie mial ownera tego co apache (i php), wiec wtedy prawa grupy i other nie beda Cie obchodzily.
Go to the top of the page
+Quote Post
rzseattle
post 21.08.2003, 00:27:52
Post #6





Grupa: Przyjaciele php.pl
Postów: 554
Pomógł: 0
Dołączył: 4.04.2002
Skąd: Tychy

Ostrzeżenie: (0%)
-----


Cytat
Ewentualnie usun templates_c, i stworz go skryptem php, bedzie mial ownera tego co apache (i php), wiec wtedy prawa grupy i other nie beda Cie obchodzily.

hmm
[php:1:4c2d3c0d31]<?php
mkdir ("templates_c", 0777);
?>[/php:1:4c2d3c0d31]
to owszem tworzy sie katalog ale z atrybutami 744 cholera normalnie nie wiem co robic


--------------------
"Real children don't go hoppity-skip unless they are on drugs."
Go to the top of the page
+Quote Post
spenalzo
post 21.08.2003, 00:36:07
Post #7





Grupa: Zarejestrowani
Postów: 2 064
Pomógł: 1
Dołączył: 22.01.2003
Skąd: Poznań

Ostrzeżenie: (0%)
-----


Ale w dokumentacji smarty pisze, że można nadać prawa 700.

Cytat
Be sure the "templates_c"
directory is writable by your web server user (usually nobody). chown
nobody:nobody templates_c; chmod 700 templates_c You can also chmod 777 this
directory, but be aware of security issues for multi-user systems.


--------------------

Go to the top of the page
+Quote Post
adwol
post 21.08.2003, 00:40:09
Post #8





Grupa: Zarejestrowani
Postów: 691
Pomógł: 0
Dołączył: 6.08.2003

Ostrzeżenie: (0%)
-----


Cytat
Cytat
Ewentualnie usun templates_c, i stworz go skryptem php, bedzie mial ownera tego co apache (i php), wiec wtedy prawa grupy i other nie beda Cie obchodzily.

hmm
[php:1:9713d8364f]<?php
mkdir ("templates_c", 0777);
?>[/php:1:9713d8364f]
to owszem tworzy sie katalog ale z atrybutami 744 cholera normalnie nie wiem co robic

To wstaw przed tym mkdirem
[php:1:9713d8364f]<?php
umask(0);
?>[/php:1:9713d8364f]
A poza tym zobacz czy takie prawa Ci nie wystarczą. Jeśli masz suexecowanego phpa to nie potrzeba Ci aż dawać uprawnień do zapisu dla wszystkich (0777).
Go to the top of the page
+Quote Post
rzseattle
post 21.08.2003, 00:50:11
Post #9





Grupa: Przyjaciele php.pl
Postów: 554
Pomógł: 0
Dołączył: 4.04.2002
Skąd: Tychy

Ostrzeżenie: (0%)
-----


dobra ja juz poprostu nie wiem o co chodzi - udalosie w koncu stworzyc katalog templates_c z 0777 a
Kod
Warning: Smarty error: problem writing temporary file 'templates_c/%%501/%%501481606/3f440893f32c9' in /engine/smarty/Smarty.class.php on line 1042

moze justro jak na to swiezym okiem spojze to moze mnie olsni bo juz nie mam pojcia co ten blad oznacza


--------------------
"Real children don't go hoppity-skip unless they are on drugs."
Go to the top of the page
+Quote Post
spenalzo
post 21.08.2003, 02:14:03
Post #10





Grupa: Zarejestrowani
Postów: 2 064
Pomógł: 1
Dołączył: 22.01.2003
Skąd: Poznań

Ostrzeżenie: (0%)
-----


Cytat
moze justro jak na to swiezym okiem spojze to moze mnie olsni bo juz nie mam pojcia co ten blad oznacza

Hmmmm... ciekawe.
A Smarty sam wgrywałeś na serwer, czy już było? Spróbuj nadać odpowiedni chmod plikowi smarty.class.php.


--------------------

Go to the top of the page
+Quote Post
DeyV
post 21.08.2003, 09:40:44
Post #11





Grupa: Zarząd
Postów: 2 277
Pomógł: 6
Dołączył: 27.12.2002
Skąd: Wołów/Wrocław




spróbuj ustawić $smarty->use_sub_dirs = false;

oraz poczytaj: http://www.phpinsider.com/smarty-forum/vie...topic.php?t=272


--------------------
"Niezależnie od tego, jakie masz osiągnięcia, ktoś Ci pomaga..."
Go to the top of the page
+Quote Post
rzseattle
post 21.08.2003, 10:08:09
Post #12





Grupa: Przyjaciele php.pl
Postów: 554
Pomógł: 0
Dołączył: 4.04.2002
Skąd: Tychy

Ostrzeżenie: (0%)
-----


Cytat
spróbuj ustawić $smarty->use_sub_dirs = false;

oraz poczytaj:http://www.phpinsider.com/smarty-forum/viewtopic.php?t=272

dzieki DeyV pooglo jak cholera


--------------------
"Real children don't go hoppity-skip unless they are on drugs."
Go to the top of the page
+Quote Post
DeyV
post 21.08.2003, 10:11:44
Post #13





Grupa: Zarząd
Postów: 2 277
Pomógł: 6
Dołączył: 27.12.2002
Skąd: Wołów/Wrocław




możesz też skorzystać z funckji mojego autorstwa, która mimo ograniczeń po stronie serwera radzi sobie z tworzeniem folderów:
[php:1:17c89d1c6a]<?php
require_once 'Smarty.class.php';

class SmartyE extends Smarty{


/**
* This forces templates to compile every time. Useful for development
* or debugging.
*
* @var boolean
*/
var $force_compile = false;



#var $_dir_perms = 0777;
#var $_file_perms = 0777;

/**
* create full directory structure
*
* @param string $dir
*/
function _create_dir_structure($dir)
{
if (!file_exists($dir)) {
$_open_basedir_ini = ini_get('open_basedir');

if ( $_open_basedir_ini) {
if ($_no_pre_dir = stristr ($dir, $_open_basedir_ini) ){

$_open_basedir_ini_count = strlen($_open_basedir_ini);
$_no_pre_dir_count = strlen ($_no_pre_dir);
$dir = substr($_no_pre_dir, $_open_basedir_ini_count - $_no_pre_dir_count);
}
}

$_dir_parts = preg_split('!'.DIR_SEP.'+!', $dir, -1, PREG_SPLIT_NO_EMPTY);

$_new_dir = ($dir{0} == DIR_SEP) ? DIR_SEP : '';

foreach ($_dir_parts as $_dir_part) {
$_new_dir .= $_dir_part;

if (!is_dir($_new_dir) and !@mkdir($_new_dir, $this->_dir_perms)) {
$this->trigger_error("problem creating directory "$dir"");
return false;
}
$_new_dir .= DIR_SEP;
}
}
}

}//class SmartyE
?>[/php:1:17c89d1c6a]

wykorzystanie : $smarty = new SmartyE;


--------------------
"Niezależnie od tego, jakie masz osiągnięcia, ktoś Ci pomaga..."
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 18.07.2025 - 01:36