从网上找到一个商城项目,本地搭建了一下,记录一下排错历程。
项目:https://gitee.com/xany/yoshop2.0.git
- http://localhost/admin
登录,报token失败
浏览器查看network xhr,看api响应信息,可以看到报错是permission denied,于是就
1 | chmod -R 777 yoshop2.0/runtime/ |
程序会在runtime目录下创建文件夹,没有权限,赋予权限就可以了。
php版本问题,php版本升级
1
brew reinstall php@8.2
查看brew启动的服务:
1
brew services list
重启php服务:
1
brew services restart php
启动商城
1
2sudo apachectl stop
sudo apachectl start{statusCode: 0, errMsg: ‘Call to undefined function yiovo\captcha\imagettftext()’, result: {…}}
http://localhost/index.html
进入商城主页,登录时出现报错。
请求:http://localhost/index.php?s=/api/captcha/image
响应:{“message”:”Call to undefined function yiovo\captcha\imagettftext()”,”status”:500,”data”:[]}
We smile, we angry, we disappoint, we excited, we love, we hate, that’s our life.
书山有路勤为径,学海无涯苦作舟。
欢迎关注微信公众号:【程序员写书】
喜欢宠物的朋友可以关注:【电巴克宠物Pets】
一起学习,一起进步。
