LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-20-2004, 11:05 AM   #1
walterbyrd
Member
 
Registered: Apr 2004
Posts: 734

Rep: Reputation: 46
How do I configure php4 & apachee 1.3?


I installed php4 and apache with apt-get install.

Apache works, it runs and loads html pages, but it doesn't seem to work with php4.

Do I configure php or apache, or both? The instructions on php.net do not help me at all. Nothing is in the same directories as used as their examples.
 
Old 08-21-2004, 03:45 PM   #2
atheist
Member
 
Registered: Sep 2003
Location: Iceland
Distribution: Debian Lenny - Kernel 2.6.22.8
Posts: 331

Rep: Reputation: 30
Which packages did you install?

I have the following packages installed:
Code:
[20:43 anti@rakka ~]$ dpkg -l | grep php && dpkg -l | grep apache
ii  php4-common    4.3.8-6        Common files for packages built from the php
ii  apache2        2.0.50-9       Next generation, scalable, extendable web se
ii  apache2-common 2.0.50-9       Next generation, scalable, extendable web se
ii  apache2-mpm-pr 2.0.50-9       Traditional model for Apache2
ii  libapache2-mod 4.3.4          Apache 2 module for MySQL authentication
ii  libapache2-mod 4.3.8-6        A server-side, HTML-embedded scripting langu
And php runs just fine without any configuration on my part.
 
Old 08-21-2004, 07:25 PM   #3
jeru
Member
 
Registered: Feb 2003
Location: Arizona
Distribution: Debian Sid
Posts: 57

Rep: Reputation: 15
Wouldn't he/she be interested in the apache 1.3 modules? Not the apache2 dso modules?

I think you'd be able to do a
apt-get install libapache-mod-php4
and it'll do the rest.

If you just apt-get install php4... I think that should dep out and start grabbing apache2 with it... Is it apache 2 or apache 1 that is running?

I'm completely new to debian, so I could very well be wrong about how this is done, but I do know apache 1.3 and apache 2 are maintained by debian and 'are' two entirely different things.

Last edited by jeru; 08-21-2004 at 07:28 PM.
 
Old 08-22-2004, 03:33 PM   #4
walterbyrd
Member
 
Registered: Apr 2004
Posts: 734

Original Poster
Rep: Reputation: 46
Thanx for replays. Here's what I got:

# apt-get install libapache-mod-php4
Reading Package Lists... Done
Building Dependency Tree... Done
E: Couldn't find package libapache-mod-php4


I initially installed with "apt-get install" apache, and "apt-get install php4" Later I tried an "apt-get install cgi-php4"

I am running debian sid, I'm a bit surprised to always get such old versions of everything, but that seems to be what I always get.
 
Old 08-22-2004, 03:44 PM   #5
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally posted by walterbyrd
Thanx for replays. Here's what I got:

# apt-get install libapache-mod-php4
Reading Package Lists... Done
Building Dependency Tree... Done
E: Couldn't find package libapache-mod-php4


I initially installed with "apt-get install" apache, and "apt-get install php4" Later I tried an "apt-get install cgi-php4"

I am running debian sid, I'm a bit surprised to always get such old versions of everything, but that seems to be what I always get.
Do you only have sid or unstable in your sources.list? The package you want to install is php4-cgi you have it backwards. You may want to check the output of these commands.

Code:
>$ dpkg -l php4* | grep ii
ii  php4           4.3.8-7        server-side, HTML-embedded scripting languag
ii  php4-common    4.3.8-7        Common files for packages built from the php
ii  php4-mysql     4.3.4-4        MySQL module for php4
[05:38 PM Sun Aug 22: stephen @ ~]
>$ apt-cache policy php4-cgi
php4-cgi:
  Installed: (none)
  Candidate: 4:4.3.4-4
  Version Table:
     4:4.3.8-7 0
        600 http://ftp.de.debian.org unstable/main Packages
     4:4.3.4-4 0
        990 http://ftp.de.debian.org testing/main Packages
