Re: Help - Multiple Apps, Shared Core, Dispatch Errors - CakePHP 2.0.3

2011-11-21 Thread majna
Or use

'prefix' => Inflector::slug(APP_DIR)

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Help - Multiple Apps, Shared Core, Dispatch Errors - CakePHP 2.0.3

2011-11-20 Thread sotin
Thank you Andras, that did the trick! APC back up and running and
requests are being dispatched to the proper controllers in each app.

You can ignore my other reply, I hadn't read your suggestion yet.

On Nov 21, 1:55 am, Andras Kende  wrote:
> I had similar issue before, that was tracked down to APC mixing up things
> Resolved by changing each site cache prefix in core.php :
>
> Cache::config('_cake_core_', array(
>         'prefix' => 'domain1.com_cake_core_',
>
> Cache::config('_cake_model_', array(
>         'prefix' => 'domain1.com_cake_core_',
>
> Andras Kende
>
> On Nov 21, 2011, at 12:39 AM, sotin wrote:
>
>
>
>
>
>
>
> > Hello,
>
> > I'm hoping someone can help me out with this. I've got two apps using
> > a shared CakePHP core (2.0.3). In Apache, I've configured each app on
> > it's own subdomain. In my views, I have absolute HTML links that link
> > between subdomains. I'm getting random issues where a request starts
> > in one app (properly), but then ends up being dispatched to a
> > controller in my other app. Here's the setup:
>
> > ~/app1/...
> > ~/app1/View/Pages/about.ctp
> > ~/app2/...
> > ~/lib/Cake/...
>
> > And I have domains setup such as:
>
> >http://app1.example.com(Apache DocumentRoot is ~/app1/webroot/)
> >http://app2.example.com(Apache DocumentRoot is ~/app2/webroot/)
>
> > Onhttp://app2.example.com, I have a HTML link w/ absolute url
> > pointing tohttp://app1.example.com/pages/about
>
> > About 25% of the time when I click the link onhttp://app2.example.com
> > that takes me tohttp://app1.example.com/pages/about, the request gets
> > dispatched to controllers in the wrong app.  This causes an exception
> > to be thrown since the page I'm trying to load (about.ctp) is only in
> > app1. Check out this stack trace:
>
> > Stack Trace
>
> > #0 ~/app2/Controller/PagesController.php(49): AppController-
> >> beforeFilter()
> > #1 ~/lib/Cake/Controller/Controller.php(605): PagesController-
> >> beforeFilter()
> > #2 ~/lib/Cake/Routing/Dispatcher.php(104): Controller-
> >> startupProcess()
> > #3 ~/lib/Cake/Routing/Dispatcher.php(89): Dispatcher-
> >> _invoke(Object(PagesController), Object(CakeRequest),
> > Object(CakeResponse))
> > #4 ~/app1/webroot/index.php(96): Dispatcher-
> >> dispatch(Object(CakeRequest), Object(CakeResponse))
> > #5 {main}
>
> > The request started out in /app1/webroot/index.php but ended up
> > getting passed to my PagesController in app2 instead of app1!?
>
> > The problem seems to be random, if I refresh the page, I'll get the
> > expected result. Hit refresh 10 more times, and the request from app1
> > gets handled by app2 Controllers again and an exception is thrown.
>
> > Any suggestions? I'm really stuck on this.
>
> > Thanks!
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Help - Multiple Apps, Shared Core, Dispatch Errors - CakePHP 2.0.3

2011-11-20 Thread sotin
Some progress:

Disabling caching in both CakePHP apps (via Cache.disable in Config/
core.php) didn't seem to make any difference, but disabling APC all
together (removed PHP extension) seemed to solve the problem.

Any APC/CakePHP experts out there that can offer some insight?

Thank you!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Help - Multiple Apps, Shared Core, Dispatch Errors - CakePHP 2.0.3

2011-11-20 Thread Andras Kende
I had similar issue before, that was tracked down to APC mixing up things
Resolved by changing each site cache prefix in core.php :

Cache::config('_cake_core_', array(
'prefix' => 'domain1.com_cake_core_',

Cache::config('_cake_model_', array(
'prefix' => 'domain1.com_cake_core_',

Andras Kende



On Nov 21, 2011, at 12:39 AM, sotin wrote:

> Hello,
> 
> I'm hoping someone can help me out with this. I've got two apps using
> a shared CakePHP core (2.0.3). In Apache, I've configured each app on
> it's own subdomain. In my views, I have absolute HTML links that link
> between subdomains. I'm getting random issues where a request starts
> in one app (properly), but then ends up being dispatched to a
> controller in my other app. Here's the setup:
> 
> ~/app1/...
> ~/app1/View/Pages/about.ctp
> ~/app2/...
> ~/lib/Cake/...
> 
> And I have domains setup such as:
> 
> http://app1.example.com (Apache DocumentRoot is ~/app1/webroot/)
> http://app2.example.com (Apache DocumentRoot is ~/app2/webroot/)
> 
> On http://app2.example.com, I have a HTML link w/ absolute url
> pointing to http://app1.example.com/pages/about
> 
> About 25% of the time when I click the link on http://app2.example.com
> that takes me to http://app1.example.com/pages/about, the request gets
> dispatched to controllers in the wrong app.  This causes an exception
> to be thrown since the page I'm trying to load (about.ctp) is only in
> app1. Check out this stack trace:
> 
> Stack Trace
> 
> #0 ~/app2/Controller/PagesController.php(49): AppController-
>> beforeFilter()
> #1 ~/lib/Cake/Controller/Controller.php(605): PagesController-
>> beforeFilter()
> #2 ~/lib/Cake/Routing/Dispatcher.php(104): Controller-
>> startupProcess()
> #3 ~/lib/Cake/Routing/Dispatcher.php(89): Dispatcher-
>> _invoke(Object(PagesController), Object(CakeRequest),
> Object(CakeResponse))
> #4 ~/app1/webroot/index.php(96): Dispatcher-
>> dispatch(Object(CakeRequest), Object(CakeResponse))
> #5 {main}
> 
> The request started out in /app1/webroot/index.php but ended up
> getting passed to my PagesController in app2 instead of app1!?
> 
> The problem seems to be random, if I refresh the page, I'll get the
> expected result. Hit refresh 10 more times, and the request from app1
> gets handled by app2 Controllers again and an exception is thrown.
> 
> Any suggestions? I'm really stuck on this.
> 
> Thanks!
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Help - Multiple Apps, Shared Core, Dispatch Errors - CakePHP 2.0.3

2011-11-20 Thread sotin
Hello,

I'm hoping someone can help me out with this. I've got two apps using
a shared CakePHP core (2.0.3). In Apache, I've configured each app on
it's own subdomain. In my views, I have absolute HTML links that link
between subdomains. I'm getting random issues where a request starts
in one app (properly), but then ends up being dispatched to a
controller in my other app. Here's the setup:

~/app1/...
~/app1/View/Pages/about.ctp
~/app2/...
~/lib/Cake/...

And I have domains setup such as:

http://app1.example.com (Apache DocumentRoot is ~/app1/webroot/)
http://app2.example.com (Apache DocumentRoot is ~/app2/webroot/)

On http://app2.example.com, I have a HTML link w/ absolute url
pointing to http://app1.example.com/pages/about

About 25% of the time when I click the link on http://app2.example.com
that takes me to http://app1.example.com/pages/about, the request gets
dispatched to controllers in the wrong app.  This causes an exception
to be thrown since the page I'm trying to load (about.ctp) is only in
app1. Check out this stack trace:

Stack Trace

#0 ~/app2/Controller/PagesController.php(49): AppController-
>beforeFilter()
#1 ~/lib/Cake/Controller/Controller.php(605): PagesController-
>beforeFilter()
#2 ~/lib/Cake/Routing/Dispatcher.php(104): Controller-
>startupProcess()
#3 ~/lib/Cake/Routing/Dispatcher.php(89): Dispatcher-
>_invoke(Object(PagesController), Object(CakeRequest),
Object(CakeResponse))
#4 ~/app1/webroot/index.php(96): Dispatcher-
>dispatch(Object(CakeRequest), Object(CakeResponse))
#5 {main}

The request started out in /app1/webroot/index.php but ended up
getting passed to my PagesController in app2 instead of app1!?

The problem seems to be random, if I refresh the page, I'll get the
expected result. Hit refresh 10 more times, and the request from app1
gets handled by app2 Controllers again and an exception is thrown.

Any suggestions? I'm really stuck on this.

Thanks!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php