0

I am using .php files to send OTP messages for my app. When I hosted these files on my local machine, everything worked fine. Now, I have hosted these files on hostinger, when I call one of these files I get a response saying

curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir 
   is set in /home/u5050****/public_html/scbapp/smsauth/***sms-api.php on line 39

Please guide.

alexander.polomodov
  • 5,396
  • 14
  • 39
  • 46
Poda
  • 1
  • 1
  • 1
    Possible duplicate: http://stackoverflow.com/questions/2511410/curl-follow-location-error – node_modules Mar 29 '16 at 11:47
  • @C0dekid.php I did read that but, I didnt get that. Maybe coz im still new to php. – Poda Mar 29 '16 at 12:22
  • @C0dekid.php I am actually an Android developer who just got hold of `php` for OTP purpose. So if it is as simple as changing `php.ini` file or something similar, I can do it, rest of the php is, unfortunately, out of my reach. – Poda Mar 29 '16 at 12:31
  • can you try this: Open your `php.ini` and look for the open_basedir line and comment it. Then save the file and restart your server. First check if `safe_mode` is `off` – node_modules Mar 29 '16 at 12:33
  • Possible duplicate of [CURLOPT\_FOLLOWLOCATION cannot be activated](http://stackoverflow.com/questions/6918623/curlopt-followlocation-cannot-be-activated) – Lucas Moulin Mar 29 '16 at 12:33
  • @C0dekid.php I dont think it is the problem of safe mode. because the error should have mentioned otherwise. Unfortunately my host provider is not allowing me to access the `php.ini` file as of now. – Poda Mar 29 '16 at 12:40
  • And if you put at the beginning of your script, under ` – node_modules Mar 29 '16 at 12:42
  • @C0dekid.php I am still getting that error. Hey, can I also set safe mode off like this from my php file? – Poda Mar 29 '16 at 12:54
  • @Poda Yeah, could you give it a try? Let me know what happend then. Give it the value "`off`" – node_modules Mar 29 '16 at 12:55
  • @C0dekid.php I am also getting a new warning saying: `curl_setopt(): open_basedir restriction in effect. File(cookie_way2sms) is not within the allowed path(s): (none) in /home/u5******15/public_html/s****p/smsauth/way2sms-api.php on line 38` – Poda Mar 29 '16 at 12:55
  • Hmm, I think you need to ask your host provider to turn of these if they want to. My solutions are empty for now. – node_modules Mar 29 '16 at 12:57
  • Possible duplicate of [curl follow location error](https://stackoverflow.com/questions/2511410/curl-follow-location-error) – Kirrus Jun 01 '17 at 17:49

0 Answers0