Missing integration between Firefox 4 and php5

I’ve got apache2, ver 2.2 running on openSuse 11.4 and just installed php5. My php web pages are still only displaying the text files and are not parsing or executing as expected. I’ve rebooted to clear any hidden gotchas. Help please…

It’s nothing to do with Firefox or any web browser. There’s no such thing as browser/server integration.

What you probably forgot to do is enable php5 in the list of Apache modules after installing. Then restart the server.

On Sun, 17 Apr 2011 09:36:02 +0530, ken yap
<ken_yap@no-mx.forums.opensuse.org> wrote:

>
> It’s nothing to do with Firefox or any web browser. There’s no such
> thing as browser/server integration.
>
> What you probably forgot to do is enable php5 in the list of Apache
> modules after installing. Then restart the server.
>

…wich you do in the file /etc/sysconfig/apache2. the module “php5” has
be be mentioned in the line that starts with “APACHE_MODULES=”


phani.

Thank you Phani, but I’ve added the line “APACHE_MODULES=php5” and restarted the httpd daemons with no change in results. Firefox still displays the text of the .php pages.

On Mon, 18 Apr 2011 01:06:03 +0530, j2carte
<j2carte@no-mx.forums.opensuse.org> wrote:

>
> Thank you Phani, but I’ve added the line “APACHE_MODULES=php5” and
> restarted the httpd daemons with no change in results. Firefox still
> displays the text of the .php pages.
>

you shouldn’t have to add that line; there’s already a line starting with
“APACHE_MODULES=”, containing all enabled modules. if you add your line
before that, the later line will take precedence; if you add it
afterwards, the other modules won’t work.

i remember there’s several of these lines, all but one commented out. you
have to find the one w/o “#” in the beginning; that’s the one to which you
have to add “php5”, if it isn’t already included in the string (between
the quotation marks). if it is already there, your problem lies somewhere
else.


phani.

And in case it isn’t that, another couple of reasons are: filename must end in .php, and the file contents must be of the form: <?php php code here ?>

On Mon, 18 Apr 2011 03:36:03 +0530, ken yap
<ken_yap@no-mx.forums.opensuse.org> wrote:

>
> And in case it isn’t that, another couple of reasons are: filename must
> end in .php, and the file contents must be of the form: <?php php code
> here ?>
>

another possibility: do you have apache2_mod_php5 installed? that’s
required.


phani.

On Mon, 18 Apr 2011 03:51:53 +0530, phanisvara <listmail@phanisvara.com>
wrote:

>
> another possibility: do you have apache2_mod_php5 installed? that’s
> required.
>

sorry, it’s “apache2-mod_php5”, not “apache2_mod~~~”.


phani.

I have made sure the apache2-mod_pho5 has been installed and I just finished running another make and make install to verify it was included in the code. I restarted the httpd daemon but the .php pages still all display as text. I’ll be happy to upload any config file or output you might like to see.

Here’s the appropriate section from my /etc/sysconfig/apache2 file:

Type: string

Default: “actions alias auth_basic authz_host authn_file authz_groupfile authz_default authz_user autoindex cgi dir env expires include log_config mime negotiation setenvif ssl suexec userdir php5”

ServiceRestart: apache2

APACHE_MODULES=""

…so php5 is included as the default. This is the only APACHE_MODULES line in the file so it is not being superseded.

Lines starting with # are comments. So your APACHE_MODULES is empty. Here’s mine:

# apache's default installation
# APACHE_MODULES="authz_host actions alias asis auth autoindex cgi dir imap include log_config mime negotiation setenvif status userdir"
# your settings
APACHE_MODULES="authz_host actions alias auth_basic authz_groupfile authn_file authz_user autoindex cgi dir include log_config mime negotiation setenvif status userdir asis imagemap php5 authz_default"

Don’t cut and paste, you may not be using all the modules I am.

Ken, I actually entered the line APACHE_MODULES=“php5 ssl” but it makes no difference; so when I saw that the default behavior was to include all of those modules, I took my changes out. Do I have to recompile (make / make install) apache for these changes to become effective?

No you don’t. It does work as advertised.

For ssl you have to do more prep (notice I don’t have it). You need to install certificates.

I believe I have apache2 and php5 installed:

arroglx01:/usr/local/apache2/conf # zypper install php
Loading repository data…
Reading installed packages…
‘php’ not found in package names. Trying capabilities.
‘php5’ providing ‘php’ is already installed.
Resolving package dependencies…

Nothing to do.
arroglx01:/usr/local/apache2/conf # zypper install apache2
Loading repository data…
Reading installed packages…
‘apache2’ is already installed.
No update candidate for ‘apache2-2.2.17-3.1.i586’. The highest available version is already installed.
Resolving package dependencies…

Nothing to do.

and I believe I have /etc/sysconfig/apache2 correct:

APACHE_MODULES=“php5”

so I’m at a loss as to where to look next. The code has the <? and ?> surrounding the php commands and the file extensions are “.php”. I’m boggled…

But did you install the package apache2-mod_php5? php5 is just the interpreter, you need the Apache module also.

What is the output when you run:

/usr/sbin/httpd2 -M

php5 should in the resulting output