1

So i have a problem that made me crazy :( when i use simplexml_load_file, curl or file_get in my local machine it works fine but when i moved on the server it doesn't work and i got the timeout error,

this is my simple code :

$res = simplexml_load_file(urlencode($url));

So please if someone has any idea i will be very appreciative :)

Mohammadov
  • 595
  • 3
  • 13
  • 34
  • check with your server admin for permissions (say firewall blockings) – shatheesh May 06 '14 at 13:22
  • `urlencode($url))` is most likely doubled. normally an URL is already urlencoded. So if not the variable is misnamed ... . - oh yeah, see your other question: [urlencode doesn't work in PHP (localhost)](http://stackoverflow.com/q/23491575/367456) ... you perhaps really confuse encodings here. – hakre May 07 '14 at 18:29

1 Answers1

0

Your server has probably allow_url_fopen set to off. Edit the php.ini file, find the line

allow_url_fopen = Off

and change it to

allow_url_fopen = On
davidkonrad
  • 83,997
  • 17
  • 205
  • 265