I need to run a FinalBuilder project after completion of a signup form on a website, running PHP on IIS.
The command looks like this: “C:\Program Files (x86)\FinalBuilder 7\FBCMD.exe” /P"D:\Repository\FinalBuilder\MyProject.fbz7" /L"D:\Logs\FinalBuilder\cmdtest.txt"'
When this command is executed directly from command line window, the project runs perfectly and generates the logs. But when started from a PHP website, for example with the following code:
Maybe helpful: ----------------------------------- The $output variable contains a lot of hardware specifications, and the following line: exception message : Unable to get Application Data folder path for user : Unknown error -2147024891 : Access is denied.
I’ve assumed that this has something to do with access privileges for user that is running the process. PHP is running under IUSR user account. I’ve given IUSR all possible permissions on FBCMD.exe file and all folders containing project files and logs. It still doesn’t work.
Tech info: IIS 7.5 Windows Server 2008 R2 x64 FinalBuilder v7.0.0.2056
FinalBuilder is trying to access parts of the user profile/computer system. In this case the Application Data folder on the machine. If the user running the process doesn’t have permissions an “Access is denied” error is thrown.
As you have stated PHP is running under the IUSR, I would double check that the FBCMD process is started under the same user. Then once this is confirmed, see if this user has access to the system Application Data folder. If not then either add this permission for the user, or create a specific user for running FBCMD which does have permission to this folder.
You will need to run the website under a different user, or invoke FBCMD as a different user it needs a users profile. IUSR is not a regular user and does not have a profile.
Tank you for more clarification. I have created a new Application Pool under IIS, setting user credentials for a dedicated windows user, and setting Load User Profile to True. After that, FBCMD did run the project, but with errors that do not appear when run through GUI or command-prompt.
Error Loading Project File : Unable to read log file: Unable to open log file CreateCustomer NexusDB: Operating system error in Temporary Storage Manager: The handle is invalid ($6/6) [$2B27/11047]
Exit with return code: 9 (PROJECTLOADERROR)
What does it need now, and why do these errors appear only when through PHP?
Haven’t seen that error before, but one thing comes to mind, your log file parameter has a .txt extension, it should be .fbl7, finalbuilder’s log files are a database file, if you want a text log file then use the export log file action at the end of the build.
The .txt log file is created just fine when project runs from command prompt or GUI. This error occurs also when I do not specify the /L paramter This error occurs also when I run a newly created empty project
Running the project you have sent here works fine under a standard user. As you state using the .txt log file runs without error as well. We only advise against this as the log file is actually a database, not text output.
I am not seeing the error you speak of when using the /L parameter or with a fresh project with nothing specified.
If you log into the system with the user and then attempt to run the project with the same command line what is the resulting output?
If I login to server as user, call FBCMD through command prompt or GUI, all projects run just fine, produce the expected output and generate the logs correctly.
The above problem only occurs when FBCMD is called by PHP, after visiting a page in a browser window.
I’ve recreated all folders and subfolders for (log folders & fb poject folders) with full folder permissions for IUSR, dedicated windows user for FinalBuilder (which is used in the Application Pool in IIS), and my own user account. Still getting the invalid handle error: Error Loading Project File : Unable to read log file: NexusDB: Operating system error in Temporary Storage Manager: The handle is invalid ($6/6) [$2B27/11047]
I am running it as a dedicated windows user with administrative privileges, inserted as Identity for a dedicated Application Pool under IIS. The problem still occured.
In the meantime I have found why the process still hadn’t enough privileges. So for everybody else seeing this problem: You are probably running PHP via FastCGI. The following setting in php.ini must be set: fastcgi.impersonate = 0 Or else your Application Pool’s identity will be stripped off the process and FBCMD won’t work.