LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-14-2007, 02:44 AM   #1
janus_tr
Member
 
Registered: Sep 2004
Posts: 30

Rep: Reputation: 15
php pages are calling a download window @ apache2 @ debian stable


Hi all,

Briefly: I have php5 and Apache2 successfully installed however when I call my info.php from http://localhost/apache2-default/info.php
it brings me a download window.

I believe I have successfully installed apache2 and php5:
Code:
linux-ultima:~# apt-get install apache2 php5 php5-common libapache2-mod-php5
Reading package lists... Done
Building dependency tree... Done
apache2 is already the newest version.
php5 is already the newest version.
php5-common is already the newest version.
libapache2-mod-php5 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 208 not upgraded.
http://localhost/ displays the "It works" page
php5 is also fine
Code:
linux-ultima:~# php -v
PHP 5.2.0-8+etch3 (cli) (built: Apr 29 2007 10:42:07)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies
However no php5 entry at httpd.conf
Code:
linux-ultima:~# grep -R "php" /usr/share/apache/default-configs/apache/httpd.conf
    DirectoryIndex index.html index.htm index.shtml index.cgi index.php
    # distribution - see http://www.php.net) will typically use:
    #AddType application/x-httpd-php3 .php3
    #AddType application/x-httpd-php3-source .phps
    #AddType application/x-httpd-php .php
    #AddType application/x-httpd-php-source .phps
I removed the # sign from AddType application/x-httpd-php line and restart the server via /etc/init.d/apache2 restart command but nothing changed.

My httpd.conf under etc is empty
Code:
linux-ultima:~# cat /etc/apache2/httpd.conf
linux-ultima:~#
But I have the desired module
Code:
linux-ultima:~# grep -R "php5" /etc/apache2/mods-available/
/etc/apache2/mods-available/php5.conf:<IfModule mod_php5.c>
/etc/apache2/mods-available/php5.load:LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
linux-ultima:~#
But it is not enabled I think
Code:
linux-ultima:~# grep -R "php5" /etc/apache2/mods-enabled/
linux-ultima:~#
What should I do?

Last edited by janus_tr; 05-14-2007 at 02:46 AM.
 
Old 05-15-2007, 12:16 PM   #2
digitalnerds
Member
 
Registered: May 2007
Distribution: Debian
Posts: 103

Rep: Reputation: 15
From what i know debian stable uses apache2.conf under /etc/apache2 and not httpd.conf. However apache2.conf needs to have 2 lines uncommented:

Code:
# Include module configuration:
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf
Also double check the php5.conf and php5.load in /etc/apache2/mods-enabled to look like :

php5.conf
Code:
<IfModule mod_php5.c>
  AddType application/x-httpd-php .php .phtml .php3
  AddType application/x-httpd-php-source .phps
</IfModule>
and php5.load

Code:
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
 
Old 05-18-2007, 02:54 AM   #3
janus_tr
Member
 
Registered: Sep 2004
Posts: 30

Original Poster
Rep: Reputation: 15
OK.

Lets go step by step:
Under /etc/apache2/apache2.conf file
I have this line by default
Code:
# Include module configuration:
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf
And seems like the configuration of php5.conf is correct
Code:
linux-ultima:~# cat /etc/apache2/mods-available/php5.conf
<IfModule mod_php5.c>
  AddType application/x-httpd-php .php .phtml .php3
  AddType application/x-httpd-php-source .phps
</IfModule>
Moreover php5.load is also fine
Code:
linux-ultima:~# cat /etc/apache2/mods-available/php5.load
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so

However php5 seems missing here
Code:
linux-ultima:~# cat /etc/apache2/mods-enabled/
alias.load            authz_user.load       dir.conf              perl.conf
auth_basic.load       autoindex.load        dir.load              perl.load
authn_file.load       cgi.load              env.load              setenvif.load
authz_default.load    dav.load              mime.load             status.load
authz_groupfile.load  dav_svn.conf          mod_python.load
authz_host.load       dav_svn.load          negotiation.load
How am I suppose to add php5.conf + php5.load here?

Last edited by janus_tr; 05-18-2007 at 02:56 AM.
 
