Use Suhosin to enhance the security of the PHP script language, and use Suhosin to enhance the security of the PHP script language. PHP is a very popular website script language, but its inherent security is very weak. This article describes the
How can I configure the PHP protection system suhosin so that nativeapp can upload images? I converted a native app online to my dz Forum. What is different from a common Web page or html5 app, this app will be blocked by suhosin when uploading an image, but the upload fails and suhosin is commented out. so extension c
PHP is a very popular web scripting language, but its inherent security is very weak. This article describes the PHP Enhancement Program (hardened-php project) and the new Suhosi program, Suhosin provides enhanced PHP security configuration.
Reflection
Session
Shmop
SimpleXML
Sockets
SPL
Sqlite3
Standard
Suhosin
Tokenizer
Wddx
Xml
Xmlreader
Xmlrpc
Xmlwriter
Xsl
Zip
Zlib
[Zend module]
Suhosin
I recommend that you use PHP with fewer modules to improve performance and security. For example, you can disable the sqlite3 module by deleting (removing) the configuration file or renaming (or moving) a
Iconv
Imap
Json
Libxml
Mbstring
Memcache
Mysql
Mysqli
Openssl
Pcntl
Pcre
PDO
Pdo_mysql
Pdo_sqlite
Phar
Readline
Reflection
Session
Shmop
SimpleXML
Sockets
SPL
Sqlite3
Standard
Suhosin
Tokenizer
Wddx
Xml
Xmlreader
Xmlrpc
Xmlwriter
Xsl
Zip
Zlib
[Zend module]
Suhosin
I recommend that you use PHP with fewer modules to improve performance and security. For exam
): This attack forces end users to perform harmful actions against Web applications that currently have their identities verified. If it is an ordinary user, a successful CSRF attack can compromise the end user's data and operations. But if the end-user being targeted uses an administrator account, this can compromise the entire Web application.
2nd Best Practice: Find a built-in PHP module
To view a set of compiled
Val () has a lot of lethality for PHP security in general, to prevent
It's wrong to say that using disable_functions to ban Eval is a lot on the web.
In fact, eval () cannot be banned with disable_functions in php.ini because Eval () is a language construct and not a function
Eval is Zend, not php_function function;
How does PHP prohibit eval:
If you want to ban eval, you can use
function existsn ";} // If you use suhosin.exe cutor. func. blacklist instead of in your php. ini disabled_functions, function_exists returns true as the function. This is the same as suhosin.exe cutor. func. blacklist and disabled_functions beahviur:
Function suhosin_function_exists ($ func ){If (extension_loaded ('suhosin ')){$ Suhosin = @ ini_get ("suhosin.ex
SyntaxBool function_exists (string $ function_name)Check the list of defined functions. Both built-in and user-defined functions are function_name.Return valueReturns true. If function_name exists, it is a function. Otherwise, false is returned.*/If (function_exists ('imap _ open ')){Echo "imap functions are available.www.111cn.net } Else {Echo "imap functions are not available. }// Function_exists returns false on null and empty string:If (function_exists ('')){Echo &q
application. This setting also affects file uploads. To upload a bulk file, this value must be greater than upload_max_filesize. I also recommend that you restrict the methods available to use the Apache Web server. Edit httpd.conf to perform the following directives for the file root directory/var/www/html:Order Allow,deny# # Here you can add the rest of the configuration ... # #10th Best Practice: Resource Control (Denial of service control)You can set the maximum execution time for each
ctype curl date dom ereg exif fileinfo filter ftp gd gettext gmp hash iconv imap json libxml mbstring memcache mysql mysqli openssl pcntl pcre PDO pdo_mysql pdo_sqlite Phar readline Reflection session shmop SimpleXML sockets SPL sqlite3 standard suhosin tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zip zlib [Zend Modules] Suhosin
From the perspective of performance and security, I suggest using
disable_functions = eval in php. ini cannot disable eval. According to the instructions in the php manual, eval is a language constructor rather than a function. If you want to disable eval, a third-party extension is required to use Suhosin.
Linux installation:
Php installation will not be written.
Security of end users. If the target end user's account is used for administrator permissions, the entire Web application will be threatened.
#2: Reduce the number of built-in PHP modules
Run the following command to view the module compiled by PHP.
$ php -m
Sample output:
[PHP Modules] apc bcmath bz2 calendar Core c
account is used for administrator permissions, the entire Web application will be threatened.
#2: Reduce the number of built-in PHP modules
Run the following command to view the module compiled by PHP.
$ php -m
Sample output:
[PHP Modules] apc bcmath bz2 calendar Core ctype curl date dom ereg exif fileinfo filter ftp
# php ?m
You will get a similar result:
You will get a similar result:[PHP Modules]
Apc
Bcmath
Bz2
Calendar
Core
Ctype
Curl
Date
Dom
Ereg
Exif
Fileinfo
Filter
Ftp
Gd
Gettext
Gmp
Hash
Iconv
Imap
Json
Libxml
Mbstring
Memcache
Mysql
Mysqli
Openssl
Pcntl
Pcre
PDO
Pdo_mysql
Pdo_sqlite
Phar
Readline
Reflection
Session
Shmop
SimpleXML
Sockets
SPL
Sqlite3
Standard
Suhos
Curl date Dom Ereg EXIF fileinfo filter FTP GD gettext GMP hash iconv ima P JSON libxml mbstring memcache mysql mysqli OpenSSL pcntl pcre PDO pdo_mysql pdo_sqlite Phar readline Reflection session Shmop SimpleXML sockets SPL sqlite3 standard suhosin tokenizer wddx xml XmlReader xmlrpc XmlWriter xsl zip zlib [Zend modu Les] suhosin deletes a module and executes this command. For example: Delete module sqlite
work with any other Linux distributions such as RHEL/CentOS/Fedora or other Unix like operating systems such as OpenBSD/FreeBSD/HP-UX ).
1. reduce PHP built-in modules
To improve performance and security, we strongly recommend that you reduce the number of modules in PHP. Let's take a look at the module installed by the executed command below.
# Php-m
You wil
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.