PHP 错误控制运算符@

PHP Bookmarks

HandBook

CentOS - phpMyAdmin的安装

安装phpMyAdmin

1
sudo yum install phpmyadmin

phpMyAdmin连接阿里云RDS

sudo vi /etc/phpMyAdmin/config.inc.php 修改$cfg['Servers'][$i]['host']的值

1
2
3
4
5
6
7
8
// The $cfg['Servers'] array starts with $cfg['Servers'][1].  Do not use
// $cfg['Servers'][0]. You can disable a server config entry by setting host
// to ''. If you want more than one server, just copy following section
// (including $i incrementation) serveral times. There is no need to define
// full server array, just define values you need to change.
$i++;
$cfg['Servers'][$i]['host'] = 'xxxx.mysql.rds.aliyuncs.com'; // MySQL hostname or IP address
$cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port

Xcode 下本地文件一键同步到服务端

新建工程

Xcode--New--Project--OS X--Other--External Build System

Git - Please tell me who you are.

解决方案

1
git config --global user.email "you@example.com"

PHP Date() 函数

小测试……

1
2
3
4
5
6
7
8
9
date("Y-m-d"); // 2015-02-10

$now = microtime(TRUE);
date("Y-m-d", $now); // 2015-02-10
date("Y-m-d", $now - 60 * 60 * 24); // 2015-02-09

mktime(hour, minute, second, month, day, year)
$t = mktime(13, 2, 3, 2, 10, 2015);
date("Y-m-d H:i:s", $t); // 2015-02-10 13:02:03

磁盘空间常用命令

磁盘空间常用命令

1
2
3
df -h   #磁盘剩余空间
du -sh #当前目录总大小
du --max-depth=1 -h #当前目录空间使用情况

php 获取当前时间的错误

之前一直用这个方法获取当前时间:

1
$now = new DateTime();

关于 Posts 的时间戳

Wordpress 搭建完后,需要先在 Dashboard - Settings 中选择合适的时区,新建的Post的时间戳才会正确。