Hosting PHP websites
Custom Web Publishing with
PHP lets you use the PHP scripting language to integrate data from FileMaker databases with your customized webpage layouts. In your webpages, you call the FileMaker
API for PHP, which is a PHP class created by FileMaker that accesses databases hosted by FileMaker Server. This PHP class connects to the
Web Publishing Engine and makes data available to the
web server’s PHP engine.
For information on developing a PHP website and preparing a database, see
FileMaker Server Custom Web Publishing Guide.
To host a website that uses Custom Web Publishing with PHP:
Note If your FileMaker database solution uses more than one FileMaker database file, all of the database files accessed using PHP must use this privilege set with the extended privilege Access via PHP Web Publishing - FMS only enabled.
2. In FileMaker Server Admin Console, use the Deployment
assistant to enable Custom Web Publishing with PHP and choose whether to install your own version of PHP or use the default PHP on your operating system, if you haven’t already.
Choose
Server menu >
Edit Deployment. In the Deployment assistant, confirm your settings and click
Next until you reach the Enable Web Publishing Technologies step. See
Enabling technologies for data sharing and web publishing.
Note If your FileMaker database solution uses more than one FileMaker database file, all of the database files must be on the same computer.
7. Copy your PHP files to the web server’s root folder. In a multiple-machine deployment, this folder is on the master machine. The following shows the default locations:
•For IIS (Windows) through HTTP or HTTPS:
[drive]:\Program Files\FileMaker\FileMaker Server\HTTPServer\Conf
where [drive] is the drive on which your FileMaker Server deployment resides.
•For Apache (macOS) through HTTP:
/Library/FileMaker Server/HTTPServer/htdocs
•For Apache (macOS) through HTTPS:
/Library/FileMaker Server/HTTPServer/htdocs/httpsRoot
On macOS, make sure the folder ownership and permissions allow members of the fmsadmin group to edit the PHP files. See
Users, groups, and permissions (macOS).
8. If you have not already done so, copy or move any referenced container objects to the appropriate directory on the master machine.
If a database
container field stores a file reference instead of an actual file, then the referenced container object will be stored in the FileMaker Pro Web folder when the record is created or edited. To host your site on FileMaker Server, you must then copy or move the referenced containers to a folder with the same relative location in the root folder of the web server software.
See
FileMaker Server Custom Web Publishing Guide for information about using container fields with PHP solutions.
9. To access your PHP website, use the following URL syntax:
<scheme>://<host>[:<port>]/<path>/<filename>
where:
•<scheme> is the HTTP or HTTPS protocol.
•<host> is the
IP address or
domain name of the FileMaker Server computer. For a multiple-machine deployment, you can use the IP address or the domain name of the master machine or a worker machine; the web server will forward the URL to the master machine. (Use the IP address or domain name for a machine that the
Status pane’s Web Publishing Engine information shows as running. See
Web Publishing Engine information.)
•<port> is optional and specifies the port that the web server is listening on. If no port is specified, then the default port for the protocol is assumed. For HTTP, the port specified for Web Connections is used (port 80 by default, but you may specify a different port during installation). For HTTPS, the port specified for Secure Web Connections is used (port 443 by default, but you may specify a different port during installation). These port numbers are shown on the
Status pane. See
Web Server information.
•<path> is optional and specifies the folder inside the web server root folder where the PHP file is located.
•<filename> is the filename of a page in your website.
For example:
http://192.168.123.101/my_site/home.php
Related topics