Opening Visual Studio 2012 error

Phalanger Tools for Visual Studio [?] is complete PHP/Phalanger integration into Visual Studio development environment.

Opening Visual Studio 2012 error

Postby fabianosimoes » March 19th, 2013, 8:04 pm

Hello, guys.

I'm trying to use Visual Studio 2012 to create a Phalanger Web Application using the installed templates inside VS 2012, but I cannot do it due to this error message appearing before visual studio starts:

---------------------------
Phalanger Tools for Visual Studio
---------------------------
'Phalanger Tools' requires latest Phalanger 3.0 to be installed. Download free package at http://phalanger.codeplex.com/.

Continuing without compatible Phalanger version can destabilize Visual Studio.

Invalid PhpNetCore.dll, 'PHP.Core.AST.TraitsUse' could not be found!


The point is that I have PHP Tools and Phalanger Tools for Visual Studio installed on my machine. Any idea on how I can solve this problem? What I am doing wrong?

Any help is apreciated.

Thanks!
fabianosimoes
 
Posts: 5
Joined: March 19th, 2013, 8:02 pm

Re: Opening Visual Studio 2012 error

Postby Jakub Misek » March 19th, 2013, 8:11 pm

Hi,

This message says, you don't have latest Phalanger installed. Just download setup at http://phalanger.codeplex.com/ and (re)install Phalanger.

Thanks,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Opening Visual Studio 2012 error

Postby fabianosimoes » March 19th, 2013, 8:25 pm

Thanks for replying, Jakub.

I've installed Phalanger laters version (both compiler and Phalanger Tools) and the error disappeared. Visual Studio now opens with no errors.

Now I want to create a new PHP project in Visual Studio to run with Phalanger. I saw screenshots showing a web site template for Phalanger when I open "New -> Web Site" menu, but I can't find it on my Visual Studio 2012.

What else do I need to get this template and run websites with Phalanger?

Thanks!
fabianosimoes
 
Posts: 5
Joined: March 19th, 2013, 8:02 pm

Re: Opening Visual Studio 2012 error

Postby Jakub Misek » March 19th, 2013, 8:58 pm

Great!

You are right, Phalanger WebSite templates are not available in VS2012.

For now you can simply create any ASP.NET WebSite project, and add following into web.config
Code: Select all
<configuration>
  <system.webServer>
    <handlers>
      <add name="Phalanger Handler" path="*.php" verb="*" type="PHP.Core.RequestHandler, PhpNetCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0a8e8c4c76728c71" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode"/>
    </handlers>
  </system.webServer>
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Opening Visual Studio 2012 error

Postby fabianosimoes » March 20th, 2013, 4:24 pm

Jakub,

Thanks for the answer. That worked for me, I put the configuration in VS 2012 and it worked! I installed VS 2010 with Phalanger Tools and I sucessfully ran a PHP website from it.

But I just have a doubt about Phalanger core: how do I know that I'm using a compiled code instead of a interpreted code? Isn't this the advantage of using Phalanger for websites?

I've created a simple website in PHP widh a index.php showing some code in PHP mixed with HTML markup. When I run the debug in Visual Studio, the site runs with no errors and I can see the output in the browser. But it seems that it's using PHP interpreter, not Phalanger... How can I build a pure PHP website, compile it and see the site in the browser? Do I have to compile it via command line before run it?

I ask these things because I didn't find anything in the documentation. All I found is how to make PHP inside C# code and vice-versa. What I want is to build a pure PHP website with no C# code and run it with Phalanger, so I can boost the execution performance in my site.

Can you help me with some information about it?

Thank you very much for now. :)
fabianosimoes
 
Posts: 5
Joined: March 19th, 2013, 8:02 pm

Re: Opening Visual Studio 2012 error

Postby Jakub Misek » March 20th, 2013, 6:19 pm

Hi,

Once you handle *.php files with PHP.Core.RequestHandler, any requested .php script file gets compiled.

If you created PHP project (which is also included in Phalanger Tools), requests are interpreted with php-cgi.exe.

So you have to be sure, you are running asp.net website, and .php files are handled with handler I've mentioned above. Projects in "PHP" folder are using PHP not Phalanger.

Thanks,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Opening Visual Studio 2012 error

Postby fabianosimoes » March 21st, 2013, 10:10 pm

Hi, Jakub!

Thank you very much for the answers. My mind is clear now and now I can run my site.

I'm using Codeiginiter framework and I'm having little configuration problems with it, but nothing terrible to make a new post here.

Thank you!
fabianosimoes
 
Posts: 5
Joined: March 19th, 2013, 8:02 pm


Return to Phalanger Tools

Who is online

Users browsing this forum: No registered users and 13 guests

cron

User Control Panel

Login

Who is online

In total there are 13 users online :: 0 registered, 0 hidden and 13 guests (based on users active over the past 5 minutes)
Most users ever online was 256 on March 28th, 2024, 9:42 am

Users browsing this forum: No registered users and 13 guests