FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 11-12-2010, 08:48 AM
Zachary Uram
 
Default can't serve php files in apache2

Running Debian testing, I installed libapache2-mod-php5, php5,
php5-common, php5-cgi, php-pear and created a test file "info.php"
which is 1 line "<?php phpinfo(); ?>"
However when I go to http://myserver.org/info.php it prompts me to
download the PHP file instead of executing it and displaying the
result. I've tried with firefox and IE and get the same result. Any
idea how to get this working?

Zach

<>< http://www.fidei.org ><>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: AANLkTinqEoFzZTc0X+CygQWK14veMYc2DD_wqQYScj7N@mail .gmail.com">http://lists.debian.org/AANLkTinqEoFzZTc0X+CygQWK14veMYc2DD_wqQYScj7N@mail .gmail.com
 
Old 11-12-2010, 11:13 AM
emmanuel segura
 
Default can't serve php files in apache2

AddType application/x-httpd-php .php

2010/11/12 Zachary Uram <netrek@gmail.com>:
> Running Debian testing, I installed libapache2-mod-php5, php5,
> php5-common, php5-cgi, php-pear and created a test file "info.php"
> which is 1 line "<?php phpinfo(); ?>"
> However when I go to http://myserver.org/info.php it prompts me to
> download the PHP file instead of executing it and displaying the
> result. I've tried with firefox and IE and get the same result. Any
> idea how to get this working?
>
> Zach
>
> <>< http://www.fidei.org ><>
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: http://lists.debian.org/AANLkTinqEoFzZTc0X+CygQWK14veMYc2DD_wqQYScj7N@mail .gmail.com
>
>



--
esta es mi vida e me la vivo hasta que dios quiera


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: AANLkTinUTemn8-AW-qrfrCeA1L-PT2CnMA88tASKMFYy@mail.gmail.com">http://lists.debian.org/AANLkTinUTemn8-AW-qrfrCeA1L-PT2CnMA88tASKMFYy@mail.gmail.com
 
Old 11-12-2010, 11:23 AM
Zachary Uram
 
Default can't serve php files in apache2

On Fri, Nov 12, 2010 at 7:13 AM, emmanuel segura <emi2fast@gmail.com> wrote:
> AddType application/x-httpd-php .php

To which file do I add this?

Zach


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: AANLkTi=mmOuObR6OmmWGH_sazPsSnViR3OOeXXvgdmmb@mail .gmail.com">http://lists.debian.org/AANLkTi=mmOuObR6OmmWGH_sazPsSnViR3OOeXXvgdmmb@mail .gmail.com
 
Old 11-12-2010, 12:02 PM
emmanuel segura
 
Default can't serve php files in apache2

if using apache2 look in -l /etc/apache2/mod-enable/*.conf

2010/11/12 Zachary Uram <netrek@gmail.com>:
> On Fri, Nov 12, 2010 at 7:13 AM, emmanuel segura <emi2fast@gmail.com> wrote:
>> AddType application/x-httpd-php .php
>
> To which file do I add this?
>
> Zach
>



--
esta es mi vida e me la vivo hasta que dios quiera


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: AANLkTi=OBJjUAdM1J55ib6jV9pFKrkFrQwM_x=L-7Owt@mail.gmail.com">http://lists.debian.org/AANLkTi=OBJjUAdM1J55ib6jV9pFKrkFrQwM_x=L-7Owt@mail.gmail.com
 
Old 11-12-2010, 06:50 PM
Zachary Uram
 
Default can't serve php files in apache2

On Fri, Nov 12, 2010 at 8:02 AM, emmanuel segura <emi2fast@gmail.com> wrote:
> if using apache2 look in -l /etc/apache2/mod-enable/*.conf

Adding "AddType application/x-httpd-php .php" to
/etc/apache2/mods-available/php5.conf and restarting apache2 worked!
Thanks

Zach


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: AANLkTik_y4gOzHo7dOAu6FmGwESwF8yGpjKFfp0wkujC@mail .gmail.com">http://lists.debian.org/AANLkTik_y4gOzHo7dOAu6FmGwESwF8yGpjKFfp0wkujC@mail .gmail.com
 
Old 11-12-2010, 07:09 PM
Bob Proulx
 
Default can't serve php files in apache2

Zachary Uram wrote:
> Running Debian testing, I installed libapache2-mod-php5, php5,
> php5-common, php5-cgi, php-pear and created a test file "info.php"
> which is 1 line "<?php phpinfo(); ?>"
> However when I go to http://myserver.org/info.php it prompts me to
> download the PHP file instead of executing it and displaying the
> result. I've tried with firefox and IE and get the same result. Any
> idea how to get this working?

It reads as if the module is not enabled. The module is enabled by
default after installation in the postinst script but in your case
there seems to have been a problem with that step. Is your
/etc/apache2/apache2.conf missing?

Enable the module.

$ sudo a2enmod php5
$ sudo /etc/init.d/apache2 restart

The a2enmod and a2dismod utilities manage the symlinks in
/etc/apache2/mods-enabled. Those symlinks point to the contents of
the files in /etc/apache2/mods-available. It is similar to the
a2ensite and a2dissite utilities.

Bob
 
Old 11-12-2010, 07:22 PM
Bob Proulx
 
Default can't serve php files in apache2

Zachary Uram wrote:
> emmanuel segura wrote:
> > if using apache2 look in -l /etc/apache2/mod-enable/*.conf
>
> Adding "AddType application/x-httpd-php .php" to
> /etc/apache2/mods-available/php5.conf and restarting apache2 worked!
> Thanks

You shouldn't have needed to add it since the default is that it is
already configured there. Perhaps the contents had become munged up
somehow? In which case I recommend purging the package and
reinstalling to get a known good copy of the file.

Or possibly you don't have the mime-support package installed? That
supplies /etc/mime.types which is included into apache by the mime
module (which should also be enabled but might have been disabled).

$ grep TypesConfig /etc/apache2/mods-enabled/mime.conf
TypesConfig /etc/mime.types

$ grep php /etc/mime.types
application/x-httpd-php phtml pht php
application/x-httpd-php-source phps
application/x-httpd-php3 php3
application/x-httpd-php3-preprocessed php3p
application/x-httpd-php4 php4
application/x-httpd-php5 php5

Bob

The /etc/apache2/mods-available/php5.conf file from 5.3.3-2.

<IfModule mod_php5.c>
<FilesMatch ".ph(p3?|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch ".phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
# To re-enable php in user directories comment the following lines
# (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
<IfModule mod_userdir.c>
<Directory /home/*/public_html>
php_admin_value engine Off
</Directory>
</IfModule>
</IfModule>
 

Thread Tools




All times are GMT. The time now is 07:59 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org