Alternative to file_get_contents?

前端 未结 6 825
死守一世寂寞
死守一世寂寞 2020-12-04 23:44
$xml_file = file_get_contents(SITE_PATH . \'cms/data.php\');

The problem is that a server has URL file-access disabled. I cannot enable it, its a h

6条回答
  •  离开以前
    2020-12-05 00:16

    Yes, if you have URL wrappers disabled you should use sockets or, even better, the cURL library.

    If it's part of your site then refer to it with the file system path, not the web URL. /var/www/..., rather than http://domain.tld/....

提交回复
热议问题