Connection problem
Connection problem
I installed Phalanger 2 march 2008 edition and then I downloaded MySql Managed Extension for Phalanger (4th Beta).
I copied the extension and run cmd file and all files were writen to GAC.
Then I tried simple test:
mysql_connect("127.0.0.1","root","vt381")ordie ("Could not connect");
print ("Connected successfully");
mysql_close ();
I tried with localhost too. I was amazed that there is no single example of mysql connection with phalanger so I assumed it works same as in good old PHP.
I put this code in my web.config
<phpNet>
<!--Reference to the extension assembly-->
<classLibrary>
<addassembly="PhpNetMySql, Version=2.0.0.0, Culture=neutral, PublicKeyToken=2771987119c16a03"section="mysql"/>
</classLibrary> </phpNet>
I finished up with:
Value cannot be null.
Parameter name: descriptor
Source Error: Line 5: $a=1;Line 6: echo ++$a;Line 7: mysql_connect("127.0.0.1", "root", "vt381") or die ("Could not connect");Line 8: print ("Connected successfully");Line 9: mysql_close ();
Source File: C:\.net\web\phpSite\default.php Line:7
Stack Trace: [ArgumentNullException: Value cannot be null.Parameter name: descriptor] PHP.Core.LocalConfiguration.GetLibraryConfig(PhpLibraryDescriptor descriptor) +70 PHP.Library.Data.MySqlConfiguration.get_Local() +34 PHP.Library.Data.MySql.Connect(String server, String user, String password, Boolean newLink, ConnectFlags flags, Boolean persistent) +67 PHP.Library.Data.MySql.Connect(String server, String user, String password) +38 <Script>.<Main>(ScriptContext <context>, Dictionary`2 <locals>, DObject , DTypeDesc , Boolean ) in C:\.net\web\phpSite\default.php:7[TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0 System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +71 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +261 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29 PHP.Core.PhpFunctionUtils.Invoke(MethodInfo method, Object target, Object[] args) +166 PHP.Core.PhpScript.InvokeMainHelper(Type script, ScriptContext context, Dictionary`2 variables, DObject self, DTypeDesc includer, Boolean isMain) +140 PHP.Core.ScriptContext.<IncludeScript>b__0(Object scriptType) +51 PHP.Core.ScriptContext.GuardedCall(Action routine, Object data, Boolean allowUserExceptions) +225[PhpNetInternalException: Guarded call] PHP.Core.ScriptContext.GuardedCall(Action routine, Object data, Boolean allowUserExceptions) +372 PHP.Core.ScriptContext.IncludeScript(String relativeSourcePath, Type type) +197 PHP.Core.RequestContext.IncludeScript(String relativeSourcePath, Type type) +24 PHP.Core.RequestHandler.ProcessRequest(HttpContext context) +231 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
I found somewhere in this forum to put :
<paths>
<setname="DynamicWrappers"value=".." />
<setname="Libraries"value=".." />
<setname="ExtManager"value=".." />
<setname="ExtWrappers"value=".." />
<setname="ExtTypeDefs"value=".." />
<setname="ExtNatives"value=".." /> </paths>
Is there any working example how can I make MySql Connection? I see that AdoDb is recommended but AdoDb is using same mysql functions. I know I can use .net Objects but I wonder is it possible to use mysql functions?
- draxtor@codeplex
- Posts: 6
- Joined: January 7th, 2012, 8:52 pm
RE: Connection problem
Anyone know it...???
- supershowwei@codeplex
- Posts: 2
- Joined: January 7th, 2012, 8:59 pm
RE: Connection problem
I find the solution.
Phalanger must be 2.0 4th Beta.
- supershowwei@codeplex
- Posts: 2
- Joined: January 7th, 2012, 8:59 pm
RE: Connection problem
Hi,
we didn't notice, sorry. The extension is fixed and updated now to work with the latest Phalanger 2.0.
Best Regards,
Jakub
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
Re: Connection problem
- Endrio143
- Posts: 1
- Joined: December 17th, 2014, 5:27 am
Return to MySql Extension project
Who is online
Users browsing this forum: No registered users and 3 guests