dongzhuo1930 2018-08-09 15:53
浏览 67

使用Faker伪造图像总是返回false

Hello guys I'm trying to use Faker to populate images on my localhost but it always return false. this is my code

use Faker\Factory as Faker;
$faker = new Faker;
$faker::create()->image('public/images', 400, 300, null, false); // This returns false instead of the created image name.

I tried is with tinker and hardcoded in my code and always returns the same thing. I think it's because of permissions or something like that. I'm using kali linux. I also tried sudo chmod -R 777 on my folders but same problem still exists. Can anyone here help me?

  • 写回答

1条回答 默认 最新

  • dongshuogai2343 2018-08-09 17:42
    关注

    I solved it. There was two errors. the first one was that lorempixel.com doesn't work with me (I don't know why I just try to visit it with my browser and it doesn't open. returns "This site can’t be reached"). So I replaced that link with placekitten.com and it returned the same problem "return false". after many attempts with curl to find out the problem I found that I must not use https with placekitten.com. I edited it and it works well!

    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么