Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Invisible web site
Goto page Previous  1, 2
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
CirTap
Smarty Pro


Joined: 04 Jun 2003
Posts: 106

PostPosted: Tue Aug 05, 2003 9:07 pm    Post subject: Reply with quote

I ran into similar problems when I uploaded my perfectly running site from my local windoze to a *nix box:
realpath(), which Smarty uses appears to be either broken in win/*nix or the OS just behave different by design.

At least on "my" server realpath() always removed the last directory name, so that "/my/web/root" became "/my/web'. I added the trailing slash inthe input string and things went fine, of course the returnd string had the trailing slash removed %-|
I played for hours removing and adding slashed to every *_dir Smarty wants.
Also check the safe_mode and use_dir settings of PHP. If they are active, realpath() behaves different and returns an empty string if you got lost with concatenating paths or if it contains double slashes //
realpath() (or Smarty) are pretty picky about this...

This line
Code:
if (substr(realpath($resource_name),0, strlen(realpath($curr_dir))) == realpath($curr_dir))

which appears in _is_trusted() and _is_secure() is a killer.

I reccomend a simple[php:1:f1679ab09d]echo "<xmp>";
print_r($smarty);
echo "<xmp>";
// $smarty->display('...');[/php:1:f1679ab09d]
and check everything that smells like a path to be perfectly shaped, no //, no \ / mix, and either ALL with a trailing / or none. The latter seems to be OS and PHP version dependand. In other words: realpath() really sucks!
I finally wrote my own function to create relative paths.

Hope this helps.

CirTap
Back to top
View user's profile Send private message
Reformed
Smarty Rookie


Joined: 16 Jul 2003
Posts: 24

PostPosted: Tue Aug 05, 2003 9:22 pm    Post subject: Reply with quote

I appriciate all of the help with this issue. I have finally figured it out and now I need to kick myself.....really hard. I found that I have been developing on my desktop box without a ConfigClass. Since I use a lib directory in my application that I store Smarty in, I have been able to work without one because my scripts call for Smarty.class.php with no slashes or anything, so PHP was going into my include directory for the Config class, so I have actually been working out of the Smarty class that is in my php include path (all the while thinking I was working out of the lib directory) on my desktop machine.

When I moved the site to my latptop (and probably my windows box) I didn't have Smarty in my php include path, so my laptop could not find a ConfigLoad class. Once I put a Config class in my lib directory, my site magically re-appeard, I got stoked and then proceded to proclaim what an idiot I am out loud (my coligues gave me funny looks). The one catch is that Smarty did not report a file not found error wich would have made this a non-issue. And so the dilemma is resolved. Thanks everyone for your help. Embarassed Embarassed
Back to top
View user's profile Send private message Send e-mail
Reformed
Smarty Rookie


Joined: 16 Jul 2003
Posts: 24

PostPosted: Sat Sep 06, 2003 11:15 pm    Post subject: Reply with quote

I started this thread a while back, but I never solved the problem and now I'm forced to deal with it again because now I have to work on a Windows box. As before I have all permissions correct, file paths are correct, and this very web-application works on a Linux box and an OS X box.

When I call up one of my scripts I get either a blank page or an error that says: touch(): Utime failed: Invalid argument in c:\inetpub\wwwroot\lib\Smarty.class.php on line 1284

The templates_c directory is recieving compiled files, but they are blank and have 0 size. It seems like some sort of Smarty compilation issue. I read the Smarty FAQ and it mentioned some problems and a fix for and older version of Smarty known to have problems on W2k Server (which is what I'm using), but the line of code to fix is not in the newer version of Smarty.

I'm using IIS 5, Windows 2000 Server, PHP 4.3.3, and the latest version of Smarty.
Back to top
View user's profile Send private message Send e-mail
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Sat Sep 06, 2003 11:29 pm    Post subject: Reply with quote

@reformed: it sounds like perhaps a file naming issue? Are you using platform specific directory separators when you setup Smarty? I have W2K box w/PHP 4.3.3 and Apache 1.3.28 that works great. I wonder if this is an IIS problem. Out of curiousity, are you using the php isapi module or the cgi/fastcgi with the IIS? What happens when you run your smarty app through the CLI?

You sure are lucky, huh? Wink
Back to top
View user's profile Send private message
Reformed
Smarty Rookie


Joined: 16 Jul 2003
Posts: 24

PostPosted: Sun Sep 07, 2003 12:55 am    Post subject: Reply with quote

I'm pretty sure I'm using the isapi version. I downloaded it from the PHP.net site and it's the installer so I'm thinking that's the ispai.

As far as the directory goes, I'm running out of the wwwroot directory under IIS.

I must admit, strange as it may be, that I'm a windows newbie so I'm not sure what a CLR is (common language runtime?). Man o man. Maybe I should just give apache a try. Shocked
Back to top
View user's profile Send private message Send e-mail
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Sun Sep 07, 2003 1:41 am    Post subject: Reply with quote

On windows, CLR is .NET lingo for the Common Language Runtime--which shouldn't have anything to do with what is going on, though. In my post, I was referring to the CLI (command line interface) of PHP as opposed to the normal cgi/isapi web environments--that was to let you run your app (and test your Smarty setup) from the command line without the web server influence (if any).

BTW, I obviously think Apache is a good choice Smile

Oh yeah, I hate to ask, but you did clear out the cache and templates_c directories after you migrated the app, yes?
Back to top
View user's profile Send private message
Reformed
Smarty Rookie


Joined: 16 Jul 2003
Posts: 24

PostPosted: Sun Sep 07, 2003 6:13 am    Post subject: Reply with quote

I did clear out my templates_c directory this time Rolling Eyes . Well I tried Apache and I had many problems setting it up, but I plan to use it if I can't get IIS to work ( I prefer it too).

I did find that I'm using the fast cgi version of PHP though. I guess I'll have to fiddle with it for a while and see what happens. I will be sure to post the solution if I find it. The night is young and I'm determined to get this thing workint Very Happy
Back to top
View user's profile Send private message Send e-mail
Reformed
Smarty Rookie


Joined: 16 Jul 2003
Posts: 24

PostPosted: Sun Sep 07, 2003 7:46 am    Post subject: Reply with quote

Well, I got Apache all set up with php and I have the same problem Crying or Very sad . Blank pages are all I get on my pages, but one of them shows up with that same error message. What permissions do you have set on your htdocs directory? I set access to everyone with full read write access. This is a very strange problem.
Back to top
View user's profile Send private message Send e-mail
Reformed
Smarty Rookie


Joined: 16 Jul 2003
Posts: 24

PostPosted: Tue Sep 09, 2003 1:22 am    Post subject: Reply with quote

What does it mean if Smarty is not compiling at all. My templates_c directory (under apache) is empty and Smarty is not compiling at all now. Any suggestions?
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP