标签: PHP

The server requested authentication method unknown to the client

php-mysqlnd连接mysql 8.0报错:The server requested authentication method unknown to the client,出现这个问题的原因是因 mysql8.0 引入了新特性 caching_sha2_password,而老版本的php-mysqlnd用的是mysql_native_password加密插件,解决方法如下: 1. 用如下语句查看MySQL当前加密方式 select host,user,plugin from user; …

阅读全文 »

PHP 安装Memcached扩展

php扩展memcached的作用是为了支持数据库缓存服务器,首先需要先编译安装好php,php具体安装步骤可参考本站(请在右上角搜索即可),安装好php之后,就可以用phpize安装memcached扩展。 下载libmemcached https://launchpad.net/libmemcached/+download # cd /usr/local/src # wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/li…

阅读全文 »

php-fpm 开启慢日志分析

编辑php-fpm.conf,配置输出php-fpm慢日志,阀值为2秒: request_slowlog_timeout = 2 slowlog = log/$pool.log.slow 利用sort/uniq命令分析汇总php-fpm慢日志: grep -v “^$” pool.log.slow | cut -d ” ” -f 3,2 | sort | uniq -c | sort -k1,1nr | head -n 10 参数解释: sort: 对单词进行排序 uniq -c: 显示唯一的行…

阅读全文 »

PHP 5.4 安装eAccelerator加速器

下载 http://eaccelerator.net/ # cd /usr/local/src # wget https://github.com/eaccelerator/eaccelerator/tarball/master 重命名 # mv master eaccelerator-eaccelerator-42067ac.tar.gz 解压缩 # tar zxvf eaccelerator-eaccelerator-42067ac.tar.gz # cd eaccelerator-eacc…

阅读全文 »

Linux shell快速查找PHP木马

一句话查找PHP木马 # find ./ -name “*.php” |xargs egrep “phpspy|c99sh|milw0rm|eval\(gunerpress|eval\(base64_decoolcode|spider_bc”> /tmp/php.txt # grep -r –include=*.php ‘[^a-z]eval($_POST’ . > /tmp/eval.txt # grep -r –include=*.php ‘file_put_contents…

阅读全文 »

Windows Server 2003 R2 SP2 X64 IIS 安装 64位PHP 以及 64位 MySQL

说明:64位的2003系统安装的IIS也是64位的,而目前官方并无64位版本PHP,因此32位的PHP是无法在64位的IIS上运行的,目前网上的解决办法都是将IIS转为32位模式才能正常运行PHP,本教程是采用64位第三方编译的PHP版本来搭建环境,实现64位IIS+64位PHP+64位MySQL的64位运行环境,希望对大家有所帮助,少走弯路,具体配置如下。 系统约定 环境软件下载后存放位置:D:\ServerSoft 环境软件安装位置:D:\ServerRoot 网站根目录位置:D:\wwwr…

阅读全文 »

解决CentOS 6 mcrypt模块以及module.so加载不了的原因

yum安装了php-mcrypt,但是登陆phpmyadmin时候却提示在命令行访问php -v,发现报错“缺少 mcrypt 扩展。请检查 PHP 配置。”开始查找错误,我估计是php-mcrypt与最新的系统不兼容导致的,通过访问php -v,发现警告如下 “PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib64/php/modules/module.so’ – /usr/lib64/php/modules/m…

阅读全文 »