Home > Backend Development > PHP Tutorial > Optimization method of php.ini in php_PHP tutorial

Optimization method of php.ini in php_PHP tutorial

WBOY
Release: 2016-07-13 10:54:26
Original
855 people have browsed it

ctrl+y search: disable_functions

After finding it, add

after =

(Here are functions that are prohibited from being 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

Please put the above content on one line. Line breaks were made to maintain the overall effect of the post

Usually in the background, just add:

Copy content to clipboard

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

Find: display_errors

If it is on, change it to off

Find: 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

Add

after

 /www/:/tmp/

This is a directory that restricts PHP access. You must add / after it, otherwise if there is a /wwwabcd directory, it will also be accessed

Multiple directories are separated by English:. If /tmp/ is not added, the upload function of discuz! cannot be used

Note: The above content will have relevant setting prompts at the beginning of php.ini. Please 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 in front,

output_buffering = off

Output caching allows you to send header (including cookies) lines even after outputting the body content at the cost of slowing down the output layer a bit. You can turn on output caching at runtime using Output Cache, or turn on the directive here to have output caching turned on for all files.

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

That might be useful for processing or logging it.

For example, if you set this output_handler to ob_gzhandler, the output will be transparently compressed for browsers that support gzip or deflate encoding.

Set an output processor to automatically enable output buffering.

Found this

output_buffering = off

Modified to

on

Note, do not set a value, just set it to on.

Correspondingly, you can also turn on gzip support in your discuz background, which is also an optimization component.

Some friends also enable the safe mode of PHP for safety. This is also a solution

In addition, some friends need to use global variables and magic, which are necessary conditions for some PHP programs. Discuz2.0 also requires

It can be opened, but the security performance will be reduced. The method is very simple.

register_globals = off ;

Just change it to on.

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

max_execution_time = 30; This is the maximum time for each script to run. You can modify and lengthen it by yourself, in seconds

max_input_time = 60; This is the time that each script can consume, the unit is also seconds

Memory_limit = 8m; This is the maximum memory consumed by the script. You can also increase it yourself

Upload_max_filesize = 2m; The maximum allowed size of uploaded files, change it yourself, some picture forums require this larger value

If:

 php error message shows that php has encountered an access violation at xxxxxx solution

Many people say that it is a problem with the PHP version. In fact, this is not the case. You can look at this problem from four places

1. Is the directory where the dll file required by zend does not have enough permissions? It must have read and run permissions

2. Have you used 2003 and set up an application pool? For example, what are the restrictions in the pool? Adjust it and try again. Is it better? Haha

3. There are two places in php.ini that are not set and must be used by some programs

Comment out the ;upload_tmp_dir line to make it effective in the php.ini document.

Upload_tmp_dir is used to define the temporary path where uploaded files are stored. 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 at this time.

Here I set it to

upload_tmp_dir = c:temp

The occurrence of such an error statement is usually because the session.save_path item in your php.ini is not set properly,

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

session.save_path = c:temp

Session.cookie_path = c:temp (I did not modify this, I found that the modified verification code cannot be used)

Then create a temp directory in the c: directory

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632319.htmlTechArticlectrl+y search: disable_functions After finding it, add it after = (here are functions that are prohibited from being executed in the php tutorial )Code: Copy content to clipboard exec,system,passthru,error_log,ini_...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template