Giter Site home page Giter Site logo

doc's People

Contributors

orzaaa avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

doc's Issues

How to install ImageMagick

Step 1:

$ sudo apt-get install ImageMagick的

Step 2:

$ sudo apt-get install libmagick-dev

Step 3:

$ apt-get install php-dev

Step 4:

find/etc/php/7.2/cli/php.ini
extension = imagick.so //add

Step 5:

Restart Server

PHP Upload file

打开php.ini,首先找到

  • file_uploads = on ;是否允许通过HTTP上传文件的开关。默认为ON即是开
  • upload_tmp_dir ;文件上传至服务器上存储临时文件的地方,如果没指定就会用系统默认的临时文件夹
  • upload_max_filesize = 8m ;望文生意,即允许上传文件大小的最大值。默认为2M
  • post_max_size = 8m ;指通过表单POST给PHP的所能接收的最大值,包括表单里的所有值。默认为8M

一般地,设置好上述四个参数后,上传<=8M的文件是不成问题,在网络正常的情况下。
但如果要上传>8M的大体积文件,只设置上述四项还一定能行的通。

进一步配置以下的参数

  • max_execution_time = 600 ;每个PHP页面运行的最大时间值(秒),默认30秒
  • max_input_time = 600 ;每个PHP页面接收数据所需的最大时间,默认60秒
  • memory_limit = 8m ;每个PHP页面所吃掉的最大内存,默认8M

把上述参数修改后,在网络所允许的正常情况下,就可以上传大体积文件了

  • max_execution_time = 600
  • max_input_time = 600
  • memory_limit = 32m
  • file_uploads = on
  • upload_tmp_dir = /tmp
  • upload_max_filesize = 32m
  • post_max_size = 32m

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.