This topic is locked
[SOLVED]

 Win Server 2008 R2 IIS Installation

6/4/2012 6:22:54 PM
PHPRunner General questions
A
AlexOZ author

I'm seeking some advice of which way to turn (as a newbie to PHPRunner and PHP, but experienced with .Net). I'm attempting to host a PHPRunner app on my Windows VPN. I've successfully installed PHP and the same app on my local Win7 Pro. The error I'm getting is "Fatal error: Cannot redeclare hex2bin() in C:\inetpub\wwwroot\output\include\phpfunctions.php on line 1411".
As a check, I installed a trial copy of PHPRunner on the same server and successfully built and ran a one table demo from the same database (hosted internally to PHPRunner). However once I attempted to set up a virtual directory with the output folder files under wwwroot, I got the same error message.
I'm not sure how to proceed from here, but do want to host on IIS rather than Apache in this instance. Any suggestions? Alex

Sergey Kornilov admin 6/4/2012

There might be an issue with virtual directory setup. Try to run your app directly via http://localhost/output URL.

A
AlexOZ author 6/6/2012



There might be an issue with virtual directory setup. Try to run your app directly via http://localhost/output URL.



Hi
Right or wrong I changed the entry in phpfunctions.php to the following so it would avoid redeclaring the function and it worked. I have not tried any security so may be a problem going forward. Is it possible that hex2bin is already defined in php? (My version is 5.4.3) Again, I'm new to this environment so my comments are likely to be wrong.
Alex
if(!function_exists('hex2bin'))

{

function hex2bin($source)

{

if(!is_string($source) || strlen($source) == 0 || strlen($source) % 2 > 0)

return '';

$bin = "";

$i = 0;

do {

$bin .= chr(hexdec($source[$i].$source[$i + 1]));

$i += 2;

} while ($i < strlen($source));

return $bin;

}

}

Sergey Kornilov admin 6/6/2012

Alex,
thank you for heads up - we'll post a PHP 5.4 compatible update shortly.

A
AlexOZ author 6/6/2012



Alex,
thank you for heads up - we'll post a PHP 5.4 compatible update shortly.



Thanks for that. I guessed that disabling hex2bin wasn't going to be the solution. However it allowed me temporarily to host successfully and check out the mobile pages on my iPad and Android tablets - very good workable solutions!
Alex

Sergey Kornilov admin 6/8/2012

Build 12046 adds PHP 5.4 support