Page 1 of 1

Connection problem

PostPosted: December 24th, 2008, 11:38 am
by draxtor@codeplex
Hi,
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 :

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>

to my phpNet section, so I put it. But the error remain the same.
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? 

RE: Connection problem

PostPosted: September 30th, 2009, 4:15 am
by supershowwei@codeplex

Anyone know it...???


RE: Connection problem

PostPosted: September 30th, 2009, 12:47 pm
by supershowwei@codeplex

I find the solution.

Phalanger must be 2.0 4th Beta.


RE: Connection problem

PostPosted: December 14th, 2010, 11:54 pm
by Jakub Misek

Hi,

we didn't notice, sorry. The extension is fixed and updated now to work with the latest Phalanger 2.0.

Best Regards,
Jakub 


Re: Connection problem

PostPosted: December 17th, 2014, 5:35 am
by Endrio143
I have "patched" the Extension and created a version that works with current Phalanger, now I am on the search for a way to release: Submitting a patch is unfeasable, as part of the "patch" was to rip out the ancient version of Mysql connector/.NET and replace it with a newer version.