Yes, it's possible since version 1.0 RC1.
On the web server, set up a directory of the application in IIS as if it was an ordinary Phalanger web application with script sources present. Additionally, it is necessary to configure IIS to allow requests on non-existing PHP scripts, otherwise you will probably get an error 404 from IIS. This can be done by clearing the checkbox "Check that file exists" in the configuration of the .php extension mapping: right click on the web application directory in IIS, choose "Properties", click on the "Configuration" button in the "Directory" tab, find .php extension mapping line in the table on the "Mappings" tab and hit the "Edit" button - the checkbox appears at the bottom of the dialog that appears.
Compile application source codes by phpc command line compiler tool shipped with Phalanger in {Install Path}\Bin directory. Run phpc in the directory containing the source codes with option /target:web specified on the command line. The compiler will traverse all subdirectories recursively and compile all *.php and *.inc files into a single assembly WebPages.dll generated into the bin directory (if no error occures, warnings don't matter). The extensions of files being included to the compilation can be changed by the /ext option. The output directory of the compilation can be changed by the /out option. A configuration file containing settings relevant to the compilation can be specified by /config option. There are several more options related to the web pre-compilation. All possible options with their brief descriptions are listed if the /help option is specified.
A following example builds an application and writes compile-time errors and warnings to the build.log file.
cd C:\Web\MyApp "C:\Program Files\Phalanger\bin\phpc" /target:web /out:bin 2> build.log
Finally, place the compiled assembly WebPages.dll (the name is significant) into bin subdirectory of the web application directory on the server. The next requests on the application should be served by this assembly. The assembly can be replaced without restarting the server or killing proceeding requests. Simply rewrite the assembly with a new one. Note that sessions configured to be managed by ASP.NET in in-process mode are abandoned by loading of the new assembly.
No, it is currently not possible because some parts of Phalanger are mixed assemblies written in Managed C++, which is not supported in Mono. Although we are planning on rewriting these components to C++/CLI as we switch to FW 2.0, one of them - the Extension Manager - will always contain some native code. So it is likely that Phalanger will run under Mono in the future but without the Extension Manager. However, if Mono supports C++/CLI in the future we would probably port the Extension Manager to Mono.
The answer for the second question is: no, you needn't to do any changes. Existing web applications should work well on Phalanger without changes regarding to inclusions. The first question is discussed in documentation.
dl function in the source code,
it gives me an error saying that "Extensions cannot be loaded by script. Use configuration files instead."
The dl() function is not (and won't be) supported. Instead, you have to declare your intention to
use the extension in a configuration file. Think of it as an analogue of the
php.ini file, only substantialy more powerful. It is XML-based and what's
more important, it's not just one file, but a hierarchy of files that can
specify configuration at various levels. Unlike PHP where the php.ini has a
system-wide scope, these configuration files can be given at application
level, as well, and that's what we would recommend your GTK
applications.
Before compiling the application, create a file named App.config with this
contents:
<configuration>
<phpNet>
<classLibrary>
<add assembly="php_gtk.mng, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4ef6ed87c53048a3" section="gtk" earlyInit="true" />
</classLibrary>
<gtk>
<set name="php-gtk.extensions" value="php_gtk_combobutton.dll, php_gtk_libglade.dll, php_gtk_scrollpane.dll, php_gtk_spaned.dll, php_gtk_sqpane.dll" />
</gtk>
</phpNet>
</configuration>
Basically, this is equivalent to putting these lines to php.ini:
extension=php_gtk.dll php-gtk.extensions=php_gtk_combobutton.dll,php_gtk_libglade.dll,php_gtk_scrollpane.dll,php_gtk_spaned.dll,php_gtk_sqpane.dll
The compiler would automatically copy the App.config file to the same directory
where the compiled .exe is created, and will rename it to someapp.exe.config
provided that someapp.exe is the name of the resulting executable.
If you've also removed dl() from your code, it should work.