LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   Setting up PHP with Apache (https://www.linuxquestions.org/questions/suse-opensuse-60/setting-up-php-with-apache-337200/)

D4ve G 06-25-2005 10:06 PM

Setting up Apache
 
My apache server is up and running but when I try to go to a page with the extension of .PHP it asks what you want to open it with. I open it up and I see the raw php source code so nothing is working :( help?

grouge 06-26-2005 09:36 AM

Did you install it with YAST? In which case make sure you have selected to install php.

Otherwise it seems like your httpd.conf is not configured to to parse .php files

Have a look at this page from php.net for the Apache 2 install (I am assuming that is what you have)

http://uk.php.net/manual/en/install.unix.apache2.php

Specifically:

15. Tell Apache to parse certain extensions as PHP. For example,
let's have Apache parse the .php extension as PHP. You could
have any extension(s) parse as PHP by simply adding more, with
each separated by a space. We'll add .phtml to demonstrate.

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

It's also common to setup the .phps extension to show highlighted PHP
source, this can be done with:

AddType application/x-httpd-php-source .phps


I've only installed php with Apache manually on Red Hat systems, not SUSE, so these are just suggestions as to what might be wrong.

Have fun :D

D4ve G 06-26-2005 10:29 AM

I think SUSE is different with apache (yes I installed form YaST)

In the http.conf I cannot find any LoadModule commands so I don't know where to edit it?

grouge 06-26-2005 11:00 AM

I'm not sure really, as you say the set up on SUSE does seem to be different than Red Hat

This link might help:

http://www.aditus.nu/jpgraph/apache2suse.php

It is about installing php5 but also has some useful info about php4 and the location of the correct httpd.conf (BTW note that it is httpd.conf) on SUSE. I thought the section on "Making sure you have the correct Apache2 setup" might be of use to you.

Also to test php create a phpinfo file as follows

Code:

<?php
 phpinfo();
?>

put it in the root directory of the webserver "/srv/www/htdocs/" and try to open it with your browser.

When you eventually see this file parsed you'll let out a big cheer ;)

D4ve G 06-26-2005 12:40 PM

I installed 9.2 freshly and it doesn't have apache on the cd :(

alright I think I found some rpms on it..

:S

I am getting this when I try to start it

Quote:

etc/init.d/apache2 start
Starting httpd2 (prefork) (13)Permission denied: make_sock: could not bind to address [::]:80
no listening sockets available, shutting down
Unable to open logs
startproc: exit status of parent of /usr/sbin/httpd2-prefork: 1

j-ray 06-26-2005 04:22 PM

as far as i know apache and php come with the pro versions of suse. you then can install php and apache thru yast very easily. but u can download php and apache of course, too. this is easiest done with rpm versions that run on suse as well as on redhat.

D4ve G 06-26-2005 05:57 PM

Yeah which I just did ^^ 2 posts up

j-ray 06-27-2005 07:22 AM

did u start the server as root? it runs on port 80 so u cant start it as user

D4ve G 06-27-2005 11:20 AM

yea ok nm i didnt have the right permissions u were right.. thanks..


All times are GMT -5. The time now is 12:32 AM.