CodeIgniter Forums
error: could not find driver - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: error: could not find driver (/thread-1964.html)



error: could not find driver - El Forum - 07-08-2007

[eluser]mpc[/eluser]
I have a new CI site working, perfectly, on my notebook (XAMPP on XP), but when I try running it on a Linux web hosting server, that runs PHP as CGI, I get the error:

could not find driver

I'm guessing that the web host CGI setup isn't set up for PDO/SQLite (SQLite being the missing driver, although I thought SQLite was built into PHP5+ ? ... not in php-cgi?).

The web hosting outfit (GoDaddy) allows creating/running a PHP.ini in the document root ... and PHP.ini changes take place, immediately, because php-cgi calls PHP.ini for each PHP script. However, PHP.ini for CGI is foreign ground for me ... and Googling hasn't turned up CGI PHP.ini examples.

I've seen references like:
./configure '--enable-pdo=shared' '--with-pdo-sqlite=shared' '--with-sqlite=shared'

... but, I don't see examples of how to accomplish that in a CGI PHP.ini file.

And, I wonder does a web hosting document root PHP.ini overwrite the GoDaddy's default PHP.ini ? As I said, this is foreign ground to me ... and I'm hard pressed to find illustrative examples. GoDaddy, of course, offers no CGI PHP.ini examples (that I've found). Please pardon my ignorance! Undecided ... if you can ...

Are there any CGI PHP.ini experts out there, who might shed light on this?
Perhaps others might benefit ... by being able to wrestle a php-cgi web hosting configuration?

thanks ... in advance


error: could not find driver - El Forum - 07-10-2007

[eluser]OwanH[/eluser]
Hey mpc, just a few suggestions:

1. Check with your host to see the PDO/SQLite extension has been installed on your web hosting server.

2. If it has, create a PHP.ini file in your document root (since you said your web hosting outfit allows that) and make sure it contains the following line:

Code:
extension=pdo.so

This makes sure that the PDO extension will be loaded automatically when PHP runs.

3. If this still doesn't solve the problem then try using the phpinfo() function to see if PDO/SQLite is listed as an installed and loaded module. If you don't see it then it means your host does *NOT* have it installed.


error: could not find driver - El Forum - 07-10-2007

[eluser]mpc[/eluser]
Thanks so much for the kindness of a reply, Owan

Per PHPinfo(), the GoDaddy Linux "Economy Hosting Plan" is running PHP 5.1.4 and SQLite 2.8.17.

While I'm well familiar with the PHP Apache module drill, where one needs to re-start Apache for PHP.ini changes to take effect, I've not seen much written on how php-cgi differs. GoDaddy said 'ok' to a document root PHP.ini and that on php-cgi each PHP script refers to PHP.ini. Hmmm ... ? How far can I take that, I wondered? Not far, it turns out ... I tried:

extension=pdo.so
extension=sqlite.so

extension=php_pdo.so
extension=php_pdo_sqlite.so

extension=php_pdo_sqlite.so
extension=sqlite3.so

... all to no avail. I did discover that PDO must be loaded before SQLite.

GoDaddy tech support replied to my question with:
"on a shared server hosting account, this would not be possible. You would need a Virtual Dedicated or Dedicated server in order to make this level of modification."

... so much for the php-cgi usefulness of the document root PHP.ini %-P


error: could not find driver - El Forum - 07-10-2007

[eluser]OwanH[/eluser]
[quote author="mpc" date="1184113218"]GoDaddy tech support replied to my question with:
"on a shared server hosting account, this would not be possible. You would need a Virtual Dedicated or Dedicated server in order to make this level of modification."[/quote]

It just sucks doesn't it Smile. It's like telling you have rights to do something then in another breath telling you you don't have privileges to do anything useful :-S.

Well I guess you could try asking them if they can configure the global php.ini to load the PDO/SQLite extensions automatically so u don't have to. Think it might be worth a shot?