Phalanger install issue

Discussion about the open-source Phalanger [?] project.

Phalanger install issue

Postby RobertMcCabe » June 21st, 2016, 8:43 pm

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?
RobertMcCabe
 
Posts: 1
Joined: June 21st, 2016, 8:37 pm

Re: Phalanger install issue

Postby Jakub Misek » July 1st, 2016, 9:40 am

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>
Jakub Misek │ DEVSENSE s.r.o. │ Email: jakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2058
Joined: January 4th, 2012, 2:42 pm
Location: Prague


Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 1 guest

User Control Panel

Login

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 62 on January 7th, 2012, 10:54 pm

Users browsing this forum: No registered users and 1 guest
Phalanger