problem with ezurl and siteacces

Author Message

Marko Žmak

Monday 26 June 2006 2:46:46 am

I'm experiencing some problems with ezurl() when using template cache. I acces my eZ installation like this:

http://example.com/mysite/index.php

so eZ is located under http://myserver/mysite/ and NOT in the root of my server. I'm using "myaccess" siteacces. I tried to output a link like this:

<A HREF="content/view/full/2"|ezurl()}>Link text</A>

When I use template cache and template compile I get this "Link text" pointing to:

http://example.com/mysite/content/view/full/2

and when the template cache is off I get this:

http://example.com/mysite/index.php/myaccess/content/view/full/2

So it seems to me that ezurl() behaves wrong when template cache is on. Is this a bug or there's something I missed?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Łukasz Serwatka

Tuesday 27 June 2006 12:12:04 am

In the xhtml code you have tpl parse error, but I guess this is only quick example. Do you have ForceVirtualHost parameter enabled? Have you tired to clear the cache manually after template compile is on? Works fine here.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Marko Žmak

Tuesday 27 June 2006 12:48:21 am

Yes this error was just a typo in the example.

Yes, I also cleared the cache manually and it didn't help.

No I DON'T have ForceVirtualHost enabled, should I enable it?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Marko Žmak

Tuesday 27 June 2006 12:49:33 am

P.S. What exactly do you mean by "Works fine here."? Could you give me an example that's configured the same way as my site and it works ok?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Łukasz Serwatka

Tuesday 27 June 2006 12:53:22 am

I have installed "plain" 3.8.1 in the subdirectory of root folder in non-VH setup and ezurl() returns correct path with siteaccess and index.php. I can't reproduce yout error. Can you please try on the new clean installation and try to reproduce it?

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Łukasz Serwatka

Tuesday 27 June 2006 1:01:52 am

More info:

settings/override/site.ini.append.php
[ContentSettings]
ViewCaching=enabled
PreViewCache=enabled

[TemplateSettings]
TemplateCache=enabled
TemplateCompile=enabled
TemplateOptimization=enabled

Code used in pagelayout.tpl

<a href={"/news"|ezurl}>News</a>

Output:

http://localhost/test38x/index.php/plain_site/news

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Marko Žmak

Tuesday 27 June 2006 1:16:56 am

Hm... Now that I look again at the site after two days it seems that it works OK...

I'm really puzzled, I didn't change anything in the config from the last time I checked the site...?????

It seems like there's some timeout after clearing the cache, even when the cache directory is deleted manually. This thing occured to me a few other times... I cleared the cache, and also deleted it manually but the changes started to work only when I looked at the site after a day or two... It happened only a few times and I couldn't catch what induced such behaviour.

Is there a reasonable explanation for this or is my site having ghosts?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Łukasz Serwatka

Tuesday 27 June 2006 1:20:25 am

Do you have PHP Accelerator enabled? Difficult to say why you experienced this.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Marko Žmak

Tuesday 27 June 2006 6:08:01 am

Yes I have ezaccelerator. Maybe this could be the answer.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Marko Žmak

Saturday 01 July 2006 3:25:06 pm

I discovered what were "the gosths" on my site...

When I enable TemplateCompile and clear the cache everything is working OK. But if I call bin/php/eztc.php after clearing the cache and before I look my site in the browser, then the problem I described in the first post occurs.

When I think about this it seems natural, because the eztc.php script is run from the shell so it cannot guess how my site is accesed from the outside. So I tried using --access-path argument when executing eztc.php. First I executed it with:

--access-path=mysite

but then all the links were generated without index.php. After that I executed it with:

--access-path=mysite/index.php

and it worked OK. Is this normal behaviour? Since eztc.php and --access-path aren't documented anywhere I can't tell.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Marko Žmak

Saturday 01 July 2006 3:40:44 pm

It seems that using --access-path is not thw right sollution. When I use it links (by using ezurl()) are generated OK but the images are not displayed correctly because their urls are generated with ezdesign() operator. So the right sollution is to use:

--www-dir=/mysite

With this argument it works OK. But also, when I use this argument the index.php disapeares from links. This is actually a nice thing but could someone tell me if this is expected behavour?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.