PHP & Filepro

Richard Kreiss rkreiss at gccconsulting.net
Tue Jan 17 10:36:48 PST 2017


> -------- 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

Some basic questions:

1. what version of windows server are they running?

2 . If filePro on a mapped drive, the mapping will only work if one is logged in.  Otherwise use the full actual path name on the server.  i.e. filePro data is located on f:\company\appl but f:\company\appl is mapped as drive H.  Drive H will not be available unless one is logged in.  

3. Have you checked the permissions on the php file for the whomever is running the program?

4. Why not put most of the environmental variables into a batch file and just trigger the batch file?  

5. Have you run the filePro debugger to see if the output is actually executing and it is not just rreport loading and actually running nothing?


Richard Kreiss
GCC Consulting


-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 12570 bytes
Desc: not available
URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20170117/4f1d57a0/attachment.bin>


More information about the Filepro-list mailing list