2.0 4th Beta - Error: Class not found / Object reference not set to an instance of an object
1 post
• Page 1 of 1
2.0 4th Beta - Error: Class not found / Object reference not set to an instance of an object
Howdy,
I'm having trouble using .NET classes in my PHP code. After I encountered the error in my own code I tried the tutorials from the Wiki site and received the same errors. My system specs are:
Windows Server 2003
IIS version 6
ASP.NET 2.0.50727
Phalanger 2.0 4th Beta
Firstly, I tried the image resize tutorial from: http://php-compiler.net/doku.php?id=resize-image. This produced the following error message:
"Error: Class 'Bitmap' not found" on the line:
$bmp = Bitmap::FromFile($from);
I then tried the Download file tutorial from: http://php-compiler.net/doku.php?id=download-file-from-web. This produced the error:
Object reference not set to an instance of an object.
Line 8: {
Line 9: $client = new WebClient;
Line 10: $client->DownloadFile(new Uri($path), $name);
Line 11: }
Line 12:
I have tried the standard web.config from the Phalanger v2.0\WebRoot\Samples\SimpleScripts directory and even creating my own web.config file show below:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
<phpNet>
<compiler>
<set name="LanguageFeatures">
<add value="PhpClr" />
</set>
</compiler>
<classLibrary>
<add assembly="mscorlib" />
<add assembly="System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Drawing, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</classLibrary>
</phpNet>
</configuration>
Any ideas where the problem lies? I've been looking at this problem for a few hours now and have developed a mental block, so I imagine it's something stupid I may have done :)
Cheers!
Ste
I'm having trouble using .NET classes in my PHP code. After I encountered the error in my own code I tried the tutorials from the Wiki site and received the same errors. My system specs are:
Windows Server 2003
IIS version 6
ASP.NET 2.0.50727
Phalanger 2.0 4th Beta
Firstly, I tried the image resize tutorial from: http://php-compiler.net/doku.php?id=resize-image. This produced the following error message:
"Error: Class 'Bitmap' not found" on the line:
$bmp = Bitmap::FromFile($from);
I then tried the Download file tutorial from: http://php-compiler.net/doku.php?id=download-file-from-web. This produced the error:
Object reference not set to an instance of an object.
Line 8: {
Line 9: $client = new WebClient;
Line 10: $client->DownloadFile(new Uri($path), $name);
Line 11: }
Line 12:
I have tried the standard web.config from the Phalanger v2.0\WebRoot\Samples\SimpleScripts directory and even creating my own web.config file show below:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
<phpNet>
<compiler>
<set name="LanguageFeatures">
<add value="PhpClr" />
</set>
</compiler>
<classLibrary>
<add assembly="mscorlib" />
<add assembly="System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Drawing, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</classLibrary>
</phpNet>
</configuration>
Any ideas where the problem lies? I've been looking at this problem for a few hours now and have developed a mental block, so I imagine it's something stupid I may have done :)
Cheers!
Ste
- SteJ@codeplex
- Posts: 1
- Joined: January 7th, 2012, 8:55 pm
1 post
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 12 guests