I have set up an apache web server and am trying to get php to work. however, when i go to the url of the php document in my browser it just comes up asking me where i want to download the file to. please help thanx
Naturally the first thing to ask is - have you installed php5 and php apache module, mainly the apache2-mod_php5 package.
And the next thing to ask is if you have added php5 to the list in APACHE_MODULES in /etc/sysconfig/apache2.
I assume that the Apache and PHP packages are from OpenSUSE. Things get more complex if you try to install your own from upstream packages.
rpm -qa | grep apache && rpm -qa | grep php
yes they’re both installed :S and rpm -qa | grep apache && rpm -qa | grep php returns…
/usr/sbin/httpd2 -M | grep php5
/usr/sbin/httpd2 -M | grep php5 gives:
[Sat Jun 14 17:15:37 2008] [crit] Failed to remove dashboard file ‘/tmp/mod_mono_dashboard_XXGLOBAL_1’, further actions impossible. Operation not permitted
php5 module isn’t being loaded.
Edit /etc/sysconfig/apache2, find a line called APACHE_MODULES=“blah blah” and add php5 to the end of it, inside the quotes - make sure you don’t edit the line with # in front of it.
After that issue rcapache2 restart
$ a2enmod php5 $ rcapache2 restart
I’ve tried everything that has been suggested so far and it still isn’t working has anyone got any other suggestions please?
What kind of php app or page are you trying to get to?
Can you do:
grep ‘<?’ phpfile.php
Why? Because by default suse has short tags turned off. If you are trying to do a phpinfo or something that is:
It will not work. Although then I think you just get a blank page.
/usr/sbin/httpd2 -M 2>&1 | grep php5
return anything now?
I’m having the same problems
/usr/sbin/httpd2 -M 2>&1 | grep php5
I’ve checked php5 is in the list of modules in /etc/sysconfig/apache2 and restarted apache2
The php module is not showing up in /etc/apache2/sysconfig.d/loadmodule.conf at this point should it? It tells me not to edit that file but to edit the /etc/sysconfig/apache2
my index.php file consists of
I’ve even tried adding AddType application/x-httpd-php .php into the virtual host (I couldn’t work out where those were specified - I’m used to RedHat systems with everything in the httpd.conf file), but when I go to the server root it just asks me were I want to save index.php
> I’m having the same problems
>> /usr/sbin/httpd2 -M 2>&1 | grep php5
> returns nothing
> I’ve checked php5 is in the list of modules in /etc/sysconfig/apache2
> and restarted apache2
Ah - try rcapache2 restart
It re-reads the sysconfig stuff - a normal restart does not
I tried restarting it every way I knew including that one from a post above.
OK - UPDATE -
I have now downgraded PHP to 5.1.2 by re-installing from the original novell online repository and it all works!
I think the problem may have related to the rpm of php5.2.6 (origin unknown) run by my colleague setting up the server
However, I’m not particularly happy running this old version that I think has a few security problems with it. So how do I upgrade it to 5.2.6? or should I start a new thread for that
Contains 5.2.6 - with the assumption that you’re running 10.3.
Yeah that would mess things up. Non-SUSE packages would not benefit from the sysconfig settings in /etc/sysconfig/apache2; you would have to edit the Apache config files yourself. You don’t really want to go there, installing non-SUSE packages. You should be able to get the latest version from an OpenSUSE repository.
Sometimes Novell back patches the source but doesn’t bump the minor version number so as not to break package dependencies. But the bug is nevertheless fixed.