Broken basic php functions after Phalanger 4 install


On phalanger 4 project sample Hello World, basic php functions are not available.

Try with this:


echo "Hello World!";
echo getcwd();


You get a "Called to undefined functin getcwd".
Closed Apr 30, 2014 at 11:57 AM by jakub
There is no public Phalanger 4 install.

After migrating to Phalanger 4, ensure your machine.config (C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config and C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config), at the bottom, contains references to PhpNetClassLibrary, Version=


davidbcn wrote Apr 30, 2014 at 1:27 PM

There is no reference to such library in machine.config.

¿Where are those binaries supposed to be found at?
¿Where and how exactly in the machine.config should the reference be placed? ¿Can't this be done at the web.config level?

Thank you for the quick response!

jakub wrote Apr 30, 2014 at 2:16 PM

If installing Phalanger using setup program, default configuration is added into global machine.config.

Otherwise (if you are compiling Phalanger from sources or you are distributing Phalanger without installer by copy-pasting DLL files), you can add this configuration into web.config file.

See https://github.com/DEVSENSE/Phalanger/blob/master/Deployment/Machine.config - sections <configSections> and <phpNet> should be presents in .NET configuration (machine.config or web.config)

davidbcn wrote Apr 30, 2014 at 4:11 PM

Thank you very much, suprisingly the Phalanger Setup did not alter my machine.config, maybe it was because I had Phalanger 3, then Installed Phalanger 4, then uninstalled Phalanger 3?

Anyways, modifying the web.config made it work as expected.

Still It is not clear where the phalanger binaries are deployed with the installer, I guess it is getting them from the GAC.

jakub wrote Apr 30, 2014 at 10:43 PM

Yes, Phalanger Uninstall process clears the machine.config

Binaries are deployed into GAC only now. In future, Visual Studio Web Application project will contain them in /Bin folder.