我需要包括一些变量和代码从我的网站,我使用了include "example.com/folder/file.php";,我不能包括这个文件从我的网站。我有个付费的主持人。
我得到了以下错误:
Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in 
C:\xampp\htdocs\folder\file.php on line 8
W arning: include(http:/example.com/folder/file.php): failed to open 
stream: no suitable wrapper could be found in 
C:\xampp\htdocs\folder\file.php on line 8
Warning: include(): Failed opening 'http://example.com/folder/file.php' 
for inclusion (include_path='C:\xampp\php\PEAR') in 
C:\xampp\htdocs\folder\file.php on line 8(“example.com/文件夹/file.php”和"C:\xampp\htdocs\folder\file.php“是保护我隐私的说明性urls )
我希望你能帮助我。谢谢!
发布于 2020-11-25 04:32:34
您可以将这一行放在脚本的开头。
ini_set('allow_url_include',1);如果这不起作用,请参考allow_url_include并更新php.ini文件中的php.ini设置。
发布于 2020-11-28 01:19:27
解决问题的可能方法--创建您自己的web服务:
// local script
$localVersion = '1.0.0';
$remoteVersion = '';
// get remote version as json
if( $remote = json_decode(file_get_contents('http://example.com/version.php')) {
  // $remoteVersion=$remote['version'];
  $remoteVersion=$remote->version
}
if( $localVersion < $remoteVersion ) {
  // do whatever...
}远程脚本(version.php)
// load your initialization, or just set
$version = '1.3.0';
header('Content-Type: application/json');
echo json_encode(['version'=>$version]);
die;https://stackoverflow.com/questions/64997177
复制相似问题