php: file_get_contents() work with CLI, but does not work when called on server (in page)

前端 未结 1 606
慢半拍i
慢半拍i 2021-01-13 19:25

I am slightly baffled.

I am using the bit.ly PHP API to shorten some urls. This works fine on local host - but when I tried it on my server (php running in Apache),

相关标签:
1条回答
  • 2021-01-13 20:03

    It probably has something to do with PHP configuration. Many servers have different php.inis for CLI and Apache. Check /etc/php5/ to see if there is more than one configuration. Specifically, you should be looking for allow_url_fopen.

    EDIT: Actually, Ubuntu ships with that by default, the .ini is located at /etc/php5/apache2/php.ini

    0 讨论(0)
提交回复
热议问题