Php. ini optimization method in php _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
Php. ini optimization method in php. Ctrl + y search: after disable_functions is found, add the following code (the function is not executed in the php Tutorial here): copy the content to the clipboard exec, system, passthru, error_log, ini _ ctrl + y search: disable_functions

Find and add after =

(All functions cannot be executed in the php Tutorial.) Code:

Copy content to clipboard

Exec, system, passthru, error_log, ini_alter, dl, openlog, syslog, readlink,

Symlink, link, leak, fsockopen, proc_open, popepassthru, chroot, scandir,

Chgrp, chown, escapeshellcmd, escapeshellarg, shell_exec, proc_get_status, popen

Put the above content in one row. Because a new line is added to keep the overall effect of the post.

Generally, only the following values are used in the background:

Copy content to clipboard

Disable_functions = system, passthru, shell_exec, com, exec, shell

Search: display_errors

If it is on, change it to off.

Search: magic_quotes_gpc

If it is off, change it to on.

Search: register_globals

If it is on, change it to off.

Search: open_basedir

Added later

/Www/:/tmp/

Here is the directory that limits php access. you must add/next to it. Otherwise, the/wwwabcd directory will be accessed.

Multiple directories are separated by commas. Discuz if/tmp/is not added! The upload function is unavailable.

Note: the above content will prompt related settings at the beginning of php. ini. press ctrl + x to find the next one. do not modify it directly.

------------------------------

Optimize php. ini

Gd library support

; Extension = php_gd2.dll

Remove the colon,

Output_buffering = off

The output cache allows you to send header (header, including cookies) rows even after the output body content. The cost is that the output layer slows down a little bit. You can use the output cache to open the output cache at runtime, or set the indication to on to enable the output cache of all files.

Output_handler =; you can redirect all the output of your script to a function,

Doing so may be useful for processing or logging it.

For example, if you set output_handler to ob_gzhandler, the output will be transparently compressed by a browser that supports gzip or deflate encoding.

Set an output processor to automatically enable the output buffer.

Find this

Output_buffering = off

Change

On

Note: do not set the value. you only need to set it to on.

Correspondingly, you can enable gzip support in your discuz background, which is also an optimization item.

Some friends also enable the php Security mode for security purposes. this is also a solution.

In addition, some friends need to use global variables and magic, which are essential for some php programs, and discuz2.0 also needs

Yes, but the security performance will be reduced. the method is simple.

Register_globals = off;

Change it to on.

Some friends often report that they cannot upload large files or the background backup data often times out.

Max_execution_time = 30; this is the maximum running time of each script, which can be modified and extended by yourself, in seconds.

Max_input_time = 60; this is the time that each script can consume, and the unit is second.

Memory_limit = 8 m; this is the maximum memory consumption for script running, you can also increase it by yourself

Upload_max_filesize = 2 m; Maximum file upload license size. change the size by yourself. this value is required for some image forums.

If:

Php has encountered an access violation at xxxxxx solution

Many people say that it is a php version Issue. Otherwise, we can look at this issue from four points.

1. whether the directory in which the dll files required by zend are located has insufficient permissions. you must have the read and run permissions.

2. whether to use 2003, set the application pool, for example, what is restricted in the pool, adjust it, and try again.

3. php. ini is not set in two places, and some programs must use

The; upload_tmp_dir annotator for this line to make this line play a role in the php. ini document.

Upload_tmp_dir is a temporary path used to define the storage of uploaded files. here you can also define an absolute path for it,

For example, upload_tmp_dir = d: upload. of course, your d: upload directory must have read and write permissions.

Here I set it

Upload_tmp_dir = c: temp

This error occurs generally because the session. save_path item in your php. ini is not set,

The solution is to set session. save_path and session. cookie_path

Session. save_path = c: temp

Session. cookie_path = c: temp (I have not modified this option. I found that the modified verification token cannot be used)

Then create a temp directory under the c: Directory.

After finding the handler, add the = code (the function is not allowed to be executed in the php Tutorial here): copy the content to the clipboard exec, system, passthru, error_log, ini _...

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.