AnsweredAssumed Answered

Communication Error: (22) with PHP API in Mountain Lion

Question asked by JonJ on Nov 29, 2012


Communication Error: (22) with PHP API in Mountain Lion

Your post


     Hi all,
     I'm having access problems on a Mac Mini running  FMS12.0.2.232 on OS 10.8.2.
     I'm trying connect to my databases using the PHP api, e.g. 
$fm = new FileMaker();
$databases = $fm->listDatabases();
     However, all attempts to connect result in:
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.
     This also happens if I try to connect to any of my databases, even newly-created test databases.  The webpage and databases are hosted on the same machine. 
     This is not unlike the problem reported on for FM10. 
The PHP api worked fine on this machine untill recently, but it's my test server and so I cannot pin down when the problem started, but I suspect it must be related to the fact that I recently upgraded it from OS10.7 to OS10.8 -- normal FM database hosting worked fine after the upgrade, but I didn't test the PHP api.
     The original PHP install was done by the Filemaker Server install package (on OS 10.7).  I've checked phpinfo() and the 'include' paths all look correct (the loaded php.ini is in the Mountain Lion folder of FM's publishing engine).  
     As a brute-force fix I tried uninstalling FM server and re-installing it, but then all hell broke loose -- you now have to upgrade to Java 7, which has it's own impact on the FM server console.  Also, for some reason I can't fathom, this also broke my MacOS bundled Apache install, so that the Mac Server Admin app could no longer control it -- and the only hosted webpage was apache's default 'it works' page, which I can't locate on my hard drive (perhaps two conflicting Apache installs?????).  
     After a few fruitless hours trying to fix things, I used Time Machine to roll-back the whole machine to before the FM server uninstall.  This means that I'm able to host databases and have Java 6, but I'm back to square-one with my PHP api permissions issue.
     Good job this is just my test server!
     Any suggestion or comments would be gratefully received!