Filemaker with PHP - php

Im using Filemaker API in PHP to retrieve the records from Filemaker Pro 11 Advance Database.
But its showing error:
Error: Communication Error: (22) The requested URL returned error: 404 - This can be due to an invalid username or password, or if the FMPHP privilege is not enabled for that user.
Though I have set all Extend Privileges and gave it to user.
Please anyone can help me...

Although you mention you've taken care of this, whenever I've come across this problem it's been because the user being used to log in with PHP doesn't have the fmphp extended privilege set.
First know which user you're trying to log in as in PHP. Then, in FileMaker choose File>Manage>Security from the menu bar. Take a look at the Accounts tab and note the privilege set assigned to your web user. Click the Privilege Sets tab and double-click on this privilege set in the list. In the Extended Privilege list on the bottom right make sure there is a checkbox next to "Access via PHP Web Publishing".
While you're there, double-check the password you're working with. It has to be either you're not working with the right extended privilege set or you're not logging in with the right credentials.

I am pretty sure you must have resolved this by now but if you have not here is another suggestion. I had the same issue today and had all the extended privileges set.
The issue was with FileMaker API. Make sure the Php FM API being used is of the same version as the FileMaker server in which your db is hosted. FM Server 11 will require API released for FMS 11. I was using the last standalone API released for FMS 9 and hence it did not work. On updating php to FMAPI 13 I was able to connect and get the layouts.
The FileMaker API for PHP package was included as a .zip file in the following location:
For IIS (Windows): drive:\Program Files\FileMaker\FileMaker Server\Web Publishing\FM_API_for_PHP_Standalone.zip
For Apache (Mac OS): /Library/FileMaker Server/Web Publishing/FM_API_for_PHP_Standalone.zip

Double check your connection params, it should look something like this...
// filemaker server connection param
$connection =& new FileMaker('DBName', 'http://www.domain.com');
$connection->setProperty('username', 'youruser');
$connection->setProperty('password', 'yourpass');

First, check if the PHP API is installed and running.
On the server, go to http://localhost - You will see a screen telling the PHP API is running. If you see something else, you probably have to dig into the installation of the PHP API - possibly redeploy the server and checking off the PHP API. See that the server passes the web-server test.
Next, Check that the user that logs on to the server has the right privilege set. We usually create a second account for the PHP API, where the privileges are set correctly to MODIFY records, and VIEW Layouts, and of course have the fmphp attribute set.
If you still cannot connect, try from the web-server to do a
wget http://fmhost_ip/
cat index.html
see that you get something that can resemble a FileMaker API running page (look at the HTML code output).

Make sure you get the "FileMaker Database Server Website" landing page on the url (without the /fmi/... address), My issue was using another domain/sub-domain that IIS was using for another website.

I know this is really old. But in addition to the ISAPI fix. I needed to add a URL rewrite rule. The pattern needed to be:
^fmi/(.*)
And the rewrite URL needed to be:
http://localhost:16020/fmi/{R:1}
With those in place, the PHP API started working again.

after a few hours trying i found a solution to comunicate the php with the IIS... on your IIS manager, just need to add to your default web site, in ISAPI Filters, and add this executable... "C:\Program Files\FileMaker\FileMaker Server\Web Publishing\publishing-engine\web-server-support\iis\isapi_redirect.dll" - with anuy name

Related

Adding Shibboleth authentication to Symfony

I've been developing a Symfony app (learning Symfony with the goal of replacing an existing "old school" PHP script with it) and am having an issue with putting it "behind" our Shibboleth authentication.
Why do that? For this app I need $_SERVER['REMOTE_USER']. The app doesn't have local accounts, the user doesn't log into the app, but, like many resources, we protect them with some form of authentication.
I have two sites - virtual hosts running on the same physical server. (CentOS 7). The first site has the following in its .htaccess file:
authtype shibboleth
ShibRequestSetting requireSession 1
require valid-user
I have a "phpinfo.php" file in there, too, and can run that script and, after the Shibboleth authentication step, get the output which includes the correct value of REMOTE_USER.
The other virtual host is set up as a Symfony 3.1 app. I've added those three lines to the top of its ".htaccess" file - but after going through the Shibboleth authentication step, the browser gets into a loop and goes no farther. (In Chrome, the 'favicon' is replaced with a looping arrow, and it never stops turning.)
If I hit and then view the source of this still-empty page, I see the following error message:
Error Message: Error decoding authentication request message
I'm not sure how to start to resolve this issue, and was hoping that someone has seen this and knows how to help.
Thanks.
Best,
Stephen
If I understand well, you are trying to make the Service Provider part in Symfony and you already have an IDP working with Shibboleth.
In my case I had also a similar problem and it was because after the Assertion the apache SP was returning to the root URL. I learnt after reading a lot of documentation that if this is not set correctly you can add an attribute in the shibbolet2.xml configuration called homeURL:
<ApplicationDefaults entityID="https://sso/saml2/idp/metadata.php"
REMOTE_USER="mail"
homeURL="https://symfonyApp/redirect/after/login">
Try it out and restart the shib daemon: /etc/init.d/shibd restart
It may be another as well. But it sounds to me that there is some misconfiguration in your SP side.

PHP URL Encoding (FileMaker IWP)

