Click here to Skip to main content
16,017,852 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Is it is possible to use php and asp together in visual studio. If possible please give the solution.
Posted
Comments
Sergey Alexandrovich Kryukov 16-Oct-13 12:22pm    
Solution for what? Just use them. Do you really understand how "together"? Some pages could be written in PHP, some others in ASP.NET. It has little to do with Visual Studio.
—SA
udayams 21-Oct-13 5:35am    
I only need to know is it is possible. If possible how we can integrate it with each other.

Thanks.
Sergey Alexandrovich Kryukov 21-Oct-13 10:31am    
Nothing prevents you from doing so. I answered. "Integration" could be just having" URLs from one page used in href on another one, but it has nothing to do with implementation of each on the server side. Do you see the point?
—SA

Please see my comment to the question. It's just that you would have some pages written in PHP and others in APS.NET. Nothing prevents them from cross-referencing each other, right? And your HTTP server should be configured to support both technologies. Is ASP.NET is supported, PHP won't be a problem. Refer to the documentation of your HTTP server.

From this question, I'm not sure if you really understand the role of Visual Studio or other IDE in development. Essentially, you only create files to be deployed (or built and then deployed). IDE only provides you assistance in writing file correctly. It does not build or deploy anything by itself. But one of the most important and valuable tools assisting with writing code is the debugger. This is where you have some more problems…

While ASP.NET is natively supported by Visual Studio which provides the ASP.NET-enabled "development server" and comprehensive debugging tools, it does not natively support PHP. It simply means that you have to find a different IDE to develop in PHP (which could be as simple as the text editor used to write PHP files), or you need to find some Visual Studio add-ons. Please see:
http://visualstudiogallery.msdn.microsoft.com/6eb51f05-ef01-4513-ac83-4c5f50c95fb5[^],
http://php4vs.codeplex.com/[^] (discontinued).

Some add-ons could be proprietary and commercial. You would to look at them by yourself: http://bit.ly/16NoNMt[^].

As to other IDEs, you could try PDT with Eclipse: http://www.eclipse.org/pdt/downloads/[^].

Another promising option would be Aptana Studio. Unfortunately, currently it only provides a PHP editor, but the debugger is said to be available soon, besides, reportedly, the debugging is already supported, via PDT or natively (please see the last link below), but I did not try it out. Please see:
http://www.aptana.com[^],
http://www.aptana.com/products/php/[^],
http://stackoverflow.com/questions/7102978/aptana-3-0-4-and-php-debugging[^].

That all was about using "standard" PHP for HTTP. However, I used to use much more exotic option: PHP for ASP.NET. The product I used is called Phalanger:
http://en.wikipedia.org/wiki/Phalanger_%28compiler%29[^],
http://www.php-compiler.net/[^].

It compiles PHP into CLI assemblies and thus can be used in ASP.NET solution the same way as ASP.NET pages are used. It has a good Visual Studio integration, So, besides, I used this product to develop in "standard" PHP, just to be able to use the PHP debugger. I used common subset of the language and PHP libraries, developed separate fragments/modules and later moved them to the site which isn't ASP.NET-enabled. At that time, I could not find other ways to debug PHP code.

But, if you are already using ASP.NET-enabled server and also develop in PHP, Phalanger might turn out to make a perfect tool for you.

—SA
 
Share this answer
 
v2
Comments
Thomas Daniels 16-Oct-13 12:58pm    
More complete than my answer and well explained, +5!
Sergey Alexandrovich Kryukov 16-Oct-13 13:02pm    
Thank you very much.
—SA
Yes, you can do this using Phalanger, a PHP compiler for .NET: http://www.php-compiler.net/[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 16-Oct-13 12:50pm    
Phalanger is not quite the same PHP as the one used in Web development. This is PHP for .NET and for ASP.NET. At least you should have explained that, to avoid confusion. I also recommended Phalanger, but this should be a special decision, I explained it. Besides, OP can choose some other tools for development in "standard" PHP — please see Solution 2.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900