[Pi3web-users] PHP4 questions
Brought to you by:
zimpel
|
From: <zi...@t-...> - 2002-02-24 19:20:08
|
Hi, I got some questions regarding PHP4 via direct mail and assume, the answers are of general interest: 1.) Do I have to install PHP 4 in order to have PHP 4.0 Support for Pi3Web/2.0.0? No, you don't need to install PHP to run it with Pi3Web because Pi3Web comes with a PHP4 (4.0.5) as a server module. This is faster as the CGI-version, which can be used anyway, if you want. Simply start the server from the command line using the 'featured' configuration (assuming you are on Windows): c: cd \Pi3Web\bin Pi3 ../Conf/Features.pi3 You've to stop a running Pi3Web (NT service or with the admin GUI) before you do this. Then try out the PHP test scripts at, e.g. http://localhost/pidocs/Features/#php4. Look into the server configuration Features.pi3 and add additional URL mapping, if you want to run your PHP applications installed in another folder. You may change the PHP.ini in the .\Pi3Web\bin directory in order to configure PHP for your purposes. Further help is available from here: http://pi3web.sourceforge.net/support/howto/PHP3.html 2.) The following PHP4 code doesn't work on pi3web: $IP = getenv('REMOTE_ADDR'); What's wrong? There's a bug in the current PHP wrapper, which causes only 'non-CGI' server variables to appear in PHP. This is fixed and the fix will be available within the final relase version. Server variables will be issued by the array $HTTP_SERVER_VARS but not by the environment, as in CGI. Use $IP = $HTTP_SERVER_VARS['REMOTE_ADDR']; instead of the above PHP script snipplet. -- regards Holger TMTOWTDI - There's More Than One Way To Do It - Perl motto ---------------------------------------------------------- Holger 'zimpel' Zimmermann ---------------------------------------------------------- Wendishain Germany ---------------------------------------------------------- http://home.t-online.de/home/zimpel/ http://pi3web.sourceforge.net/ mailto:zi...@t-... ---------------------------------------------------------- |