Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 635 Vote(s) - 3.53 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can PHP and ASP.Net run together within the same web site in IIS 7.5?

#1
A portion of our site is done in PHP and a portion of our site is done in ASP.Net. We just set up a new web server with Windows Server 2008 R2 which has IIS 7.5 installed.

I understand that IIS 7+ supports PHP, but can PHP and ASP.Net run side-by-side within a single web site in IIS, or would I have to set up one web site for the PHP pages and one web site for the ASP.Net pages?
Reply

#2
Yes, it will be not a problem. Even some Windows Shared Hosts offer PHP plans - **[Windows Hosting PHP][1]**.


[1]:

[To see links please register here]

Reply

#3
**ASP** and **PHP** can be used on windows boxes. As long as they're completely separate and aren't dependent on each other. For example, using query strings `(i.e file.php?var=1&var2=bla)` things get messy when you need to transfer those variables over to the ASP file or vice versa.

So as long as the 2 systems are totally independent of each other, then it should work fine.

You may also find some incompatibility with **cookies** and **sessions**. Those too can be passed but not easily.
Reply

#4
Yes you can use both under the same website. Since the file extensions are mapped to specific external processes, they are called independently. You can even use Asp.Net to secure .php files with FormsAuthentication by implementing wildcard mappings within IIS (I know 6/7 have this, not sure about 5). Mixing data across them is tricky because they will have separate external processes and thus separate sessions. Most cookies will be readable across both, but secured cookies will not be.
Reply

#5
You should be able to run both in the same site, but be sure that the AppPool for the site runs a "classic" ASP.NET pool configuration. The default AppPool routes everything through ASP.NET, and you won't want that for your PHP pages.

Other than that, you should be fine. Query strings, files, and back-end databases will be the best way to share data between pages.
Reply

#6
Yes, PHP can be seamlessly implemented into ASP.NET 3.5 / 4.0

Go to [

[To see links please register here]

][1] (or [

[To see links please register here]

][2]) and download the latest version of Phalanger. Install into Visual Studio and voila!

> **Phalanger – the PHP compiler for .NET**
>
> Welcome to Phalanger – full-featured PHP runtime & compiler for
> .NET/Mono frameworks. Phalanger is modern open-source implementation
> of PHP, compatible with the vast array of existing PHP code. In
> addition Phalanger gives PHP-application developers lot of new
> possibilities; from improving performance and using modern
> environments, to taking advantage of seamless unique .NET integration.


[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply

#7
> ASP.NET and PHP Support
>
> Develop, deploy and easily manage Web applications using your choice
> of languages. From ASP.NET to PHP, IIS7 provides a powerful and
> flexible Web server environment for the world’s most popular Web
> applications.


(Source:

[To see links please register here]

)<br/><br/>

I tried put a `test.php` file (with conent: `<?php phpinfo(); ?>` ) to existing ASP.NET website (use real server at

[To see links please register here]

). I knew that ASP.NET and PHP have worked together.

Read more: <br/>

[To see links please register here]

;

[To see links please register here]

Reply

#8
You can run both on the same site, but won't be able to talk to each other unless you setup some sort of messaging system or share storage.They are basically applications of complete different nature.

Another possibility is to call your .NET code from PHP:

A piece of code written in C# like this:

string javascript = "";
Microsoft.Ajax.Utilities.Minifier m = new Microsoft.Ajax.Utilities.Minifier();
Microsoft.Ajax.Utilities.CodeSettings settings = new Microsoft.Ajax.Utilities.CodeSettings();
settings.OutputMode = Microsoft.Ajax.Utilities.OutputMode.SingleLine;
settings.PreserveFunctionNames = false;
string minified = m.MinifyJavaScript(javascript, settings);

Will look like this on PHP:

$minifier = netMinifier::Minifier_Constructor();
$settings = netCodeSettings::CodeSettings_Constructor();
$csssettings = \ms\Microsoft\Ajax\Utilities\netCssSettings::CssSettings_Constructor();
$settings->OutputMode(\ms\Microsoft\Ajax\Utilities\netOutputMode::SingleLine());
$settings->PreserveFunctionNames(FALSE);
$settings->QuoteObjectLiteralProperties(TRUE);
$result = $minifier->MinifyStyleSheet($css, $csssettings, $settings)->Val();

From:

[To see links please register here]

Reply

#9
Yes you can, but watch out for this:

If you have a wordpress on your "root", and asp.net apps in folders under it

(e.g.

[To see links please register here]

),
and if you follow [these suggestions][1] about "urlrewrite" for permalinks in wordpress, you can have trouble if you try to configure "wildcard handlers" in the apsnetapp1.

To avoid issues, the web.config of the wordpress root app must also have that setting:

<location path="." inheritInChildApplications="false">
<system.webServer>
...
</system.webServer>
</location>

Or else, your wildcard handler will never raise because index.php from root will catch all your requests to url like:

[To see links please register here]

*


[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through