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.

eZ debug

Timing: Jan 18 2025 19:31:29
Script start
Timing: Jan 18 2025 19:31:29
Module start 'layout'
Timing: Jan 18 2025 19:31:29
Module start 'content'
Timing: Jan 18 2025 19:31:30
Module end 'content'
Timing: Jan 18 2025 19:31:30
Script end

Main resources:

Total runtime0.8691 sec
Peak memory usage4,096.0000 KB
Database Queries81

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 587.9219152.6250
Module start 'layout' 0.00540.0025 740.546939.4453
Module start 'content' 0.00790.8596 779.9922648.5703
Module end 'content' 0.86750.0015 1,428.562528.1563
Script end 0.8690  1,456.7188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3967160.0002
Check MTime0.00150.1726160.0001
Mysql Total
Database connection0.00070.084210.0007
Mysqli_queries0.779789.7126810.0096
Looping result0.00080.0881790.0000
Template Total0.839896.620.4199
Template load0.00240.280220.0012
Template processing0.837396.348820.4187
Template load and register function0.00010.012010.0001
states
state_id_array0.00080.086610.0008
state_identifier_array0.00160.184520.0008
Override
Cache load0.00230.2612610.0000
Sytem overhead
Fetch class attribute can translate value0.00090.102320.0004
Fetch class attribute name0.00200.2318130.0002
XML
Image XML parsing0.00100.113420.0005
class_abstraction
Instantiating content class attribute0.00010.0067220.0000
General
dbfile0.00110.1297260.0000
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
11content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
11content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 40
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs