Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| howto:php [2010/02/24 23:53] – created digitalman | howto:php [2026/03/02 19:42] (current) – [Use PHP with the Synchronet Web Server] esc | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Use PHP with the Synchronet Web Server ====== | ====== Use PHP with the Synchronet Web Server ====== | ||
| - | FIXME | + | Dynamic [[http:// |
| + | |||
| + | PHP applications //will not// magically have access to your Synchronet content (e.g. users, messages, files). | ||
| + | |||
| + | ===== Install PHP ===== | ||
| + | |||
| + | Make sure you get PHP-CGI or PHP-FPM support as needed. On *nix platforms, this is achieved for PHP-CGI by excluding the '' | ||
| + | |||
| + | ===== Install PHP Content ===== | ||
| + | |||
| + | Install your PHP application(s) into your '' | ||
| + | |||
| + | :!: Note: many PHP web applications require 3rd party database support (e.g. MySQL), which may need to be installed as well. | ||
| + | |||
| + | ===== Configure Web Server For PHP-CGI ===== | ||
| + | |||
| + | Edit your '' | ||
| + | - The Web Server is enabled ('' | ||
| + | - If your application has an '' | ||
| + | - The '' | ||
| + | - The '' | ||
| + | - The '' | ||
| + | |||
| + | Example: | ||
| + | < | ||
| + | [Web] | ||
| + | AutoStart=true | ||
| + | IndexFileNames=index.html, | ||
| + | MaxCgiInactivity=120 | ||
| + | CGIExtensions=.cgi, | ||
| + | Options=NO_HOST_LOOKUP | ||
| + | </ | ||
| + | |||
| + | Edit your '' | ||
| + | |||
| + | If you're using Synchronet for Windows v3.15 (Web Server Revision 1.525 or later), edit the '' | ||
| + | |||
| + | Ensure the '' | ||
| + | |||
| + | Example (*nix): | ||
| + | |||
| + | < | ||
| + | [CGI] | ||
| + | php = / | ||
| + | </ | ||
| + | |||
| + | Example (Windows): | ||
| + | |||
| + | < | ||
| + | [CGI.Win32] | ||
| + | php = / | ||
| + | </ | ||
| + | |||
| + | Edit your '' | ||
| + | < | ||
| + | [REDIRECT_STATUS] | ||
| + | value=200 | ||
| + | </ | ||
| + | |||
| + | :!: If you see the PHP error '' | ||
| + | |||
| + | ===== Configure Web Server For PHP-FPM ===== | ||
| + | |||
| + | Edit your '' | ||
| + | - The Web Server is enabled ('' | ||
| + | - If your application has an '' | ||
| + | - The '' | ||
| + | - The '' | ||
| + | |||
| + | Example: | ||
| + | < | ||
| + | [Web] | ||
| + | AutoStart=true | ||
| + | IndexFileNames=index.html, | ||
| + | MaxCgiInactivity=120 | ||
| + | Options=NO_HOST_LOOKUP | ||
| + | </ | ||
| + | |||
| + | Edit the [[server: | ||
| + | |||
| + | Example (using a TCP socket): | ||
| + | < | ||
| + | [*.php] | ||
| + | FastCGISocket=127.0.0.1: | ||
| + | </ | ||
| + | |||
| + | Example (using a UNIX Domain socket): | ||
| + | < | ||
| + | [*.php] | ||
| + | FastCGISocket=unix:/ | ||
| + | </ | ||
| + | |||
| + | |||
| + | Make sure that php-fpm is running and that the listener socket is the same as in the FastCGISocket line. | ||
| + | |||
| + | :!: If you see the PHP error '' | ||
| ===== See Also ===== | ===== See Also ===== | ||
| - | * [[:howto:|HowTo index]] | + | |
| + | * [[: | ||
| + | | ||