In order to meet more users two times development interests and hobbies, at the same time, in order to be more secure. You can separate the main program from the WWW program by modifying the way the portal code is included.
Let's look at the following directory structure:
(Fig. 1)
We need to make changes to the Phpcms directory and index.php.
Place the: Phpcms directory outside the directory.
Such as:
(Fig. 2)
The Phpcms directory is the PHPCMS directory in Figure 1.
Figure 2 of the WWW directory for our site directory, the site directory to do parsing, will: www.phpip.com binding to the WWW directory.
This way, users will not be able to access the PHPCMS directory directly through the browser. Can effectively prevent the template from being downloaded. A vulnerability in the program file has been accessed.
Then modify the www/index.php file
<?php/** * index.php phpcms entrance * * @copyright(C) 2005-2010 phpcms* @licensehttp://www.phpcms.cn/license/* @lastmodify2010-6-1*///phpcms root directory define (' Phpcms_path ', DirName (__file__). Directory_separator);
include Phpcms_path. ' /phpcms/base.php ';Pc_base::creat_app ();?>
The bold section is modified to:
Include Phpcms_path. /phpcms/base.php ';
There is one last file: www/api.php file.
Do the same for the above operation.
Will: include Phpcms_path. ' Phpcms/base.php ';
Modified to: Include Phpcms_path. /phpcms/base.php ';
Reprint: http://www.phpip.com/html/2014/jiemi_0504/147.html
Phpcms Core code and WWW separation deployment