LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 07-13-2007, 04:27 PM   #1
Lordandmaker
Member
 
Registered: Sep 2005
Location: London, UK
Distribution: Debian
Posts: 258

Rep: Reputation: 38
Apache not playing with PHP on Debian Etch


Hi,

I'm trying to set up a basic Apache/PHP/MySQL server, but cannot get the PHP bit to work.
I've installed everything via apt-get, as I have done a few times, but it's refusing to work.

If I go to http://192.168.1.56/ I get the apache/debian test page. If I go to http://192.168.1.56/test.php it asks whether I want to download the file.

The file /etc/apache2/mods-enabled/php5.conf contains
Code:
<IfModule mod_php5.c>
  AddType application/x-httpd-php .php .phtml .php3
  AddType application/x-httpd-php-source .phps
</IfModule>
The file /etc/apache2/mods-enabled/php5.load contains
Code:
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
And that file exists.

My httpd.conf is here
the apache logs are here but don't seem to contain anything pertinent.

Any ideas what I've missed?

Last edited by Lordandmaker; 07-13-2007 at 04:31 PM.
 
Old 07-13-2007, 04:45 PM   #2
puter
Member
 
Registered: Jul 2006
Distribution: Slackware
Posts: 47

Rep: Reputation: 15
i didn't see this line in your httpd.conf

Code:
LoadModule php5_module /usr/lib/apache2/libphp5.so
it doesn't go in any bracketed section
i have a whole bunch of LoadModule lines in my conf but it doesn't look like you have any so maybe i'm missing something
but mine works and you should atleast try that


also should check out the tut on this website about setting up apache/php/mysql

Last edited by puter; 07-13-2007 at 04:51 PM.
 
Old 07-13-2007, 04:50 PM   #3
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 4.0 Etch
Posts: 1,349

Rep: Reputation: 49
What are the contents of text.php? The PHP processor will execute any php code, and will then serve up the resulting output to the client web browser. At that point, the web browser will do whatever it thinks is appropriate for a file containing that output. If it looks like the sort of file which you'd download, then the web browser will treat it as such. A web browser will typically ask if you want to download anything that looks like a binary file, other than .jpg/.gif/.png images.

I recently set up a new web server on Debian 4.0 with:

apt-get install apache2 php5 mysql-server

Everything worked out-of-box. I briefly considered using a guide I found on the internet called "The Perfect Setup - Debian Etch (Debian 4.0)"...but it looked ludicrously complex and redundant. I decided to try the keep-it-simple minimalist approach first, and I'm glad I did. Like I said, it just plain worked out-of-box.

Of course, I still did some manual configuration to suite my desires. For example, I moved the /var/www directory to main main data partition, with a symlink in /var/.
 
Old 07-13-2007, 05:04 PM   #4
Lordandmaker
Member
 
Registered: Sep 2005
Location: London, UK
Distribution: Debian
Posts: 258

Original Poster
Rep: Reputation: 38
Ah, forgot about that. test.php is:
Code:
<?php
phpinfo();
?>
File sees that it's a PHP script.

I tried puter's suggestion, but I get the following error:
Code:
Configuration syntax error detected, not starting/reloading...
Syntax error on line 1061 of /etc/apache/httpd.conf:
Cannot load /usr/lib/apache2/modules/libphp5.so into server: /usr/lib/apache2/modules/libphp5.so: undefined symbol: unixd_config
 failed!
(your suggested path doesn't exist on my system) I haven't found any solutions to that problem on the net yet, but I'll keep looking.
 
Old 07-13-2007, 07:05 PM   #5
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 4.0 Etch
Posts: 1,349

Rep: Reputation: 49
I don't know what could be wrong. I just tried creating /var/www/test.php, and it worked. It returned a large html page with tables that included a ton of info about php. Note that I'm using apache2 and php5...I don't know if you're using different versions.
 
  


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
Setting file permissions in Apache on Debian Etch crmaykish Linux - Server 5 09-08-2009 02:30 AM
Compiling Apache 2 on Debian Etch grapnell Linux - Software 17 08-11-2007 12:49 PM
mod_rewrite in Apache 2 (in Debian Etch) swmok Linux - Software 2 07-04-2007 12:12 PM
Audio cd playing/ripping problem with amaroK 1.4 on Debian Etch Michael_aust Linux - Software 0 08-08-2006 03:31 PM
Several problems: Apache/PHP, playing CDs and volume control Nylex Slackware 12 07-03-2005 02:32 AM


All times are GMT -5. The time now is 10:44 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration