PHP & Filepro

Kenneth Brody kenbrody at spamcop.net
Tue Jan 17 09:33:39 PST 2017


Forwarding for Scott Smith, who currently can't post to the list for some 
reason.


-------- Forwarded Message --------
Subject: PHP & Filepro
Date: Tue, 17 Jan 2017 15:06:48 +1000
From: Scott Smith <scott.smith at aanet.com.au>
To: Kenneth Brody <kenbrody at spamcop.net>


Hello all,

Using FP Version 4.8 on Windows Server with IIS has anyone been able to make
php interact with filePro.  And before people suggest, ver 4.8 is what I'm
stuck with. Yes, I've float the idea of upgrades but until the client wishes
to spend the money.
The plan is just to have PHP trigger (system/exec call) a filepro report
with data passed with -r flags (eg request invoice no and then just produce
a txt file say in the format of a json) and then have PHP read the that
file.

I've setup simple test scripts
PHP SCRIPT 	<?php
	echo ' Testing PHP System Command<br>';
	error_reporting(E_ALL); 	putenv("PFPROG=c:");
	putenv("PFDSK=h");
	putenv("PFDATA=h:");
	putenv("PFDIR=\serverFolders\serverdrive");
	putenv("PFCMARK=70");
	putenv("PFFILES=100");
	putenv("PFNET=ON");
	putenv("pfoutput=c:\fp\output");
	putenv("pfnewntconsole=on");

	// executes a system command
	$lookforname = ' c:/fp/rreport.exe';
	$flags = ' reports -f php_test -r "1" -rw "filename" -a -u ';
	
	$lookforname = $lookforname.$flags;
	
	echo " Starting : ".$lookforname.' <br>';
	$rtn2 = system($lookforname,$out2);
	
	echo 'Result: '.$rtn2.'<br>';
	
	print_r($out2);

	?>

filePro Script
::us = getenv("USERNAME")
::aa = getenv("pfoutput")
::chdir aa
:: fn = "php_"{@pw{".txt"
::export asci php=(fn) ::php(1) = " Filepro PHP test by "<us
::php(2) = " this is the data passed with -r flag"<@pm
::php(3) = " this is the data passed with -rw flag"<@pw
::php(4) = " Date by filePro :-"<@t4<@tm

This was the quickest data file dump method.
On the server the windows task manager show IUSR shows rreport.exe open for
about 5 secs then close.

But with no success. The PHP just shows the result of 1. (Which I believe is
a fail) If the command ' c:/fp/rreport.exe reports -f php_test -r "1" -rw
"filename" -a -u' is triggered from cmd it works as expected. (but this
would be as ADMIN/USER rights) So I'm guessing it a privileges issue as PHP
runs on IUSR account in IIS. NO errors in the PHP log.

I have confirmed that IUSR has read/write on filepro data directory as well
as fp dir and the fp output directory. And, Yes I understand this as a
security issue but it's just for testing.

On the server the windows task manager show IUSR shows rreport.exe open for
about 5 secs then close. (for about the same amount of time it takes thru
the cmd prompt.)

But nothing happens...
Could it be a memory issue?

Any ideas

Thanks
PS Ken can you please post this on the list?

Scott Smith
Systems Manager
Scott.smith at aanet.com.au




More information about the Filepro-list mailing list