CodeIgniter vs Godaddy Problems
Hello every one. I’ve been planning for this post long. But couldn’t manage time. This is about a problem i have faced during my freelance work on mid August for a client in Bosnia. My web application was built with CI and was working fine in local as well as remote server. But was causing problem on clients Godaddy server.
Problems were:
- It was giving problem ‘404 Page Not Found’ when requesting default route.
- Request with full url with controller was giving ‘No input file specified’. Which was solved by putting ‘index.php?’ in the config file. But i want to remove the index.php from the url. Have tried all the .htaccess settings suggested in the forum.
- All the database transaction gives a error like below:
A PHP Error was encountered
Severity: Warning
Message: mysql_real_escape_string() expects parameter 2 to be resource, boolean given
Filename: mysql/mysql_driver.php
Line Number: 227
After that i tried some suggestions from this user guide page. Which actually solved my problem No. 1 with changes in config.php like below:
$config['uri_protocol'] = "QUERY_STRING";
and
$config['uri_protocol'] = "ORIG_PATH_INFO";
Other settings were either failing or was giving me the default controller for all the url i request for. But my problem No 2 and 3 was still on loose.
Then again i’ve started to investigate and found a problem of database connection. Actually i was so sure that DB connection settings problem will show me an error on initial stage that i’ve never double checked the DB settings. But for some weired reason, CI doesn’t show any error on DB connection problem over Godaddy. So beware of it.
So after rechecking the DB settings my problem No 3 was gone. Now lets see the .htaccess settings for problem No 3 which works under Godaddy server:
Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|img|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
Additional to the solutions above, also try to re ftping your scripts. Just in case. Also some others suggested me to avoid this host to save time
.
Whole thing was done with suggestions and help of great CodeIgniter forum. You can get further help and old discussions over there.
You can also visit my clients site here. Which (thanks God) is running smoothly ever since.
Thank you all.

ImageSmith said,
Tuesday, 11th December, 2007 at 5:16 am
great resource marahman.
fyi, i have run into similar probs on a server here in aust running php5. turns out that the phpinstall is funning as cgi. need to do similar fixes to make ci work.
cu in ci
Djordje said,
Tuesday, 25th December, 2007 at 7:45 am
Very helpful
Derek Allard said,
Sunday, 6th January, 2008 at 5:59 am
Fantastic! Thanks, this will help a user I have on Bamboo. Sincerely appreciate you taking the time to write this up!
HumaN said,
Sunday, 13th January, 2008 at 1:04 am
Thanks everybody.
My pleasure..
sam said,
Tuesday, 22nd January, 2008 at 9:19 pm
Good info there,
Just to update on problem number 3 which shows mysql error using codeIgniter, the new user should be created with password. Using existing or default user privileges doesn’t work many times.
HumaN said,
Tuesday, 22nd January, 2008 at 11:09 pm
Thanks Sam.
Appreciate your update.
Hope that helps other as well.
Jon said,
Saturday, 16th February, 2008 at 1:07 pm
Just so you’re aware, GoDaddy has something they call an “htaccess cache” that gets refreshed every hour.
I was frantically updating/deleting/changing my htaccess file on their server trying to get rid of the ‘index.php?’ without seeing any sign of hope. When I sat back and just waited for an hour, everything suddenly worked correctly.
HumaN said,
Saturday, 16th February, 2008 at 3:29 pm
Thanks for the update Jon,
I think this could be the reason for many confusions..
good days…
kamal somani said,
Friday, 25th April, 2008 at 2:01 pm
all working fine with “/index.php?/” , but still unable to configure it excluding index.php, its gives a blank page..
i have tried changing the config file as below ….
$config['uri_protocol'] = “AUTO”; (have tried all other options also)
$config['index_page'] = “index.php?”; (also tried making it null ” )
but none worked..
My godaddy hosting has many domians as sub-folders on the root .. and each domain is directed to its own directory…
plz help. me to remove the index.php from the url..
thanks
HumaN said,
Friday, 25th April, 2008 at 4:31 pm
Kamal,
please see Jon’s comment above on, “GoDaddy has something they call an “htaccess cache” that gets refreshed every hour.”
I think this is causing the problem you are facing at the moment.
take care…
Mete Ercan Pakdil said,
Thursday, 22nd May, 2008 at 10:03 pm
I tried .htaccess that mentioned above but it didn’t work. After i added RewriteBase / , it works fine!
Chris Davis said,
Wednesday, 9th July, 2008 at 4:35 pm
Holy Cow,
Thanks so much for the help on getting rid of index.php? in the url string on a godaddy server. I had it working on my other hosting plan but one of my clients using godaddy I could not get it to work until I tried your .htaccess script above and now it works great!
thanks again!
Chris
Kai Meng Wong (victorwkm) » Blog Archive » mod_rewrite said,
Sunday, 25th January, 2009 at 11:18 am
[...] http://anon83.wordpress.com/2007/12/11/codeigniter-vs-godaddy-problems/ [...]
Keagan Chisnall said,
Monday, 21st September, 2009 at 5:02 pm
Thank you very much. Past two hours have been spent trying to solve this stupid problem, but it works 100% now
HumaN said,
Monday, 21st September, 2009 at 11:32 pm
Welcome Good to know it served your purpose.
CodeIgniter on Godaddy Servers « Concept Execution said,
Friday, 9th October, 2009 at 2:23 am
[...] Helpful Links: http://codeigniter.com/user_guide/installation/troubleshooting.html http://anon83.wordpress.com/2007/12/11/codeigniter-vs-godaddy-problems/ [...]
harman said,
Saturday, 28th November, 2009 at 7:18 pm
gr8 work thanks a lot