FileMaker PHP Error 7 (Running Out Of Memory) resolved
Yesterday I got so stuck with an issue that I wanted to send a question to a mailing list. But (un)fortunately I sent it from a wrong e-mail address so it did not reach the list.
Then, before discovering that I used the wrong e-mail address I actually resolved the issue, so now I can share this for the case it can help someone.
I was getting this error when trying to use PHP web publishing:
- API Version: 1.1
- Min.Version: 10.0.0.0
- Communication Error: (7) couldn’t connect to host
- Error String: Running out of memory
This seemed to be happening since we updated the system to Mac OS X Server 10.6.6.
The only advices I was finding were to reinstall FileMaker Server and restart. But I wanted to resolve this without restart as it was on a live server with other services running on it and I wanted to avoid any downtime.
So I was googling a bit more until I finally found this useful post on FM Forums
This is what the post suggested:
- In Server Admin, select Web service, click on the Sites tab, and under General options for the web site, the third line down (at least in server version 10.5.6) is IP Address. Setting this field to the IP address of the box bollixed things up; setting it to “any” from the drop-down list allows FM PHP to run properly.
It did not address my issue directly but inspired me to dig deeper into the Server Admin and the web sites setup. I found we actually had several virtual hosts there, and that the default host (wildcard IP, now hostname) was disabled.
Guess what, enabling the default host solved the problem.
I have not done any further research and testing (it’s a live server and the golden rule is to not touch something that works), but my assumptions are:
- FileMaker PHP API uses HTTP to connect to the web publishing engine internally, but does not uses any particular host name, it just connects to the same IP
- If there is no default host enabled, either the first virtual host in order is used, or the access is denied
- When PHP API cannot connect to the web publishing engine it may be due to disabled virtual host or simply due to a wrong order of the defined virtual hosts
I am not sure if my above assumptions are correct so I will appreciate if you let me know your experience/information in the comments below the article.
Anyway, this is my final advice for anyone using FileMaker PHP Web Publishing on Mac OS X Server (similar rules may apply to Windows as well):
Before you touch the virtual hosts setup in any way, be ready for an unscheduled downtime of your FileMaker PHP driven websites.
If you disable or reorder your virtual hosts, or even when you add a new virtual host, you may screw your FileMaker Server deployment up.
Fortunately, the fix is easy in these cases.
Just make sure to always test all your sites after you have made any change to any of your virtual hosts.
Of course if you host many sites on a single system you have probably already developed a standard procedure for adding and modifying virtual hosts. Then strictly following that procedure will most likely be safe for you. In that case I hope my findings help you define what to avoid in your procedures.