If the php script execution process does not exit within 30 minutes, kill these php script processes

The online script content is as follows:[root@localhost ~]# cat /data/scripts/check_php.sh #!/bin/bash Date=`date "+%Y-%m-%d %H:%M:%S"` Num=$(ps -ef|egrep "countjs_syc_site*|countjs_syc_plan*|countjs_syc.php|countjs_syc_img*|setcache*"|grep -v grep |wc -l) Pid=$(/bin/ps -ef|egrep "countjs_syc_site*|countjs_syc_plan*|countjs_syc.php|countjs_ ...

Posted by billf2007 on Sat, 07 Dec 2019 18:48:28 -0800

[php implementation data structure] linked queue

What is chain queue Queue is a "first in, first out" storage structure, which is a special linear table. It only allows deletion at the front of the table, and insertion at the rear of the table.Generally, queues can be implemented in two ways: sequential queues and chained queues,As the name implies, sequential queue adopts sequentia ...

Posted by eevan79 on Sat, 07 Dec 2019 07:48:00 -0800

LSP merchant API

Your domain:                  lsp-api-merchant.hhs2717.cn Virtualhost conf:             /usr/local/nginx/conf/vhost/lsp-api-merchant.hhs2717.cn.conf Directory of:                 /data/wwwroot/lsp-api-merchant.hhs2717.cn Rewrite rule:                 /usr/local/nginx/conf/rewrite/laravel.conf Self-signed SSL Certificate:  /usr/local/nginx/conf/ ...

Posted by spoons84 on Sat, 07 Dec 2019 06:12:50 -0800

php causes memory overflow

When performing a step of exporting csv, when more than 3w pieces of data are to be exported, an error will be reported, as follows: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) php stores more than 3w pieces of data. This array takes up more than 20M of memory Solution: take data in batches and process da ...

Posted by mattsutton on Sat, 07 Dec 2019 00:45:51 -0800

zookeeper dynamically manages nginx configuration

Suppose we have a scenario in which all servers share the same configuration file, we can't maintain each server manually. At this time, we can use the configuration management function of zookeeper. Environment: python + nginx + zookeeper Objective: when the configuration file in zookeeper changes, nginx automatically pulls the latest config ...

Posted by tacojohn on Fri, 06 Dec 2019 18:35:38 -0800

Using PHPExcel to parse Excel tables

Install class library Download PHPExcel class library from GitHub Address: https://github.com/PHPOffice/PHPExcel After unzipping, move the Classes folder to the extend directory of ThinkPHP and rename it phpexcel Add references where needed in the project import('phpexcel.PHPExcel', EXTEND_PATH); code implementation <?php namespace app\ind ...

Posted by tlawless on Fri, 06 Dec 2019 12:37:45 -0800

Zephir for PHP extension development

If you often pay attention to the PHP framework falcon, you should know that the team of Falcon has developed a high-level language for better development of falcon—— Zephir. Zephir, an open source high-level language, aims to simplify the creation and maintainability of PHP extensions, focusing on type and memory secu ...

Posted by nvidia on Fri, 06 Dec 2019 12:24:58 -0800

Use and introduction of Facade

What is the Facade? At present, it is a class that is used to facilitate the static method call of the original class (undefined static method).The specific implementation of Facade is as follows:First look at the core document:\thinkphp\base.php`//Register static proxy of core classFacade::bind([ facade\App::class => App::class, facade ...

Posted by jsnyder2k on Fri, 06 Dec 2019 09:31:57 -0800

Download progress bar at terminal

programme <?php // Refer to https://mengkang.net/1412.html $width = exec("tput cols"); $progress = "[]100%"; $del = strlen($progress); $width = $width - $del; $progress = "[%-{$width}s]%d%%\r"; for($i=1;$i<=$width;$i++){ printf($progress,str_repeat("=",$i),($i/$width)*100); usleep(30000); } echo "\n"; interpretative statement ...

Posted by ZaZall on Fri, 06 Dec 2019 05:30:46 -0800

nextcloud and oauth2 integration tutorial

Basic environment Nextcloud 15.0.5 oauth2 Install sociallogin Download in the official app store sociallogin Extract and copy sociallogin to app directory Open Nextcloud and enable it in the application Configure oauth2 Use the administrator account to open Nextcloud to find the sociallogin settings, select Custom OAuth2 and add oauth2 in ...

Posted by apaxson on Thu, 05 Dec 2019 21:30:04 -0800