Installation
Steps:
These installation steps should be
executed on the command line, you can accomplish them through FTP
clients but this document does not cover the steps to do that.
Commands you should type are in
italics.
1. Download the latest version of PHPCoder from
http://phpcoder.shadonet.com/downloads
2. Extract the phpcoder-x.tgz file by issuing the command:
tar zxf phpcoder-x.tgz (replace
phpcoder-x.tgz with the file you downloaded)
3. Enter the phpcoder directory by issuing the:
cd phpcoder command
4. Create the files directory and make it writable:
mkdir files; chmod 777 files
5. Create the encoded directory and make it writable:
mkdir encoded; chmod 777 encoded
PHP Coder should now be installed, to encode programs/scripts simply
place them in the files directory and then go to
http://yoururl/phpcoder and run the encoder, your encoded scripts will
be in the encoded directory. For more inforamtion see Using
PHPCoder.
Once you have installed PHPCoder
following the installation steps above it is easy to begin encoding
scripts.
First place the script that you want to be encoded in the
files directory (you can do this via
FTP but all directories must be chmod 777).
Next telnet into your hosting providor and execute the command
chmod -R 777 /path/to/phpcoder/files
Then visit http://yourdomain/phpcoder, set your options and press the
submit button.
Note that you must chmod -R 777 your files directory because PHPCoder
will cd into each directory and write a temporary file while the
directory is being encoded, this is so relative paths in your
application are not broken by the encoding process.
Options:
The PHPCoder web page has several
options you can set before you encode your files, here is a brief run
down on some of them:
Recursive Encoding: When this
is set to Yes PHPCoder will encode files in all the subdirectories of
the files directory, this is enabled by default and should be set to
Yes unless you have a good reason to set it to no.
Copy Skipped Files: When this
is set to Yes PHPCoder will copy non PHP source files to the encoded
directory, this avoids breaking apps and makes it so it is not
necessary to merge encoded/unencoded files manually.
Pre Content Code: This is
Text, HTML, or PHP code (must be enclosed in <?php ?> ) content
that will be prepended to each PHP source file before it is encoded,
this is an excellent place to put licensing code, etc.
Post Content Code: This is
Text, HTML, or PHP code (must be encloded in <?php ?>) content
that will be appended to each PHP source file before it is encoded,
this is a good place for copyright, etc.
Restrictions:
PHPCoder allows you to set several
options that restrict the execution of the encoded PHP scripts.
These options range from locking to an IP or to a particular amount of
time or all of the above.
Restrict Visitor's IP: This can
be a single IP or a comma seperated list of IP addresse; if it is set
only these ip addresses can view the script,
this is a nice feature for a demo that is not feature restricted but is
limited to one visitor IP. In a pinch it could be used for a
security measure though this is not recommended.
Restrict Server IP: This can
be a single IP or a comma seperated list of IP addresesses; if it is
set scripts can only be served from these IPs, this enables you to
lock the script to a particular server(s) by restricting the IP.
This is similar to lock server name but this will prevent the user from
moving the script where Restrict Server Name will allow them to move
the script should their server or hosting change, for this reason
Restrict Server Name is encouraged.
Restrict Server Name: This can
be a single server name or a comma seperated list of server names; If
this
is set the script can only be served from one of these server names,
example
shadonet.com,yahoo.com. This enables you to lock a script to a
particular
domain name(s) but allow the user to move the script to a new web host
or
server as long as it is being served from the same domain.
Expiring Scripts: When a
selection is made for Script Expires In: the script will expire after
the specified amount of time has passed, for example 5 seconds, 1 week,
2 months, etc. This can be used in conjunction with any of the
other restrictions. Alternatively you can type in the time when
the script should expire, for example 01/01/2004 will make the script
expire January 1st, 2004. This field uses PHP's strtotime format
for the time, see
http://www.php.net/strtotime
for more information.