>$ apt-cache policy libapache-mod-php4
libapache-mod-php4:
  Installed: 4:4.3.8-7
  Candidate: 4:4.3.8-7
  Version Table:
 *** 4:4.3.8-7 0
        600 http://ftp.de.debian.org unstable/main Packages
        100 /var/lib/dpkg/status
And once you install the apache modules then this should have appeared in the following file.

Code:
>$ cat /etc/apache/modules.conf
# Autogenerated file - do not edit!
# This file is maintained by the apache package.
# To update it, run the command:
#    /usr/sbin/apache-modconf apache
ClearModuleList
AddModule mod_so.c
AddModule mod_macro.c
LoadModule config_log_module /usr/lib/apache/1.3/mod_log_config.so
LoadModule mime_magic_module /usr/lib/apache/1.3/mod_mime_magic.so
LoadModule mime_module /usr/lib/apache/1.3/mod_mime.so
LoadModule negotiation_module /usr/lib/apache/1.3/mod_negotiation.so
LoadModule status_module /usr/lib/apache/1.3/mod_status.so
LoadModule includes_module /usr/lib/apache/1.3/mod_include.so
LoadModule autoindex_module /usr/lib/apache/1.3/mod_autoindex.so
LoadModule dir_module /usr/lib/apache/1.3/mod_dir.so
LoadModule cgi_module /usr/lib/apache/1.3/mod_cgi.so
LoadModule userdir_module /usr/lib/apache/1.3/mod_userdir.so
LoadModule alias_module /usr/lib/apache/1.3/mod_alias.so
LoadModule rewrite_module /usr/lib/apache/1.3/mod_rewrite.so
LoadModule access_module /usr/lib/apache/1.3/mod_access.so
LoadModule auth_module /usr/lib/apache/1.3/mod_auth.so
LoadModule expires_module /usr/lib/apache/1.3/mod_expires.so
LoadModule setenvif_module /usr/lib/apache/1.3/mod_setenvif.so
LoadModule ssl_module /usr/lib/apache/1.3/mod_ssl.so
LoadModule php4_module /usr/lib/apache/1.3/libphp4.so      <------------------
 
Old 08-22-2004, 04:02 PM   #6
walterbyrd
Member
 
Registered: Apr 2004
Posts: 734

Original Poster
Rep: Reputation: 46
Tried this before I had a chance to read most recent replies. Still seems to be running apache 1.3.

apt-get install apache2-mpm-worker
apt-get install libapache2-mod-php4


php4 is in my /usr/lib/cgi-bin directory.

/usr/lib/cgi-bin# ls -l
total 2724
-rwxr-xr-x 1 root root 143 2004-08-22 14:48 hello.php
-rwxr-xr-x 1 root root 2772728 2004-03-27 01:12 php4
-rwxr-xr-x 1 root root 268 2004-04-04 08:28 printenv
-rwxr-xr-x 1 root root 757 1999-08-23 23:33 test-cgi


Doesn't seem to matter.

I am trying to run the program from the php.net tutorial (hello.php). I tried adding a "shebang" it doesn't help.

#!/usr/bin/cgi-bin/php4

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
</body>
</html>
 
Old 08-22-2004, 04:09 PM   #7
walterbyrd
Member
 
Registered: Apr 2004
Posts: 734

Original Poster
Rep: Reputation: 46
Trying other stuff:



# dpkg -l php4* | grep ii
ii php4 4.3.4-4 A server-side, HTML-embedded scripting langu


# apt-cache policy php4-cgi
php4-cgi:
Installed: 4:4.3.4-4
Candidate: 4:4.3.4-4
Version Table:
*** 4:4.3.4-4 0
500 ftp://ftp.us.debian.org testing/main Packages
100 /var/lib/dpkg/status


# apt-cache policy libapache-mod-php4
W: Unable to locate package libapache-mod-php4
 
Old 08-22-2004, 04:13 PM   #8
walterbyrd
Member
 
Registered: Apr 2004
Posts: 734

Original Poster
Rep: Reputation: 46
More stuff:

