是否可以在Visual Studio中一起使用php和asp。 [英] Is it is possible to use php and asp together in visual studio.

查看:55
本文介绍了是否可以在Visual Studio中一起使用php和asp。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在Visual Studio中使用php和asp。如果可能请提供解决方案。

Is it is possible to use php and asp together in visual studio. If possible please give the solution.

推荐答案

请参阅我对该问题的评论。只是你会在PHP中编写一些页面,在APS.NET中编写其他页面。没有什么能阻止他们互相交叉引用,对吧?并且您的HTTP服务器应配置为支持这两种技术。是否支持ASP.NET,PHP不会成为问题。请参阅HTTP服务器的文档。



从这个问题来看,我不确定您是否真的了解Visual Studio或其他IDE在开发中的作用。实质上,您只创建要部署(或构建然后部署)的文件。 IDE仅为您提供正确写入文件的帮助。它本身不构建或部署任何东西。但是,协助编写代码的最重要和最有价值的工具之一是调试器。这是你有更多问题...



虽然Visual Studio本身支持ASP.NET,它提供了支持ASP.NET的开发服务器和全面的调试工具,它本身不支持PHP。它只是意味着您必须找到一个不同的IDE来开发PHP(这可能就像用于编写PHP文件的文本编辑器一样简单),或者您需要找到一些Visual Studio附加组件。请参阅:

http://visualstudiogallery.msdn.microsoft.com / 6eb51f05-ef01-4513-ac83-4c5f50c95fb5 [ ^ ],

http://php4vs.codeplex.com/ [ ^ ](停用)。



一些附加组件可能是专有的和商业的。您可以自己查看它们: http://bit.ly/16NoNMt [ ^ ]。



对于其他IDE,您可以尝试使用Eclipse进行PDT : http://www.eclipse.org/pdt/downloads/ [ ^ ]。



另一个有希望的选择是Aptana工作室。不幸的是,目前它只提供了一个PHP编辑器,但据说调试器很快就可以使用,据报道,调试已经支持,通过PDT或本机(请参阅下面的最后一个链接),但我没试过。请参阅:

http://www.aptana.com [ ^ ],

http://www.aptana.com/products/php/ [ ^ ],

http://stackoverflow.com/questions/7102978/aptana-3-0-4-and-php-debugging [ ^ ]。



全部是关于使用HTTP的标准PHP。但是,我曾经使用过更多的奇特选项:PHP for ASP.NET。我使用的产品叫做Phalanger:

http://en.wikipedia.org/ wiki / Phalanger_%28compiler%29 [ ^ ],

http://www.php-compiler.net/ [ ^ ]。



它将PHP编译为CLI程序集,因此可以像使用ASP.NET页面一样在ASP.NET解决方案中使用。它具有良好的Visual Studio集成,因此,我使用此产品在标准PHP中开发,只是为了能够使用PHP调试器。我使用了该语言的常用子集和PHP库,开发了单独的片段/模块,然后将它们移动到不支持ASP.NET的站点。那时,我找不到其他方法来调试PHP代码。



但是,如果你已经在使用支持ASP.NET的服务器并且还在PHP中开发, Phalanger可能会为你制作一个完美的工具。



-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


是的,你可以使用Phalanger,一个用于.NET的PHP编译器来实现这一点: http://www.php-compiler.net/ [ ^ ]
Yes, you can do this using Phalanger, a PHP compiler for .NET: http://www.php-compiler.net/[^]


这篇关于是否可以在Visual Studio中一起使用php和asp。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