Help with php and apache2

First, sorry my english if it’s bad :slight_smile:
I’ve installed apache2 and it run OK
Now, i need install php: from yast2 → install programs, i select apache2_mod-php5 (and ‘php5’ was automatically selected) and install it
After it, as root i typed: service apache2 restart <ENTER> with ok result
…but when firefox access to the index.php file, it ask me for download it!

The php5.conf file exist and this lines was added on /etc/apache2/http.conf

Include /etc/apache2/conf.d/*.conf
AddType application/x-httpd-php .php
DirectoryIndex index.html index.htm index.php

any ideas?


to simplify the things, uninstall what you have installed so far. Now go to YaST -> Software management -> Choose ‘Patterns’ from the drop down menu and scroll to Server Functions and choose Web and LAMP server for installation. It will install the required files needed.

If you need to auto run it after each reboot, go to YaST-> Runlevel and mark apache and MySQL(if wana use it) to yes.

If this does not solve the problem, then will dig out more.
I am not sure about the service command, but usually i restart/start through init.d,
/etc/init.d/apache2 start

Good luck!

this should work. if not, there are a few changes you have to make in apache’s configuration files to enable PHP manually. isn’t difficult, but i’d have to look it up in my files. if the above mentioned process does not work for you, reply here and i’ll tell you the details.

btw, if it hasn’t been done together with your apache installation (can’t remember if i had to install the doc’s separately), you can install “apache2-doc”, which should answer any questions you have about apache config.