Old 05-18-2007, 03:00 AM   #4
digitalnerds
Member
 
Registered: May 2007
Distribution: Debian
Posts: 103

Rep: Reputation: 15
a2enmod php5

It should create symlinks for php5.conf and php5.load in your mods-enabled directory.
 
Old 05-21-2007, 09:50 AM   #5
janus_tr
Member
 
Registered: Sep 2004
Posts: 30

Original Poster
Rep: Reputation: 15
I googled a little but did not get your point.

What am I suppose to do?

I did add these lines to my conf file but nothing changes.

Code:
DirectoryIndex index.php
then tried this one but the same
Code:
a2enmod php5
 
Old 05-22-2007, 01:33 AM   #6
digitalnerds
Member
 
Registered: May 2007
Distribution: Debian
Posts: 103

Rep: Reputation: 15
a2enmod php5 should be issued as a standalone command from your console. Then you need to restart apache. You do not need to add "a2enmod php5" into your conf. Just execute it from your command line.

Regards
Andy
 
Old 05-22-2007, 02:51 AM   #7
janus_tr
Member
 
Registered: Sep 2004
Posts: 30

Original Poster
Rep: Reputation: 15
Heyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
THANKS!!!
It works...
 
Old 05-22-2007, 04:56 AM   #8
digitalnerds
Member
 
Registered: May 2007
Distribution: Debian
Posts: 103

Rep: Reputation: 15
You welcome
 
Old 05-25-2007, 06:50 PM   #9
t.j.sorrow
LQ Newbie
 
Registered: Sep 2005
Location: Mississauga, Canada
Distribution: SuSe10.2, Mandrake 10.1, RH
Posts: 18

Rep: Reputation: 0
php5 not working :-(

Hi there;
I have tried your advise as well as others but sill -- no luck:-(
I run Suse 10.2, Apache2.2 and trying to make work php5. Every tutorial or book I read says different things about .conf files. My Apache httpd.conf is 'broken' in to separate files by Include directive. Php loads but doesn't process scripts -- and web browser brings up download screen....

If there is good guy willing to help it more than welcome

T.J.

yoshko:/home/tomek # httpd2 -M
[Fri May 25 19:34:55 2007] [warn] NameVirtualHost yoshko:0 has no VirtualHosts
Loaded Modules:
core_module (static)
mpm_prefork_module (static)
(...)
http_module (static)
so_module (static)
actions_module (shared)
authz_host_module (shared)
imagemap_module (shared)
php5_module (shared)
Syntax OK
yoshko:/home/tomek # telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
HEAD / HTTP/1.0

HTTP/1.1 200 OK
Date: Fri, 25 May 2007 23:35:19 GMT
Server: Apache/2.2.3 (Linux/SUSE)
Last-Modified: Mon, 21 May 2007 00:31:00 GMT
ETag: "cbf2a-1e3a-c179900"
Accept-Ranges: bytes
Content-Length: 7738
Connection: close
Content-Type: text/html

Connection closed by foreign host.
yoshko:/home/tomek #
 
Old 05-25-2007, 07:19 PM   #10
t.j.sorrow
LQ Newbie
 
Registered: Sep 2005
Location: Mississauga, Canada
Distribution: SuSe10.2, Mandrake 10.1, RH
Posts: 18

Rep: Reputation: 0
one funny thing there -- FireFox wants to download that script and does nothing when the script is included in html file -- but Konqueror opens test.php and does same as FF when script is part of html....

T.J.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP! Apache2 and php pages hoiatl Linux - Server 1 10-24-2006 07:21 AM
Ubuntu Dapper + apache2 + php5 = download index.php dfwcomputer Ubuntu 1 10-23-2006 09:28 PM
Apache2 not processing PHP4 pages on Debian Sarge blue penguin Linux - Software 8 08-24-2006 02:56 PM
Suse 9.3/apache2/php4 - Firefox tries to download index.php, other *php pages work stefanlasiewski SUSE / openSUSE 1 01-18-2006 06:12 PM
My Apache2 fails to parse php-scripts in html pages 3-1415 Linux - Software 6 10-21-2004 05:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration