摘要:修改php.ini中的session.auto_start=0为session.auto_start=1MAC 的php.ini 在 /private/etc/ 目录下修改的时候发现sudo 也是readonly,查看后发现没有写的权限,chmod u+w php.ini即可。
阅读全文
摘要:这个错误很常见,很明显找不到文件。原因是php-fpm找不到SCRIPT_FILENAME里执行的php文件,所以返回给nginx 404 错误。那么两种情况要么文件真的不存在,要么就是路径错误。location / { root /var/www/example.com; index index.html index.htm index.pl; }如果配置文件这样的,那么明显不好,也就是在location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index ind...
阅读全文
摘要:php-fpm 是预装在mac os上的,你只需要配置就好了。这个服务监听9000端口。1. 为配置文件准备一些目录mkdir -p /usr/share/php/var/runmkdir -p /usr/share/php/var/logmkdir -p /usr/share/php/var/session2. 修改配置文件cp /private/etc/php-fpm.conf.default /private/etc/php-fpm.conf找到pid等进行如下修改pid = /usr/share/php/var/run/php-fpm.piderror_log = /usr/share
阅读全文
摘要:这个最典型的就是电话本,然后根据A-Z分组, 当然很多例子,不过现在发现一个很简洁易懂的:1. 准备数据,定义一个dictionary来显示所有的内容,这个dictionary对应的value全是数组也就是:A -> A1, A2...B -> B1, B2......NSMutableDictionary *sections;2. 创建所有的KeysBOOL found; // Loop through the books and create our keys for (NSDictionary *book in self.books) //self.books 就是包含NSD
阅读全文
摘要:idfriendiduser应该使用[user objectForKey:@"id"][friend objectForKey:@"id"]替换user.id;friend.id;
阅读全文
摘要:IOS 6 升到 IOS7 之后出现的状况新建一个工程,删除默认的ViewController,拖拽一个TableViewController到storyboard。即使没有勾选"Extend Edges Under {Top, Bottom, Opaque} Bars"或者self.edgesForExtendedLayout=UIRectEdgeNone;self.extendedLayoutIncludesOpaqueBars=NO;self.automaticallyAdjustsScrollViewInsets=NO;UITableView都会在status ba
阅读全文
摘要:git rm --cached ProjectFolder.xcodeproj/project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfaceState.xcuserstategit commit -m "Removed file that shouldn't be tracked"
阅读全文
摘要:sudo adduser william sudo passwd william //两次输入密码赋予root权限visudo找到## Allow root to run any commands anywhereroot ALL=(ALL) ALL#添加william ALL=(ALL) ALL如果不想sudo输入密码 上面的william ALL=(ALL) NOPASSWD: ALL这时就可以 sudo su - 切换到root用户了删除用户userdel william路径同时删除userdel -r william
阅读全文
摘要:The constants for specifying the alpha channel information are declared with the CGImageAlphaInfo type but can be passed to this parameter safely.Just use a cast to suppress the warning:CGBitmapInfo bitmapInfo =(CGBitmapInfo) kBitmapInfo;
阅读全文
摘要:ArgumentError (A secret is required to generate an integrity hash for cookie session data. Use config.secret_token = "some secret phrase of at least 30 characters"in config/initializers/secret_token.rb)解决方法rake secret
阅读全文