Synchronet v3.19b-Win32 (install) has been released (Jan-2022).

You can donate to the Synchronet project using PayPal.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
howto:php [2010/03/16 22:14] digitalmanhowto:php [2011/02/14 14:09] digitalman
Line 2: Line 2:
 Dynamic [[http://php.net/|PHP]] content may be served by the Synchronet Web Server using //PHP-CGI//. Dynamic [[http://php.net/|PHP]] content may be served by the Synchronet Web Server using //PHP-CGI//.
  
-PHP applications will not magically have access to your Synchronet content (e.g. users, messages, files).+PHP applications //will not// magically have access to your Synchronet content (e.g. users, messages, files).
  
 ===== Install PHP ===== ===== Install PHP =====
  
-Make sure you get PHP-CGI support. On *nix platforms, this achieved by excluding the ''--with-apxs2'' option from the ''configure'' command-line during the installation process.+Make sure you get PHP-CGI support. On *nix platforms, this is achieved by excluding the ''--with-apxs2'' option from the ''configure'' command-line during the installation process.
  
 ===== Install PHP Content ===== ===== Install PHP Content =====
Line 16: Line 16:
 ===== Configure Web Server ===== ===== Configure Web Server =====
  
-Edit your ''[[dir:ctrl]]/[[config:sbbs.ini]]'' file, making sure that the ''CGIExtensions'' key value includes ''.php''. +Edit your ''[[dir:ctrl]]/[[config:sbbs.ini]]'' file, ensuring: 
 +  - The Web Server is enabled (''AutoStart=true''
 +  - If your application has an ''index.php'' file, that that file is included in the ''IndexFileNames'' value (comma separated list) 
 +  - The ''MaxCgiInactivity'' value is set to something sane (default: 120 seconds) 
 +  - The ''CGIExtensions'' key value includes ''.php'' (comma separated list) 
 +  - The ''Options'' key value **does not** include the ''NO_CGI'' option (bit 5) 
 +   
 Example: Example:
 <file> <file>
 +[Web]
 +AutoStart=true
 +IndexFileNames=index.html,index.ssjs,index.php
 +MaxCgiInactivity=120
 CGIExtensions=.cgi,.pl,.php CGIExtensions=.cgi,.pl,.php
 +Options=NO_HOST_LOOKUP
 </file> </file>
  
 Edit your ''[[dir:ctrl]]/[[config:web_handler.ini]]'' file. Edit your ''[[dir:ctrl]]/[[config:web_handler.ini]]'' file.
  
-If you're running Synchronet for Windows, edit the ''[CGI.Win32]'' section, otherwise (e.g. *nix, or MacOSX), edit the ''[CGI]'' section:+If you're using Synchronet for Windows v3.15 (Web Server Revision 1.525 or later), edit the ''[CGI.Win32]'' section, otherwise, edit the ''[CGI]'' section:
  
-Make sure the ''php'' key value points to the correct location of your ''php-cgi'' (or ''PHP-CGI.EXE'') file. +Ensure the ''php'' key value points to the correct path (locationof your ''php-cgi'' (or ''php-cgi.exe'') file. 
  
 Example (*nix): Example (*nix):
Line 43: Line 53:
 </file> </file>
  
-Edit your ''[[dir:ctrl]]/[[config:cgi_env.ini]]'' file, making sure it contains the following lines:+Edit your ''[[dir:ctrl]]/[[config:cgi_env.ini]]'' file, ensuring it contains the following lines:
 <file> <file>
 [REDIRECT_STATUS] [REDIRECT_STATUS]
 value=200 value=200
 </file> </file>
 +
 +:!: If you see the PHP error ''This PHP CGI binary was compiled with force-redirect enabled.'', that indicates that your ''[[dir:ctrl]]/[[config:cgi_env.ini]]'' file is missing this key.
  
 ===== See Also ===== ===== See Also =====