Windows:
1. Enable the security mode. You can disable functions such as exec () and system ().
2. Use php_admin_value open_basedir in httpd. conf to restrict PHP access directories.
3. In php_admin_value open_basedir, do not forget to add the php temporary upload directory and session storage directory specified in PHP. ini. Otherwise, you will not be able to upload files or access sessions.
Configure php. ini as follows:
Upload_tmp_dir = "E:/APMServ5.2.0/PHP/uploadtemp /"
Session. save_path = "E:/APMServ5.2.0/PHP/sessiondata /"
4. For more information, see the configuration http://apmserv.s135.com of my APMServ software.
Httpd. conf configuration (if the PHP read and write permissions are restricted to the E: smis directory)
Apache2.0 configuration example:
<VirtualHost *: 80>
ServerName www.abc.com
DocumentRoot "E:/smis"
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm default.htm index. php default. php
AllowOverride None
Order Deny, Allow
Allow from all
Php_admin_value open_basedir "E:/smis/; E:/APMServ5.2.0/PHP/uploadtemp/; E:/APMServ5.2.0/PHP/sessiondata /"
Php_admin_value safe_mode On
</VirtualHost>
Apache2.2 configuration example:
<VirtualHost *: 80>
ServerName www.abc.com
DocumentRoot "E:/smis"
</VirtualHost>
<Directory "E:/smis">
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm default.htm index. php default. php
AllowOverride None
Order Deny, Allow
Allow from all
Php_admin_value open_basedir "E:/smis/; E:/APMServ5.2.0/PHP/uploadtemp/; E:/APMServ5.2.0/PHP/sessiondata /"
Php_admin_value safe_mode On
</Directory>