This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yum install bzip2 bzip2-devel libuuid-devel | |
# yum install curl-devel gd gd-devel.x86_64 gmp-devel pcre-devel.x86_64 libjpeg-devel.x86_64 libpng-devel.x86_64 libXpm-devel.x86_64 expat-devel freetype-devel.x86_64 libxml2 libxml2-devel | |
# yum install libmcrypt-devel.x86_64 | |
# yum install mysql-devel.x86_64 mysql-server.x86_64 (可选) | |
# ./configure --prefix=/usr/local/php --enable-fpm --with-zlib --enable-bcmath --with-bz2 --with-curl --with-libxml-dir --enable-exif --enable-ftp --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-mysql --with-mysqli --with-mysql-sock=/tmp/mysql.sock --with-libdir=lib64 --with-mcrypt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQLite 没有 datediff() ,所以要删除一年前的数据需要如下语句: | |
1. 删除(从今天零点算起的) 365 天前的数据: | |
delete from tb_load_info where julianday(strftime('%Y-%m-%d',datetime('now','localtime'))) - julianday(strftime('%Y-%m-%d', created_at)) > 365; | |
2. 删除(从此时此刻算起的) 365 天前的数据: | |
delete from tb_load_info where julianday(datetime('now','localtime'))-julianday(created_at) > 365; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# php-fpm - this script starts and stops the php-fpm daemon | |
# | |
# chkconfig: - 85 15 | |
# description: PHP-FPM | |
# processname: php-fpm | |
# config: /usr/local/php/etc/php-fpm.conf | |
# pidfile: /var/run/php-fpm.pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
sudo yum install epel-release | |
``` | |
Centos 7.x | |
========== | |
``` | |
wget http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-1.noarch.rpm | |
wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <event.h> | |
#include <evhttp.h> | |
#include <pthread.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#include <sys/socket.h> | |
#include <sys/types.h> | |
#include <netinet/in.h> | |
#include <iostream> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://wiki.nginx.org/Install | |
To add nginx yum repository, create a file named /etc/yum.repos.d/nginx.repo and paste one of the configurations below: | |
[nginx] | |
name=nginx repo | |
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ | |
gpgcheck=0 | |
enabled=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
mysql_connect("host","username","password") or die("Unable to Connect"); | |
mysql_select_db("dbname") or die("Could not open the db"); | |
$sql="select * from tablename"; | |
$result=mysql_query($sql); | |
while($row = mysql_fetch_array($result)) | |
{ | |
echo $row[0].' => '.$row[1]."\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yum install php | |
# yum install php-fpm | |
# yum install php-pecl-apc | |
# yum install php-pdo | |
# yum install php-mysqlnd.x86_64 | |
# service php-fpm restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Names] | |
count=2 | |
name1=Solarized Dark | |
name0=Solarized Light | |
[Solarized Light] | |
text(bold)=586e75 | |
magenta(bold)=6c71c4 | |
text=657b83 | |
white(bold)=fdf6e3 | |
green=859900 |
OlderNewer