PHP随机调用图片请求的网址
比如我有2个域名,想随机调用减轻负载可以这样使用:
建立一个read.php
// 全部图片地址 $hostArr = array( 'https://i1.100024.xyz', 'https://img.545141.com' ); //获取数组随机值 $host = $hostArr[array_rand($hostArr)]; $query = isset($_GET['img'])?$_GET['img']:'/404.png'; header("Location: $host$query");
- 网址调用方法
调用方法就是请求这个read.php?img=图片地址
比如:https://i1.100024.xyz/read.php?img=/i/2021/10/28/uq8k22.jpg
iPhone 15_1Safari 604.1来自 火星 的大神
Warning: is_dir(): open_basedir restriction in effect. File(/i/2021/11/02/) is not within the allowed path(s): (/www/wwwroot/mm-img/:/tmp/) in /www/wwwroot/mm-img/libs/function.php on line 69
Warning: is_writable(): open_basedir restriction in effect. File(/i/2021/11/02/) is not within the allowed path(s): (/www/wwwroot/mm-img/:/tmp/) in /www/wwwroot/mm-img/libs/function.php on line 73
一直提示这个。我是没办法了。前来请教。急切!!!
删除目录下的use.ini就可以了