Page 1 of 2
Issue Using PDO with SQLite
Posted:
June 4th, 2014, 11:37 pm
by MX26
Hi there,
I am having an issue creating an SQLite database using PDO. In my PHP/Phalanger class - I have the line:
$db = new PDO('sqlite:AQA.sqlite3');
Compiling the class in Pure Mode produces no issues. However, when I attempt to call the function containing the previously mentioned statement, VS2013 throws an error that reads "Driver not found".
I have the PhpNetPDOSQLite .dll referenced in my VS project.
Thanks in advance,
Geoff
Re: Issue Using PDO with SQLite
Posted:
June 6th, 2014, 12:44 pm
by Jakub Misek
hi Geoff,
Try to add reference to the driver into your web.config file.
- Code: Select all
<phpNet><classLibrary>
<add assembly="PhpNetPDO, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2771987119c16a03" />
<add assembly="PhpNetPDOSQLite, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2771987119c16a03" />
Re: Issue Using PDO with SQLite
Posted:
June 6th, 2014, 3:16 pm
by MX26
Jakub,
Thanks for your response.
This is a Win Forms project. Adding the reference should have added the assembly reference to my config file, right?
Thanks,
Geoff
Re: Issue Using PDO with SQLite
Posted:
June 6th, 2014, 11:11 pm
by MX26
Further updates on this issue:
I'm messed around with making a local app.config file with the code you supplied. Additionally, I threw together an app.config file modeled after a sample one that I found online. Still no luck initializing the PDO class.
I get two different errors depending on how I structure the function arguments:
1) "Driver not found"
2) "PDO aliasing"
Thanks,
Geoff
Re: Issue Using PDO with SQLite
Posted:
June 8th, 2014, 12:39 pm
by Jakub Misek
Hi Geoff,
Please attach your sample project. I'll take a look and probably fix extensions loading in Phalanger.
Thanks,
Re: Issue Using PDO with SQLite
Posted:
June 8th, 2014, 10:34 pm
by MX26
Jakub,
I am developing this program as a portion of a client's project so I am not at liberty to send you the full program. Can you walk me through the fix? I am happy to pay a fee if you feel that the fix will take some time. I plan on purchasing a full Phalanger license as soon as my trial license runs out.
Thanks,
Geoff
Re: Issue Using PDO with SQLite
Posted:
June 9th, 2014, 3:28 am
by Jakub Misek
Hi Geoff,
We can prepare just a sample project to show the configuration.
Please note Phalanger is an opensource project with the community support at here and
https://github.com/DEVSENSE/Phalanger Phalanger Tools are tools for Phalanger, paid support does not cover Phalanger opensource project.
Thanks,
Re: Issue Using PDO with SQLite
Posted:
June 9th, 2014, 11:02 am
by MX26
Jakub,
Great - I would really appreciate that. Again, if you feel that this will take some time I would be happy to pay a fee.
Thanks again,
Geoff
Re: Issue Using PDO with SQLite
Posted:
June 12th, 2014, 1:44 pm
by MX26
Bump.
Any progress here?
Re: Issue Using PDO with SQLite
Posted:
June 14th, 2014, 8:23 pm
by MX26
Problem is resolved!
Fix was implemented by adding your suggested assembly references in machine.config file of .NET 4.
I'd like to note that I ran the Phalanger Tools installer several times. Both times Phalanger Tools install failed to update the machine.config file.
I have seen in several places that the installer should update machine.config automatically. Is this a bug with the new installer or simply not a feature that is supported?
Thanks,
Geoff