<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 12/25/12 5:26 AM, Austin Einter
wrote:<br>
</div>
<blockquote
cite="mid:CANXt1k-MQ90JQfRfuoUR2jP8DcRVBUxhY210i8YR+=Ho3PwQ7g@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>Dear All<br>
</div>
I compiled phc in ubuntu 10.04 lts.<br>
</div>
Next I am trying to obfusace some php code (which is part
of a drupal based code). I just tried obfuscating a single
file using phc. It did work.<br>
<br>
</div>
But when I am trying to access my site, I get bunch of below
errors.<br>
<br>
<i>Notice: Undefined variable: TSa200978216 in
doc_search_my_form() (line 475 of /var/www/<a
moz-do-not-send="true"
href="http://example.com/sites/all/modules/doc_search/doc_search.module"
target="_blank">example.com/sites/all/modules/doc_search/doc_search.module</a>).<br>
Notice: Undefined variable: TSa1454652404 in
doc_search_my_form() (line 482 of /var/www/<a
moz-do-not-send="true"
href="http://example.com/sites/all/modules/doc_search/doc_search.module"
target="_blank">example.com/sites/all/modules/doc_search/doc_search.module</a>).<br>
</i><br>
<br>
</div>
Mostly these are variable undefined errors. When the file is
in normal mode (having normal php code), it does not throw any
error. When the file is in obfuscated mode , when I access my
site I get lots of variable undefined error. Any idea what's
wrong here.<br>
<br>
</div>
Thanks</div>
<br>
</blockquote>
I am going to assume that doc_search is the name of a custom module
you are writing (since I don't find a project by that name with a
quick search).<br>
<br>
The likely problem is that the obfuscator doesn't understand the
structure of Drupal, these undefined variables are probably globals
coming from Drupal, so their names should NOT have been changed. The
obfuscation is probably also breaking your hook functions as these
functions must not have their name changed.<br>
<br>
It is basically hard to run a standard obfuscator on Drupal code due
to the way Drupal works with building functions names up for hooks
and such. If you really want to obfuscate code with Drupal, you will
need to find a "Drupal aware" obfuscator, which I am not sure
exists.<br>
<pre class="moz-signature" cols="72">--
Richard Damon</pre>
</body>
</html>