yaf框架初探-从passport搭建开始
1、 代码所在位置
qq邮箱
2、访问链接
Usersystem ; http://luluhost:8887/point/Point.html#.
Passport http://luluhost:8888/Member/login
Login: http://luluhost:8885/login.html. icode上也有
3、passport搭建步骤记录
1、Mysql 用的个人开发机上上的,安装待补充
2、Redis : redis用的之前的 安装待补充
3、Nginx安装
https://github.com/nginx/nginx/tree/release-1.8.1 zip
https://blog.csdn.net/zsx0728/article/details/80915726
Nginx配置 先安装php及fpm
4、php 安装及配置
https://blog.csdn.net/ass_assinator/article/details/78096183 php安装
http://www.php.net/manual/zh/install.fpm.install.php php-fpm 上面编译带着fpm参数即可
./configure --prefix=/home/work/bin/php --with-config-file-path=/home/work/bin/php/etc --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl --with-zlib --with-curl --with-libxml-dir --with-pear --with-gettext --enable-inline-optimization --enable-soap --enable-sockets --enable-mbstring --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx
./php-fpm -R 启动fpm
5、nginx配置
server {
listen 8888;
server_name luluhost;
root /home/work/passport/public/;
location / {
root /home/work/passport/public/;
# root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
include fastcgi_params;
}
location ~ .*\.(html)$
{
expires 12d;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ttf|woff|woff2|svg|eot)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location = /50x.html {
root html;
}
}
Fpm的配置文件 user group 改成work
启动了nginx
4、踩坑记录
1、http://luluhost:8888/index.php 报 500 少yaf框架
http://www.php.cn/php-weizijiaocheng-395926.html yaf 扩展 安装的2.3.4版本 太高或者太低了 make不过
2、yaf.use_spl_autoload php.ini开启自动加载 因为passport的命名不太符合 library文件命名符合yaf标准的话不用开启 yaf自动加载规则
3、mysql中插入用户 用户密码需要加密 select sha1(md5(‘设置的密码’));
insert into user (uid,account,password,name,email) values(null,‘aaa’,‘aaa’,‘aaa’,‘aaa’)
4、php报错没有redis扩展
https://www.cnblogs.com/doseoer/p/6161110.html. redis扩展安装
5、 https://www.cnblogs.com/suanshun/p/7699084.html redis密码账号配置
6、http://www.ptbird.cn/phpmailer-can-not-connect-to-smtp-host.html. 邮件发送失败解决
7、http://www.php.cn/php-weizijiaocheng-371745.html php异常处理