Page 1 of 1

Phalanger install issue

PostPosted: June 21st, 2016, 8:43 pm
by RobertMcCabe
I installed the latest Phalanger and PHP tools from the Visual Studio Gallery. However I get
"Call to undefined function: 'strpos'" when I try to run even a simple web app:

default.php :
Code: Select all
    <html>
<head>
    <title>PHP Test</title>
</head>
<body>
    <?php
    if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) {
        echo 'You are using Internet Explorer.<br />';    }
    ?>

</body>
</html>


Other PHP functions like define also give an undefined error, the echo alone works.
Aany ideas?

Re: Phalanger install issue

PostPosted: July 1st, 2016, 9:40 am
by Jakub Misek
Hi,

You have to add reference to PhpNetClasslibrary.dll within your web.config. It should be added by default when creating new web project.

Add following into your web.config, into <configuration> section:
Code: Select all
<phpNet><classLibrary><add assembly="PhpNetClassLibrary, Version=4.0.0.0, Culture=neutral, PublicKeyToken=4af37afe3cde05fb" /></classLibrary></phpNet>