1

In my code igniter project in WAMP I'm able to do this and it works:

file_get_contents('C:\wamp\www\codeigniter\application\controllers\calendarmonth.sql');

I can't seem to figure out which path to use when it's on my live shared hosting site.

When I do

file_get_contents(base_url() .'application/controllers/Calendarmonth.sql');

I get "HTTP request failed! HTTP/1.1 403 Forbidden"

David
  • 125
  • 11

2 Answers2

2

Move the Calendarmonth.sql file outside application folder.

If exist set allow_url_fopen in php


FYI

application/controller path will secure always. So if adding external file add to outside of application. Application root is always accessible.


Links

  1. ini_set not working
Community
  • 1
  • 1
Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85
0

I found a post at: base_url() function not working in codeigniter

The best answer there should probably a fix for you as well. You need to enable base_url() first in your configuration.

Community
  • 1
  • 1
sietse85
  • 1,488
  • 1
  • 10
  • 26