[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] How to run PHP scripts on RaQ3 (was PHP3)



Hadi Maleki <hadim@xxxxxxxxxxxxx> wrote:
> how can i run PHP scripts on my RaQ3i?

First, you need to have it installed.  It can be installed as a standalone
(CGI), within the Apache httpd binary, or as an Apache DSO.  There are RPMs for
the DSO install of PHP3 on the Cobalt FTP site, but you'll probably need to
install from source if you want PHP4 or one of the other two install options of
PHP3.  Then you need to add lines to srm.conf so that it recognizes php filetype
extensions.  Alternately, you can add these lines on a site by site basis within
a VirtualHost container in httpd.conf or using .htaccess files within a site.

If you have PHP3 installed, you probably want something like:

AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3 .php

If you have PHP4 installed, you probably want something like:

AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php

To test that PHP is working create a file called phptest.php and put the
following in it only:

<? echo "<b>PHP4 is great.</b>"; ?>

Then open it from a web browser.  If you see "PHP4 is great" in bold text, PHP
is working properly.  If the browser outputs the code itself or attempts to
download the file it's not working properly.  I noticed the subject line of your
post was "PHP3".  PHP version 4.0.1 was released 5 weeks ago.  PHP4 has a lot of
new features and many applications are being developed in PHP4 and won't be
usable if you install PHP3 so you may want to consider installing PHP4 instead
of PHP3.

Steven Werby {steven-lists@xxxxxxxxxxxx}