Many people on the internet have answered: Modify the Session.gc_maxlifetime in the configuration file. If you want to learn more about the session recycling mechanism, read on. (This article Environment php5.2)
Overview: Each time a PHP request, a
One, data caching
The data cache mentioned here refers to the database query cache, every time you visit the page, you will first detect the existence of the corresponding cached data, if it does not exist, connect the database, get the data, and
It is also able to optimize scripts to speed up their execution. Using Eaccelerator can reduce server load and increase the execution time of PHP code.
Eaccelerator configuration options:
Copy Code code as follows:
Zend_extension_ts=
Copy Code code as follows:
/**
* Get a picture path in a replacement article
* @param string $xstr content
* @param string $keyword Create a file name for a photo
* @param string $oriweb URL
* @return String
*
*/
function replaceimg
Copy Code code as follows:
/**********************************************
* __construct Object initialization function uses
* Use of destruct destructors
* $this use of keywords ($this keywords are system variables used to access object
Using Nginx as proxy server, the backend is apache2. Set up files that allow maximum 100M to be uploaded.
1. Nginx Configuration:
HTTP {
......
Client_max_body_size 100m;
......
}
2. PHP configuration file
......
; Maximum execution time of each
Because of their use of character encoding is generally utf-8 encoding, but if the other side of the blog using gb2312 code, post will appear garbled (unless the other side of the first conversion code before the post). It is necessary to make a
Phpsocketsocket is located in TCP/IP protocol, provides the client-server mode of asynchronous communication, that is, the client to the server to send a service request, the server received the request, provide the corresponding feedback or service!
Starting with version 5.2, PHP native provides Json_encode () and Json_decode () functions, which are used for encoding and decoding.
1, Json_encode ()This function is used primarily to convert arrays and objects into JSON format. Let's look at an
About the file code detection, Baidu a lot of it is, but there is no use,
Many people suggest mb_detect_encoding detection, but I do not know why this is not successful, nothing output,
See someone wrote an enhanced version, with the BOM to judge, I
PHP Warning:Strtotime (): It isn't safe to rely on the system's timezone settings. You are are *required* to use the Date.timezone setting or the Date_default_timezone_set () function. In case you are used any of those methods and your are still
In Baidu Encyclopedia, the definition of Stdclass is as follows:
Copy Code code as follows:
Stdclass began to be popular in PHP5. And Stdclass is also a reserved class of Zend. Stdclass is a base class for PHP,
Almost all classes
I think people who have the same ideas as me would handle this: uploaded files just want to temporarily use, do not need to save the original file, such as resize operations, and these later operations will appear in the second round from the client
Generally set the time when the PHP script execution timeout
One, in php.ini inside set
max_execution_time = 1800;Second, through the PHP ini_set function set
Ini_set ("Max_execution_time", "1800");Third, through the Set_time_limit function set
Static variables exist only within the scope of a function, and static variables live only on the stack. Normal variables are released after the function ends, such as local variables, but static variables do not. The next time the function is
Copy Code code as follows:
Delfile ("Upload", 10);
function Delfile ($dir, $n)//delete all files created by n minutes before the dir path;
{
if (Is_dir ($dir))
{
if ($dh =opendir ($dir))
{
while (false!== ($file = Readdir ($DH)))
{
if (
1. What is session?Equivalent to a client (can be browser, app, FTP and other, and the same browser open several more than a different client) to a server access, this period the server to create a unique logo (session_id session_name), In fact, an
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service