CN107479859A - A kind of method using php program execution system orders - Google Patents

A kind of method using php program execution system orders Download PDF

Info

Publication number
CN107479859A
CN107479859A CN201710651031.7A CN201710651031A CN107479859A CN 107479859 A CN107479859 A CN 107479859A CN 201710651031 A CN201710651031 A CN 201710651031A CN 107479859 A CN107479859 A CN 107479859A
Authority
CN
China
Prior art keywords
php
server
execution system
program execution
shell script
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710651031.7A
Other languages
Chinese (zh)
Inventor
曾志超
刘阳
叶志
叶一志
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Easy Technology Co Ltd
Original Assignee
Shenzhen Easy Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Easy Technology Co Ltd filed Critical Shenzhen Easy Technology Co Ltd
Priority to CN201710651031.7A priority Critical patent/CN107479859A/en
Publication of CN107479859A publication Critical patent/CN107479859A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/3004Arrangements for executing specific machine instructions to perform operations on memory
    • G06F9/30043LOAD or STORE instructions; Clear instruction

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A kind of method using php program execution system orders, this method can be applied in the operation management function (such as data export, system reboot) for the operation platform realized with php language.

Description

A kind of method using php program execution system orders
Technical field
The present invention relates to a kind of method using php program execution system orders.
Background technology
Existing solution usually individually builds the private server of an inside, the php in the private server Program allows execution system level order (such as exec, system function).When php programs need execution system order, It will think to send in this private server and perform request, so as to allow private server to perform the system that php programs need to perform Order.
Prior art has the following disadvantages:1st, need additionally deployment one (or a set of) server, increase hardware cost and Maintenance cost;2nd, the problems such as needing to consider to connect overtime, anti-injection in realization, development cost is increased;3rd, due to service-specific Php programs on device can perform all system commands, once cause the php programs of private server can be with control by attack Whole server is made, huge potential safety hazard be present.
The soluble problem of this method:1st, can local disposition, without extra server resource;2nd, only need to realize one The shell scripts of timing operation, exploit natural resources without extra;3rd, will be deleted after the running paper comprising system command, Improve security.
The content of the invention
The purpose of patent of the present invention is to provide a kind of method using php program execution system orders, present invention use Following technical scheme:
A kind of method using php program execution system orders, it is characterised in that this method comprises the following steps:
Step 1, the request of data backup, php of the Web page towards server are sent with the web page of user orientation server Background program sends request;
Step 2, after the php background programs described in step 1 receive the request of web page transmission, the php programs exist A shell script file is created under the catalogue specified;
Step 3, also there is crontab timing scripts in the server, crontab timing scripts regular check step Php.sh script files described in rapid two whether there is, if it does not, out of service;, will if the script file is present The php.sh script files can be performed;
Step 4, after performing php.sh script files in step 3, the database of crontab timings script and server is built Vertical connection, the database carries out execution data backup commands, after the completion of backup, carries out delete command and deletes php.sh scripts File.
2nd, a kind of method using php program execution system orders as claimed in claim 1, it is characterised in that step The entitled php.sh of shell script files described in two.
3rd, a kind of method using php program execution system orders as claimed in claim 1, it is characterised in that step In three, the frequency of regular check checks once to be per minute.
Beneficial effect:
1st, can local disposition, without extra server resource;2nd, only need to realize the shell pin of a timing operation This, exploits natural resources without extra;3rd, it will be deleted after the running paper comprising system command, improve security.
Brief description of the drawings
Fig. 1 is the operating process view of invention.
Embodiment
With reference to specific embodiment, the present invention is expanded on further.
A kind of method using php program execution system orders, it is characterised in that this method comprises the following steps:
Step 1, the request of data backup, php of the Web page towards server are sent with the web page of user orientation server Background program sends request;
Step 2, after the php background programs described in step 1 receive the request of web page transmission, the php programs exist A shell script file is created under the catalogue specified;
Step 3, also there is crontab timing scripts in the server, crontab timing scripts regular check step Php.sh script files described in rapid two whether there is, if it does not, out of service;, will if the script file is present The php.sh script files can be performed;
Step 4, after performing php.sh script files in step 3, the database of crontab timings script and server is built Vertical connection, the database carries out execution data backup commands, after the completion of backup, carries out delete command and deletes php.sh scripts File.
The entitled php.sh of shell script files described in step 2.
In step 3, the frequency of regular check checks once to be per minute.
More effectively to illustrate the present invention, will be illustrated with specific application scenarios:In this scenario, user needs Data export operation is completed by clicking on the export button on web page.For convenience of elaboration, database service we with mysql Exemplified by database program.
In this scene, the php programs in server can carry out data in the case where forbidding the system commands such as exec Library backup operation (performs mysqldump orders).
After user sends out the request of data backup, php programs create a script for being php.sh under specified catalogue File, content be mysql export (swf) command (such as:mysqldump–umysql_admin–pmysql_pwd db_name>/ data/tmp/data.sql).In the crontab programs of server, there is a script for being named as auto_check.sh per minute Check that php.sh files whether there is, if it does, the script can go to perform php.sh files (./php.sh), now mysql Database carries out data backup commands, after the completion of backup, carries out delete command and deletes php.sh scripts (rm-f php.sh)。
So far, the operation that php programs complete DB Backup in the case where have disabled the system commands such as exec is realized.
The present invention can realize following effect:1st, the php programs on server need not support the system commands such as exec, increase Add Services-Security;2nd, the sh orders for needing to perform will be deleted after having performed, even if server is attacked, sh orders It also is difficult to be found, improves code safety;3rd, reduce intermediate link, make O&M more convenient, avoid network problem Influence to the sets of plan effect.
It should be understood that these embodiments are only illustrative of the invention and is not intended to limit the scope of the invention.In addition, it is to be understood that After the content of the invention lectured has been read, those skilled in the art can make various changes or modifications to the present invention, these The equivalent form of value equally falls within the application appended claims limited range.

