月度归档:2019年05月

php iOS内购验证库

项目地址:

https://github.com/sn01615/ios-iap-php

安装:

composer require sn01615/ios-iap-php

使用:


use sn01615\iap\ios\Verify; include "../vendor/autoload.php"; $cc = new Verify(); $receipt = ".."; // 凭据 $cc->endpoint(true);// 可选切换到沙盒环境 $vv = $cc->query($receipt); // 打印结果 var_dump($vv);

PHP7 扩展Hello world

[root@local2 ext]# ./ext_skel --extname=Hello

Creating directory Hello
Creating basic files: config.m4 config.w32 .gitignore Hello.c php_Hello.h CREDITS EXPERIMENTAL tests/001.phpt Hello.php [done].

To use your new extension, you will have to execute the following steps:

1.  $ cd ..
2.  $ vi ext/Hello/config.m4
3.  $ ./buildconf
4.  $ ./configure --[with|enable]-Hello
5.  $ make
6.  $ ./sapi/cli/php -f ext/Hello/Hello.php
7.  $ vi ext/Hello/Hello.c
8.  $ make

Repeat steps 3-6 until you are satisfied with ext/Hello/config.m4 and
step 6 confirms that your module is compiled into PHP. Then, start writing
code and repeat the last two steps as often as necessary.

[root@local2 ext]# 
# phpize 
# ./configure --enable-Hello
# make
# php -i | grep Hello
# php Hello.php 

Linux 系统级别PATH添加目录

修改此文件 /etc/profile.d/sh.local ,添加如下内容

pathmunge /usr/local/bin after
# pathmunge 是个shell函数 after 表示在路径后面添加,不加after 表示在路径签名加
# /usr/local/bin 是我们要添加到PATH的路径

ab压力测试

apr_socket_recv: Connection reset by peer:
https://www.cnblogs.com/archoncap/p/5883723.html

ulimit解除: https://blog.51cto.com/853056088/2091839

2019/05/03 07:43:36 [crit] 27684#27684: accept4() failed (24: Too many open files):
worker_rlimit_nofile 51200;

selinux 解除:
2019/05/03 07:46:07 [alert] 43314#43314: setrlimit(RLIMIT_NOFILE, 10000) failed (1: Operation not permitted)
setsebool -P httpd_setrlimit 1

php开启opcache可以提升80%左右qps
[root@abcdocker ~]# tail /etc/php.ini 
zend_extension="opcache.so"