(1).php.ini配置允许加载远程文件
allow_url_fopen = On
(2).创建本地文件invoke.php
<?php
require('https://blog.20230611.cn/test.txt');(3).创建远程文件https://blog.20230611.cn/test.txt
<?php echo '1024';
(4).执行invoke.php输出1024
提示:require和include都支持,如果远程文件的内容中包含PHP代码则会执行,如果不是PHP代码会当做文本输出。这样是非常危险的,容易被渗透。
先在centos安装openssl,然后开始://生成私钥openssl genrsa -out rsa_private_key.pem 1024//生成公钥openssl rsa -in rsa_private_key.pem&...
if($_SERVER['REQUEST_METHOD'] == 'POST') { echo('This is post '); } elseif ($_SERVER['...
项目中使用服务来执行webservice,由于对方系统api不稳定,经常导致服务崩溃,只能重启,一个月差不多要重启一次。初期的解决办法是捕获异常,然后continue掉。<?php try { $url = 'http...
今天帮朋友查询wordpress执行超级慢的原因,特此记录开启fpm的慢日志,记录执行超过30秒的脚本request_slowlog_timeout = 30 slowlog = var/log/slow.log查看日志[23-May-2019 17...
php7新增的特性(1).强制限制只能返回一种类型<?php class task { } //must return an integer function add(): int { &nb...
使用openssl扩展对应替换mcrypt的函数,(比较麻烦,但是openssl是未来趋势)在新版php中编译mcrypt扩展使用一个纯php代码实现的mcrypt扩展库,git地址为https://github.com/phpseclib/mcrypt_compat,每个mcrypt的方法都已经实...