Claims (3)

  1. A kind of 1. method using php program execution system orders, it is characterised in that this method comprises the following steps:
    Step 1, sends the request of data backup with the web page of user orientation server, and the Web page is towards the php backstages of server Program sends request;
    Step 2, after the php background programs described in step 1 receive the request of web page transmission, the php programs are being specified Catalogue under create a shell script file;
    Step 3, also there is crontab timing scripts in the server, the crontab timing script regular check step 2 Described in shell script files whether there is, if it does not, out of service;If the script file is present, it will performs The shell script files;
    Step 4, after performing shell script files in step 3, the Database of crontab timings script and server connects Connect, the database carries out execution data backup commands, and after the completion of backup, crontab timing scripts carry out delete command and deleted Except shell script files.
  2. 2. a kind of method using php program execution system orders as claimed in claim 1, it is characterised in that in step 2 The entitled php.sh of described shell script files.
  3. A kind of 3. method using php program execution system orders as claimed in claim 1, it is characterised in that in step 3, The frequency of regular check checks once to be per minute.
CN201710651031.7A 2017-08-02 2017-08-02 A kind of method using php program execution system orders Pending CN107479859A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710651031.7A CN107479859A (en) 2017-08-02 2017-08-02 A kind of method using php program execution system orders

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710651031.7A CN107479859A (en) 2017-08-02 2017-08-02 A kind of method using php program execution system orders

Publications (1)

Publication Number Publication Date
CN107479859A true CN107479859A (en) 2017-12-15

Family

ID=60597316

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710651031.7A Pending CN107479859A (en) 2017-08-02 2017-08-02 A kind of method using php program execution system orders

Country Status (1)

Country Link
CN (1) CN107479859A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105740102A (en) * 2016-02-02 2016-07-06 北京京东尚科信息技术有限公司 Data backup equipment and method therein
CN106569920A (en) * 2016-11-09 2017-04-19 腾讯科技(深圳)有限公司 Database backup method and device
CN108090345A (en) * 2016-11-21 2018-05-29 腾讯科技(深圳)有限公司 Linux system external command performs method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105740102A (en) * 2016-02-02 2016-07-06 北京京东尚科信息技术有限公司 Data backup equipment and method therein
CN106569920A (en) * 2016-11-09 2017-04-19 腾讯科技(深圳)有限公司 Database backup method and device
CN108090345A (en) * 2016-11-21 2018-05-29 腾讯科技(深圳)有限公司 Linux system external command performs method and device

Similar Documents

Publication Publication Date Title
CN108549580B (en) Method for automatically deploying Kubernets slave nodes and terminal equipment
CN103984573A (en) Installation method and device of application program
CN107347017A (en) The method, apparatus and configuration point device of a kind of device upgrade
WO2016173199A1 (en) Mobile application single sign-on method and device
KR20060051932A (en) Updating software while it is running
CN105871587A (en) Log uploading method and device
US20160261693A1 (en) Cloud-based data backup and operation method and system
US9843625B2 (en) System and method for aggregating and providing data from enterprise systems to mobile devices
CN104468587B (en) Virtual machine single-point logging method and system under a kind of cloud computing environment
CN111367753B (en) Cloud desktop screen recording method and device based on network communication engine ICE architecture
US11489729B2 (en) Agentless access control system for profile management
CN106210114A (en) A kind of multiple terminals software parallel downloads upgrade method
CN111507694A (en) Block chain cross-chain interaction method and system
CN113760339A (en) Vulnerability repair method and device
CN105471963A (en) Mobile device management method and system based on cloud platform
CN108521342B (en) Cluster management method and device
CN103118092B (en) Method and device for realizing single login
CN110324191B (en) Hybrid cloud deployment method, device and system
CN107479859A (en) A kind of method using php program execution system orders
US20240045733A1 (en) Method and apparatus for deploying deep learning system
CN107015787B (en) Method and device for designing interactive application framework
CN111367943A (en) Data transmission verification method, system, computer equipment and storage medium
CN112491614B (en) Configuration information online automatic validation method and system for embedded equipment
CN113987455A (en) BS architecture-based industrial control system multi-factor authentication login method and system
CN110837612B (en) Uniform Resource Identifier (URI) data acquisition method and device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20171215

RJ01 Rejection of invention patent application after publication