In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "how to set some parameters that have a great impact on performance in CMS system php.ini". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to set some parameters that have a great impact on performance in the CMS system php.ini.
Developers who have done CMS know that logging in the background and uploading files in the LAMP environment are two places prone to problems, and most of them are due to PHP configuration problems, so it is very important to optimize PHP. For the optimization of PHP, the main purpose is to reasonably adjust and set the main parameters in php.ini. Let's take a look at how to set some parameters in php.ini that have a great impact on performance (the system is CentOS).
(1) the PHP function disables finding
Disable_functions =
This option can set which PHP functions are prohibited. The risk of some functions in PHP is quite high. You can directly execute some CentOS system-level script commands. If you allow these functions to be executed, when the PHP program has vulnerabilities, the loss is very serious! Here are the recommended settings for disabling functions:
Disable_functions = phpinfo,passthru,exec,system,popen,chroot,escapeshellcmd,escapeshellarg,shell_exec,proc_open,proc_get_status
Note: if your server contains some PHP programs for CentOS system state detection, do not disable functions such as shell_exec,proc_open,proc_get_status.
(2) PHP script execution time found
Max_execution_time = 30
This option sets the execution time of the PHP program. If a PHP script is requested and the PHP script is not completed within the max_execution_time time, PHP no longer continues execution and returns a timeout error directly to the client. There is no special need for this option to keep the default setting for 30 seconds, and if your PHP script does require a long execution time, you can increase the time setting appropriately.
(3) PHP script handles memory footprint to find
Memory_limit = 8m
This option specifies the * * memory that can be consumed by PHP script processing, which defaults to 8MB. If your server memory is above 1GB, this option can be set to 12MB for faster PHP script processing efficiency.
(4) PHP global function declaration found
Register_globals = Off
Many articles on the network about PHP settings recommend setting this option to On. In fact, this is an extremely dangerous setting method and is likely to cause serious security problems. If there is no special need, it is highly recommended to keep the default settings!
(5) find the file size limit for PHP upload
Upload_max_filesize = 2m
This option sets the size of * * uploaded files allowed by PHP. The default is 2MB. According to the actual application requirements, the setting can be increased appropriately.
(6) Session storage media found
Session.save_path
If your PHP program uses Session dialogue, you can set the Session storage location to / dev/shm,/dev/shm is the unique TMPFS file system of the Linux system, is the memory as the main storage mode of the file system, better than RAMDISK, because you can use DISKSWAP as a supplement, and is the CentOS system comes with functional modules, do not need to be configured separately. Come to think of it, how much faster will it be from disk IO operations to memory operations? Just note that all data stored in / dev/shm will be lost after the server is restarted. But this is insignificant to Session. In this way, we have completed the steps of PHP optimization in CentOS system.
At this point, I believe you have a deeper understanding of "how to set some parameters that have a great impact on performance in CMS system php.ini". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 217
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.