I have hosted a FileMaker database on the web using FileMaker Instant Web Publishing. I am trying to access it directly - as in bypass the login page - using the php command header().
This is the code I am currently using.
header("location: http://<serverIPaddress>/fmi/iwp/cgi?dbpath=%2Ffmi%2Fiwp%2Fcgi%3F-db%3D<databasename>%26-startsession&acct=account&name=<username>&password=<password>&login=Login&-authdb");
I got this code from here: http://lnx.acidsoft.net/problemsolved/bypass-filemaker-iwp-login-via-url.html
I don't believe the FileMaker part is as relevant, since accessing the database works fine when I remove all the other encoding stuff, I just can't bypass the login that way.
I believe it might be more of a problem with how the URL is structured and me not having enough experience to know how certain browsers or what language I'm using will affect the URL.
When I currently try to execute it, I get two dialog boxes.
First, I get one that says:
Bad Request
The server could not process your request due to a missing command: "”.
The second one says:
Bad Request
The server could not process your request because your session has timed out, been closed, or communication with the server has been lost.
Please reselect the database to begin a new session.
If you cannot open the database, please contact your database administrator.
Any ideas? I am using a button to call the .php file that calls this particular line, and I'm testing it on Safari and Google Chrome.
Kevin, I had same exact problem. Found an example of a working link here:
https://community.filemaker.com/thread/73562?start=0&tstart=0
...and the difference with my (failed) URL was the = in the url should be encoded to %3D
For me, having the actual = symbol made the link not work.
http://<DATABASE IP OR HOSTNAME>/fmi/iwp/cgi?dbpath=%2Ffmi%2Fiwp%2Fcgi%3F-db%3D<DATABASE NAME>%26-startsession&acct=account&name=<USERNAME>&password=<PASSWORD>&login=Login&-authdb
Good luck!

I can´t run .php pages on my Microsoft Azure Web Aplication

I'm trying to hoost a website on Microsoft Azure and I did it. But when I enter in my website to a .php page the browser answer with the next error message: "The page cannot be displayed because an internal server error has occurred."
Before that, it returned a 500 error code, but searching the internet I tried to configure de Handler Mappings option (I dont know if I did it good or not, but now that is the new error message).
Is there any required configuration I have to do in order to make .php pages work? I have the "shared" payment plan, Do I need a better payment plan in other to do it?
Thank you!
When I knew there wasnt any extra configuration to run PHP I realized that the only one thing I changed was the Handler Mapping options, so I disabled it and tried with a simple phpinfo() in a index.php .
Exactly, the error was a bad php code. Thank you very much.
NOTE: Other person said me how to get logs for php 500 errors, you can find how to do it HERE.
Ensure that PHP is enabled for you Azure Web App. Go to the Web App in the Azure Portal, click Settings and then Application Settings. There is a dropdown labeled PHP version. Make sure it is not set to "Off" (select your preferred version). Then select Save.

TeamSpeak Server Status and info

I have a teamspeak server and I would like to show the server status (online, offline)and the number of clients are connect in a webpage (in PHP). Could you help me please ?
I dont have serverquery my provider dont give it to me!
Your Provider won't give you the Query, but there is actually another Query, that you can use only for your "virtual" Server.
It is pretty simple, because everything you need, you already have.
I will just give you a Step Tutorial:
Connect to your Teamspeak Server with your "Admin Identity"
On the Top Menu click on "Tools" => "ServerQuery Login"
In the appeared Window you type in your Queryname, like "php"
Then it gives you a Password, and that's basicly it
After this simple steps you have a Query Login, but ask your Provider if he may whitelist your Webserver's IP to use it without limits!
You can use the Query Login as normal in PHP Scripts, like this:
# Include Teamspeak Framework
include "libraries/TeamSpeak3/TeamSpeak3.php";
# Connect to Server
$yourserver = TeamSpeak3::factory("serverquery://php:PHKFokBB#127.0.0.1:10011/?nickname=Epic+PHP+Query&server_port=9988");
Remember: the Script is just an Example, not tested, that should be edited and worked into your Project.
Reference: Teamspeak 3 PHP Framework
If you use google for "Teamspeak Server Status" you will find many sites already providing this tool for users. If you want your own custom tool Teamspeak provides some very nice information on their website.

How to use windows authentification with php / symfony

I work on a Symfony application intranet.
I heard about the possibility of using the authentication window rather than having to log in using a conventional authentication window.
Could someone could give me 1 or 2 link addresses on the subject? I searched for myself but I can not find the right keywords.
Is he is WSSE?
Thank you in advance!
If you run your PHP application on an IIS instance on a windows server which is in an AD togheter with the other computers which uses this application you can turn off access for the website in your IIS interface for "Anonymous" users.
Afterwards you can check against one of the $_SERVER['AUTH_USER']/$_SERVER['PHP_AUTH_USER'] variables in PHP which contains domain\user information. You don't even need to show any login dialogue. So it's a SSO (single sign on) process then.
See the link below for more information about this:
http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/enable-php-applications-to-make-application-level-access-control-decisions
If what you call "identification window" is the small alert on which you must type id and pass rather than an HTML form, you just have to take a look in direction of htaccess and htpassword as this small windows is the result of a htacces protection.
See here (eg):
http://www.seas.upenn.edu/cets/answers/auth-htpasswd.html
Best regards
Peter
Further to TiMESPLiNTER's comment above
On our IIS setup (IIS 7.5) the relevant server variable is $_SERVER['AUTH_USER'] so if it doesn't work at first try using phpinfo() to find the right variable for your site.

Categories