PHP & Filepro
Scott
scott.filepro at aanet.com.au
Tue Jan 17 20:03:57 PST 2017
Attempting to send to the list again...
Hi all again
As I wrote in my email, the idea was simple just have PHP trigger a fp
report with -r "data" and have filePro write a txt file with the return
data. (it could be as a csv or even in a json format. Just any sort of
field:data format that can read back into php).
I'm running FP ver 4.8 and Windows Server 2008 r2, PHP on IIS. Thankfully it
is an internal local machine so I have full control of it but it is still a
production machine. And just to answer Richards question, yes it a set of
local raid 10 drives on the server that has the filePro data directory. So
yes, everything is in the one box. Mind you, I'm not sure how that's
relevant as each of the USER machines on the network all use a 'mapped
network drive' for the filePro data drive.
So, the part of filePro was fairly simple just writing code to select record
with the -r flag then output write or export the resulting record. I made
test scripts in a new filePro file called Reports (has only the one record.)
the script was short just dumping the -r flags and time and date and user
info and write file to specific place. I tested from cmd prompt and it did
preform as expected, once I has set the required environments sets. But this
would run as me with the user privilege.
Then build the php to system call the fp report and this is where things
come of the tracks ... Without getting something back from filePro (eg. text
error output back to php, or screen to the php result fields) it's hard to
see why or trace where it goes wrong. I can't use fp debug as I need the fp
part to just start, run and export and not ask questions that php can't
answer. (as Richard suggested) (it was also questioned that why was I using
rreport for test scripts. But it must run with the rreport eventually and I
can't use the debug in dreport anyway.)
One of the early tests worked. Php executed rreport and it did output a file
that only had -r flag data, but the moment I put a lookup in that report
processing it fail again. Therefore, it made me think of a memory issue as
the lookup file of a real data file that is very large. Then I changed
security setting in IIS from IUSR to a appln pool setting (testing) and then
back to IUSR it hasn't work again.
So just to bring you up-to-date.
Tested
* CMD
* rreport reports -r "rec_no_requested" -rw "output_filename" -a -v sel1 -u
(each step has been tested from cmd prompt that it works as expected
(shows in task manager as rreport as USER for about 4 secs then closes)
(the record select works from the @pw field (but even so there is only 1
record in the reports file.))
* PHP
* $req = 'c:\fp\rreport reports -r "rec_no_requested" -rw "output_filename"
-a -v sel1 -u'
* $return = exec ($req, $result);
(shows in task manager as rreport as IUSR for about 4 secs then closes
with no output.)
*IUSR has read/write on FP, FILEPRO DATA, FP OUTPUT FOLDER.
So where to now?
It was suspect that it worked with only the system memory fields but the
moment I ask for a lookup it failed. AND more suspect is that it runs
rreport and shows in the task manager as IUSR then close but it produces No
Output.?
I am think it's a IIS security issue, so I'm not sure where to goto for help
with that one.
With so many systems in play it's hard to point to an exact spot and say
there's your problem.
Is it a filePro issue that it can't run under the limited access of IUSER in
IIS?
Does PHP just not allow filePro to run in such a confined way?
(is there may be a way to have php just put a file(request) in specified
place and have a CRON job look at that place (use windows scheduled tasks
that has more privileges) pick it up and then have filePro do the requested
file instructions and return the output file. It would just have a wait with
no real linking mechanism or error checking).
Thanks, in advance.
Scott Smith
-------- Message --------
Subject: Re: PHP & Filepro
Date: Tue, 17 Jan 2017 13:18:08 -0500
From: Bruce Easton via Filepro-list <filepro-list at lists.celestial.com>
Reply-To: Bruce Easton <bruce at stn.com>
To: filepro-list at lists.celestial.com
In the case where you are running the test script and it shows rreport
running, in what way are you running the test script?
I ask because, I have had programs on IIS (where I was not allowed to
mess with security settings) where I could successfully run batch test
scripts via terminal, but where IIS prevented system commands from
executing when run via browser. (I was able to relocate the
functionality of the system command to a Perl script, where things
worked OK. The client did set up IIS to allow *report, *clerk (and
Perl) to execute, which works, but IIS did not seem to allow *anything*
to be run from a filepro system command. I believe this was not
initially an issue, but became an issue when IIS was upgraded.)
Bruce Easton
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
More information about the Filepro-list
mailing list