# cat /etc/apache/modules.conf
# Autogenerated file - do not edit!
# This file is maintained by the apache package.
# To update it, run the command:
# /usr/sbin/apache-modconf apache
ClearModuleList
AddModule mod_so.c
AddModule mod_macro.c
LoadModule config_log_module /usr/lib/apache/1.3/mod_log_config.so
LoadModule mime_magic_module /usr/lib/apache/1.3/mod_mime_magic.so
LoadModule mime_module /usr/lib/apache/1.3/mod_mime.so
LoadModule negotiation_module /usr/lib/apache/1.3/mod_negotiation.so
LoadModule status_module /usr/lib/apache/1.3/mod_status.so
LoadModule autoindex_module /usr/lib/apache/1.3/mod_autoindex.so
LoadModule dir_module /usr/lib/apache/1.3/mod_dir.so
LoadModule cgi_module /usr/lib/apache/1.3/mod_cgi.so
LoadModule userdir_module /usr/lib/apache/1.3/mod_userdir.so
LoadModule alias_module /usr/lib/apache/1.3/mod_alias.so
LoadModule rewrite_module /usr/lib/apache/1.3/mod_rewrite.so
LoadModule access_module /usr/lib/apache/1.3/mod_access.so
LoadModule auth_module /usr/lib/apache/1.3/mod_auth.so
LoadModule expires_module /usr/lib/apache/1.3/mod_expires.so
LoadModule setenvif_module /usr/lib/apache/1.3/mod_setenvif.so
LoadModule php4_module /usr/lib/apache/1.3/libphp4.so


# cat /etc/apt/sources.list
#deb ftp://ftp.nerim.net/debian-marillat/ testing main
deb ftp://ftp.us.debian.org/debian/ testing main non-free contrib
deb http://non-us.debian.org/debian-non-US testing/non-US main contrib non-free
deb ftp://security.debian.org/debian-security sarge/updates main contrib non-free
 
Old 08-22-2004, 04:46 PM   #9
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Firstly with those sources you are running testing/sarge not sid. To start lets forget about apache2 and the cgi for the moment and confirm that php4 actually works with the apache 1.3 you already have installed. You are trying to do too much before you troubleshooting what is going on with what you have installed, blindly installing programs is no help. I took the test example and put in my /var/www/ directory as test.php without the #! line in it and it works fine here accessed as 192.168.0.1/test.php which is the IP of my machine so why don't you do the same and at least confirm that php is working from the root of the webserver, then move on to the other problems.

Edit: You need sources from unstable in your source.list to get the libapache-mod-php4 package installed.

Last edited by HappyTux; 08-22-2004 at 04:49 PM.
 
Old 08-22-2004, 07:11 PM   #10
walterbyrd
Member
 
Registered: Apr 2004
Posts: 734

Original Poster
Rep: Reputation: 46
I thought SID was testing? Anyway, I tried removing the "shebang" and putting the help.php file in my /var/www directory and it worked. Which surprised me. It surprised me because that's the first thing I tried, and it didn't work.

So something that I did. Might have changed things.

Anyway, thanks for your help. Maybe it's fixed, I'll have to try something a little more complicated.
 
Old 08-22-2004, 07:34 PM   #11
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally posted by walterbyrd
I thought SID was testing? Anyway, I tried removing the "shebang" and putting the help.php file in my /var/www directory and it worked. Which surprised me. It surprised me because that's the first thing I tried, and it didn't work.

So something that I did. Might have changed things.

Anyway, thanks for your help. Maybe it's fixed, I'll have to try something a little more complicated.
Good to hear you got it going as you say something in there obviously got put in the right place. Testing is code named Sarge at the moment (that will change next month when the new release happens then it will be Etch and Sarge then becomes the new stable) and SID is always the unstable branch that never changes.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
PHP3 & PHP4 Differences? oberon-ken-obi Programming 3 04-01-2005 01:12 PM
SElinux & php4 & interbase & apache maxut Linux - Security 0 03-15-2005 04:57 AM
PHP4.3 configure error MaleMe Linux - Software 3 01-25-2003 10:17 PM
apache && php4 err DaFrEQ Linux - Software 0 01-17-2003 03:39 PM
Apache2 & php4 CyberDrake Linux - Newbie 2 11-25-2002 11:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 01:31 AM.

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