<![CDATA[ PHx Fresh Install... Fatal Error Cannot redeclare class... - My Forums]]> https://forums.modx.com/thread/?thread=45374 <![CDATA[Re: PHx Fresh Install... Fatal Error Cannot redeclare class...]]> https://forums.modx.com/thread/45374/phx-fresh-install-fatal-error-cannot-redeclare-class#dis-post-474874
if(class_exists('PHxParser') != true)
{
include_once $modx->config['base_path'] . "assets/plugins/phx/phx.parser.class.inc.php";
}


Hope that helps you too!]]>
Ysanmiguel Aug 13, 2013, 06:16 PM https://forums.modx.com/thread/45374/phx-fresh-install-fatal-error-cannot-redeclare-class#dis-post-474874
<![CDATA[Re: PHx Fresh Install... Fatal Error Cannot redeclare class...]]> https://forums.modx.com/thread/45374/phx-fresh-install-fatal-error-cannot-redeclare-class#dis-post-262135
In the next version of PHx would it be possible to

1. wrap the PHxParser class in an
if ( ! class_exists( 'PHxParser' ) ) { ... }


2. change the include_once to and include in the PHx snippet call.

I believe that this would avoid the problem mentioned above when using YAMS, but would not affect PHx.

Thank you.]]>
PaulSuckling Nov 22, 2009, 04:56 PM https://forums.modx.com/thread/45374/phx-fresh-install-fatal-error-cannot-redeclare-class#dis-post-262135
<![CDATA[Re: PHx Fresh Install... Fatal Error Cannot redeclare class...]]> https://forums.modx.com/thread/45374/phx-fresh-install-fatal-error-cannot-redeclare-class#dis-post-262134 Thanks PMS u rock!!]]> prouve Nov 12, 2009, 05:46 AM https://forums.modx.com/thread/45374/phx-fresh-install-fatal-error-cannot-redeclare-class#dis-post-262134 <![CDATA[Re: PHx Fresh Install... Fatal Error Cannot redeclare class...]]> https://forums.modx.com/thread/45374/phx-fresh-install-fatal-error-cannot-redeclare-class#dis-post-262133 Thanx.
]]>
fourroses Nov 11, 2009, 03:01 AM https://forums.modx.com/thread/45374/phx-fresh-install-fatal-error-cannot-redeclare-class#dis-post-262133
<![CDATA[Re: PHx Fresh Install... Fatal Error Cannot redeclare class...]]> https://forums.modx.com/thread/45374/phx-fresh-install-fatal-error-cannot-redeclare-class#dis-post-262132

If using the PHx snippet then please note the following. For some reason, a file
specified using include_once gets reincluded and this causes the PHxParser class
to be redefined, which generates a PHP parse error. This can avoided by modifying
the PHx snippet to wrap the include in some code that will only include the file
if the class has not yet been defined:

if ( ! class_exists( ’PHxParser’ ) )
{
include_once $modx->config[’rb_base_dir’] . "plugins/phx/phx.parser.class.inc.php";
}

Cheers.]]>
PaulSuckling Nov 10, 2009, 10:54 AM https://forums.modx.com/thread/45374/phx-fresh-install-fatal-error-cannot-redeclare-class#dis-post-262132
<![CDATA[Re: PHx Fresh Install... Fatal Error Cannot redeclare class...]]> https://forums.modx.com/thread/45374/phx-fresh-install-fatal-error-cannot-redeclare-class#dis-post-262131
It has something to do with calling or including 2x the same I think.
When u uncheck OnParseDocument this error isnt there but i think it won’t work then.

Let me know if u know more!

]]>
fourroses Nov 10, 2009, 10:09 AM https://forums.modx.com/thread/45374/phx-fresh-install-fatal-error-cannot-redeclare-class#dis-post-262131
<![CDATA[PHx Fresh Install... Fatal Error Cannot redeclare class...]]> https://forums.modx.com/thread/45374/phx-fresh-install-fatal-error-cannot-redeclare-class#dis-post-262130
I just installed PHx exactly as said in the documentation and i have this error:
Fatal error: Cannot redeclare class PHxParser in /homez.63/acbsesam/v2/assets/plugins/phx/phx.parser.class.inc.php on line 12

Line 12:
class PHxParser {


MODx Evo 1.0 / YAMS 1.1.7 RC7 / MM 0.3.4 / PHx 2.1.3
PHP 5.2.11 / MySQL 5.0.68]]>
prouve Nov 10, 2009, 04:40 AM https://forums.modx.com/thread/45374/phx-fresh-install-fatal-error-cannot-redeclare-class#dis-post-262130