Re: php4 and apache on SuSE Linux
| From: | T . Sean Schulze | Date: | Thu, 13 Sep 2001 13:31:38 +0000 |
| Subject: | Re: php4 and apache on SuSE Linux | ||
| References: | 1 2 | Groups: | php.general php.install |
| Request: | Send a blank email to php-general+get-67199@lists.php.net to get a copy of this message | ||
Kelly Barrett wrote:
> Hi Sean,
> What webserver are you using? Is it using the Apache module of PHP or the
> CGI version?
>
I will admit to being a newbie, but I am pretty sure that I am using the
module version. My /etc/httpd/httpd.conf file includes these lines:
<IfDefine PHP>
LoadModule php3_module /usr/lib/apache/libphp3.so
</IfDefine>
<IfDefine PHP4>
LoadModule php4_module /usr/lib/apache/libphp4.so
</IfDefine>
and these:
#
# AddType allows you to tweak mime.types without actually editing it,
or to
# make certain files to be certain types.
#
# For example, the PHP 3.x module (not part of the Apache distribution
- see # http://www.php.net) will typically use:
#
<IfModule mod_php3.c>
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps
AddType application/x-httpd-php3 .phtml
</IfModule>
#
# And for PHP 4.x, use:
#
<IfModule mod_php4.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php4
AddType application/x-httpd-php-source .phps
</IfModule>
> Perhaps the extension of your file doesn't have the PHP processor
> associated with it (if it is installed as an Apache process)?
>
See above.
> Maybe you are using the CGI version incorrectly?
>
I think I am using the module.
> With the command line version, you still need the <?php ?> tags before it
> will process the PHP code.
>
> e.g.
> #!/usr/bin/php
>
> <?php
> echo "Hey, I am working fine.";
> ?>
>
> That should work as you expect.
>
Thanks for that tip. That fixed the command line script I was working on.
Now, if I could get the module working...
I think I just figured it out. I think the problem was the location of the
file. I was trying to open a file in my home directory, not in apache's
DocumentRoot directory as defined in the httpd.conf file. Once I moved the
file there, it ran fine.
Thanks you all for your help.
Cheers,
Sean