Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I am using SuSE 9.1, Kernel 2.6.4 with Apache 2.0.49 and trying to get PHP 4.3.4 to work.
So far so good, actually I thought it was easy to set up a webserver, like I did many times before (using Apache 1.3.x and 2.0.x until 2.0.43), but something seems to be very different with Apache 2.0.49.
The general use of the apache2-prefork MPM together with SSL seems already to be not working properly. So I went to /etc/sysconfig/apache2 and excluded it of the list APACHE_MODULES.
I googled a lot but I haven't found anything useful to get PHP with this version of Apache to work. At least nothing that would help me. I haven't edited anything so far but just installed the apache2 RPM, the apache2-mod_php4 RPM and a few other modules for apache2. This seemed to be all working, without SSL the Apache2 with prefork MPM starts without any problems, all test ran without any errors. As soon as I plan to do something regarding PHP it gets a pain in the ass. I add to APACHE_MODULES "php4" at the end of the list separated by a space, resulting a line like
APACHE_MODULES="access actions alias auth auth_dbm autoindex cgi dir env expires include log_config mime negotiation setenvif suexec userdir php4"
No result, start fails but the runtime-created file loadmodules.conf contains a line for loading the php module. It doesn't if I use the worker MPM (what seems to be alright). It doesn't as well as soon as I change that php4 to php. Then the apache2 seems to be working properly without any errors, but php doesn't work as well.
So I used the minimal apache module configuration and made a line like
APACHE_MODULES="access alias auth dir log_config mime setenvif php"
The same as when I used the long version. Same goes with:
APACHE_MODULES="access alias auth dir log_config mime setenvif php4"
Unfortunately all the time none of the tests failed, nothing was written to the error log (except suexec and ssl as I was using it. After removing it the log was in fact empty but that made no difference as nothing with the apache nor php changed.)
As soon as I open any php file with a browser, the browser wants to download that file (No matter what browser. So it's in any case a serverside-problem).
I don't know what to do and did hours of research with google. No way for a solution. Every howto ended with the same result. It just wasn't running as it should be. Could this be a SuSE 9.1 problem? Or do I really have to delete all that crap and compile the Apache2 and PHP myself?
Thanks in advance.
Ah, sorry, I knew I forgot something. I did that as well as
DirectoryIndex index.html index.php
But it's the same result after all. If I enter a directory that contains a file named index.php the browser automatically wants to download that file. Somehow this might be right, but not in the case that the server should parse the php code. It doesn't.
No ideas? I've got no clue what's wrong. There must be some fundamental changes within Apache - I don't know. But I did everything as always and until now there weren't any problems. And now from one version to another - and no dramatically version change but from 2.0.43 to 2.0.49 - I can't get PHP to work.
Not really, if the handler is present, then it looks like apache can't find the interpreter (php4) and is just giving the file out instead of server parsing it. but that would surely show up the the error logs.
i can only assume that either the php4 module isn't being loaded, or php4 isn't doing anything.
Thanks. I tried that with
LoadModule php4_module /usr/lib/apache2-prefork/libphp4.so
AddType application/x-httpd-php .php
(Thats where the lib is located and accessible).
But it's no use, as soon as I try starting the apache webserver it says
Starting httpd2 (prefork) failed
So I thought maybe something with php itself is wrong and reinstalled it a few times. But after entering php in the shell theres just one line showing up after it quits. "Speicherzugriffsfehler", what in english means something like memory access fault/error.
Could this be the reason, that the Apache 2 doesn't start? I think it has to be because the Apache 2 is running php as sapi and so it is neccessary that php starts properly, isn't it?
Thanks for your reply. Seems to be like that. Does anyone have another idea?
After making intensive use of trial&error I found a solution.
SuSE 9.1 contains one PHP module, that is causing all the trouble. The module is the php4 imap module, after uninstalling that one everything worked fine.
As I don't mind not using that module I am fine with that solution.
[Edit]There seems to be a mistake with the dependencies in SuSE 9.1: If you install IMAP, the IMAP module works [/Edit]