Re: Apache / PHP4 config problem (newbee on PHP)
Hi, Glad you got it working. As an aside, I would recommend you upgrade your Apache and php because various vulnerabilities have come out. For example: http://www.debian.org/security/2002/dsa-168 http://www.debian.org/security/2002/dsa-187 Among others. You can also easily upgrade from Potato to Woody with minimal disruption. Regards, Fred. -- Fred Clausen - Systems Administrator Unique Interactive, part of UBC Media Group plc Winners of the 2002 CRCA NTL New Media Award http://www.ubcmedia.com http://www.uniqueinteractive.co.uk T: +44 (0)20 7453 1677 F: +44 (0)20 7486 5081 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Apache / PHP4 config problem (newbee on PHP)
Thanks a lot to everybody. Everything works fine now. The reason was: Replaced "AddType application/x-httpd-php4 .php" with "AddType application/x-httpd-php .php" as Michael Streb among aothers pointed out ! /gh -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Apache / PHP4 config problem (newbee on PHP)
Try adding this line to your httpd.conf (and restarting apache) AddType application/x-httpd-php .php .php3 .html .htm good luck, ~c Gregoire Hostettler wrote: Thank you for your response. I moved the script to its original location (/var/www) but I get a strange behavior: - Using IE6, the browser asks me if I want to download the test.php script (???) - If I rename the .php script to .html, it displays just the header, nothing else, which is correct imho - If I try to access test.php via lynx, it just displays the html text. There is a tmp html file created, althought It seems to me that the php4 engine never starts to generate pages... Any other idea ? TYIA On wo, 2003-01-15 at 13:50, Gregoire Hostettler wrote: Got a (supposed) config problem with PHP4/Apache. OS: Debian potato 2.2r7, kernel 2.2.19 Apache 1.3.9 (Debian implementation) PHP4 4.0.3pl1-0p Attached are both the httpd.conf and srm.conf files, along with the access.log, error.log, php script involved and the output of apache -V (apachev file). Only the error.log was enough: [Wed Jan 15 14:29:55 2003] [notice] Apache/1.3.9 (Unix) Debian/GNU PHP/4.0.3pl1 mod_perl/1.21_03-dev configured -- resuming normal operations [Wed Jan 15 14:29:55 2003] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache/suexec) [Wed Jan 15 14:31:49 2003] [error] (8)Exec format error: exec of /usr/lib/cgi-bin/test.php failed [Wed Jan 15 14:31:49 2003] [error] [client 192.168.124.1] Premature end of script headers: /usr/lib/cgi-bin/test.php You are placing html files in cgi-bin directories. Don't do that, because cgi-bin directories are reserved only for cgi scripts, not html or php files. Just place the .php file in /var/www and I think it should work. -- Tot ziens, Bart-Jan Vrielink -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Apache / PHP4 config problem (newbee on PHP)
Be sure to add these lines to your httpd.conf: AddType application/x-httpd-php .php .php3 .phtml AddType application/x-httpd-php-source .phps (you technically only need the .php suffix, but I put all of them in there for backwards compatibility... you also don't really need the .phps one if you don't wish to see php code formatted in the browser.) Eric On Wednesday, January 15, 2003, at 08:32 AM, Gregoire Hostettler wrote: Thank you for your response. I moved the script to its original location (/var/www) but I get a strange behavior: - Using IE6, the browser asks me if I want to download the test.php script (???) - If I rename the .php script to .html, it displays just the header, nothing else, which is correct imho - If I try to access test.php via lynx, it just displays the html text. There is a tmp html file created, althought It seems to me that the php4 engine never starts to generate pages... Any other idea ? TYIA On wo, 2003-01-15 at 13:50, Gregoire Hostettler wrote: Got a (supposed) config problem with PHP4/Apache. OS: Debian potato 2.2r7, kernel 2.2.19 Apache 1.3.9 (Debian implementation) PHP4 4.0.3pl1-0p Attached are both the httpd.conf and srm.conf files, along with the access.log, error.log, php script involved and the output of apache -V (apachev file). Only the error.log was enough: [Wed Jan 15 14:29:55 2003] [notice] Apache/1.3.9 (Unix) Debian/GNU PHP/4.0.3pl1 mod_perl/1.21_03-dev configured -- resuming normal operations [Wed Jan 15 14:29:55 2003] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache/suexec) [Wed Jan 15 14:31:49 2003] [error] (8)Exec format error: exec of /usr/lib/cgi-bin/test.php failed [Wed Jan 15 14:31:49 2003] [error] [client 192.168.124.1] Premature end of script headers: /usr/lib/cgi-bin/test.php You are placing html files in cgi-bin directories. Don't do that, because cgi-bin directories are reserved only for cgi scripts, not html or php files. Just place the .php file in /var/www and I think it should work. -- Tot ziens, Bart-Jan Vrielink -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Apache / PHP4 config problem (newbee on PHP)
On wo, 2003-01-15 at 17:32, Gregoire Hostettler wrote: > I moved the script to its original location (/var/www) but I get a strange > behavior: > > - Using IE6, the browser asks me if I want to download the test.php script > (???) bartjan@trillian:~$ grep php4 /etc/apache/mime.types application/x-httpd-php4php4 I think that you don't have the correct mime type set for php files in the /etc/apache/mime.types or Apache is not using this file. > - If I rename the .php script to .html, it displays just the header, nothing > else, which is correct imho Yes. What you could do now is to add .html to the line in srm.conf (newer Apache versions have all options in httpd.conf) that already has: AddType application/x-httpd-php .php So that you get: AddType application/x-httpd-php .php .html This adds php-support for .html files in adition to .php files. > - If I try to access test.php via lynx, it just displays the html text. > There is a tmp html file created, althought > > It seems to me that the php4 engine never starts to generate pages... > > Any other idea ? Yes. Please do not top-post and learn to strip what you are quoting. > > On wo, 2003-01-15 at 13:50, Gregoire Hostettler wrote: > > > > > Got a (supposed) config problem with PHP4/Apache. > > [Wed Jan 15 14:29:55 2003] [notice] Apache/1.3.9 (Unix) Debian/GNU > PHP/4.0.3pl1 mod_perl/1.21_03-dev configured -- resuming normal operations > > [Wed Jan 15 14:29:55 2003] [notice] suEXEC mechanism enabled (wrapper: > /usr/lib/apache/suexec) > > [Wed Jan 15 14:31:49 2003] [error] (8)Exec format error: exec of > /usr/lib/cgi-bin/test.php failed > > [Wed Jan 15 14:31:49 2003] [error] [client 192.168.124.1] Premature end of > script headers: /usr/lib/cgi-bin/test.php > > > > You are placing html files in cgi-bin directories. Don't do that, > > because cgi-bin directories are reserved only for cgi scripts, not html > > or php files. Just place the .php file in /var/www and I think it should > > work. -- Tot ziens, Bart-Jan Vrielink -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Apache / PHP4 config problem (newbee on PHP)
You'll have to look at your httpd.conf (in /etc/apache/ ) You'll have to uncomment several sections for php to start working. The LoadModule section php4 The two file type lines for php4 and you might want to add index.php to the list of allowed index files After that, restart apache and you should be all set. Todd On Wed, 2003-01-15 at 11:32, Gregoire Hostettler wrote: > Thank you for your response. > > I moved the script to its original location (/var/www) but I get a strange > behavior: > > - Using IE6, the browser asks me if I want to download the test.php script > (???) > - If I rename the .php script to .html, it displays just the header, nothing > else, which is correct imho > - If I try to access test.php via lynx, it just displays the html text. > There is a tmp html file created, althought > > It seems to me that the php4 engine never starts to generate pages... > > Any other idea ? > > TYIA > > > On wo, 2003-01-15 at 13:50, Gregoire Hostettler wrote: > > > > > Got a (supposed) config problem with PHP4/Apache. > > > > > > OS: Debian potato 2.2r7, kernel 2.2.19 > > > Apache 1.3.9 (Debian implementation) > > > PHP4 4.0.3pl1-0p > > > > > > Attached are both the httpd.conf and srm.conf files, along with the > > > access.log, error.log, php script involved and the output of apache -V > > > (apachev file). > > > > Only the error.log was enough: > > > > [Wed Jan 15 14:29:55 2003] [notice] Apache/1.3.9 (Unix) Debian/GNU > PHP/4.0.3pl1 mod_perl/1.21_03-dev configured -- resuming normal operations > > [Wed Jan 15 14:29:55 2003] [notice] suEXEC mechanism enabled (wrapper: > /usr/lib/apache/suexec) > > [Wed Jan 15 14:31:49 2003] [error] (8)Exec format error: exec of > /usr/lib/cgi-bin/test.php failed > > [Wed Jan 15 14:31:49 2003] [error] [client 192.168.124.1] Premature end of > script headers: /usr/lib/cgi-bin/test.php > > > > You are placing html files in cgi-bin directories. Don't do that, > > because cgi-bin directories are reserved only for cgi scripts, not html > > or php files. Just place the .php file in /var/www and I think it should > > work. > > > > -- > > Tot ziens, > > Bart-Jan Vrielink > -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Apache / PHP4 config problem (newbee on PHP)
On Wed, 15 Jan 2003 at 17:32:45 +0100, Gregoire Hostettler wrote: > Thank you for your response. > > I moved the script to its original location (/var/www) but I get a strange > behavior: > > - Using IE6, the browser asks me if I want to download the test.php script > (???) > - If I rename the .php script to .html, it displays just the header, nothing > else, which is correct imho Yes. > - If I try to access test.php via lynx, it just displays the html text. > There is a tmp html file created, althought > > It seems to me that the php4 engine never starts to generate pages... Or Apache doesn't recognise .php files as files for PHP4. > Any other idea ? I seem to remember that I had to add these lines into srm.conf to have PHP4 working: AddType application/x-httpd-php .php3 AddType application/x-httpd-php .php (.php3 in case there are files ending with .php3). Note: this is x-httpd-php _not_ x-httpd-php4 which you have got in your srm.conf. PS. Please, switch OFF unconditionally composing HTML-ised messages in your mail program (your original question contained HTML-ised version)! -- Tomasz Papszun SysAdm @ TP S.A. Lodz, Poland | And it's only [EMAIL PROTECTED] http://www.lodz.tpsa.pl/ | ones and zeros. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Apache / PHP4 config problem (newbee on PHP)
On Wednesday 15 January 2003 17:32, Gregoire Hostettler wrote: Hi There, you`ve an error in your srm.conf you have to replace "AddType application/x-httpd-php4 .php" with "AddType application/x-httpd-php .php" So i think it should work now ! :) The file location should be the "normal" DocumentRoot not the CGI-Script directory. Michi > Thank you for your response. > > I moved the script to its original location (/var/www) but I get a strange > behavior: > > - Using IE6, the browser asks me if I want to download the test.php script > (???) > - If I rename the .php script to .html, it displays just the header, > nothing else, which is correct imho > - If I try to access test.php via lynx, it just displays the html text. > There is a tmp html file created, althought > > It seems to me that the php4 engine never starts to generate pages... > > Any other idea ? > > TYIA > > > On wo, 2003-01-15 at 13:50, Gregoire Hostettler wrote: > > > Got a (supposed) config problem with PHP4/Apache. > > > > > > OS: Debian potato 2.2r7, kernel 2.2.19 > > > Apache 1.3.9 (Debian implementation) > > > PHP4 4.0.3pl1-0p > > > > > > Attached are both the httpd.conf and srm.conf files, along with the > > > access.log, error.log, php script involved and the output of apache -V > > > (apachev file). > > > > Only the error.log was enough: > > > > [Wed Jan 15 14:29:55 2003] [notice] Apache/1.3.9 (Unix) Debian/GNU > > PHP/4.0.3pl1 mod_perl/1.21_03-dev configured -- resuming normal operations > > > [Wed Jan 15 14:29:55 2003] [notice] suEXEC mechanism enabled (wrapper: > > /usr/lib/apache/suexec) > > > [Wed Jan 15 14:31:49 2003] [error] (8)Exec format error: exec of > > /usr/lib/cgi-bin/test.php failed > > > [Wed Jan 15 14:31:49 2003] [error] [client 192.168.124.1] Premature end > > of > > script headers: /usr/lib/cgi-bin/test.php > > > You are placing html files in cgi-bin directories. Don't do that, > > because cgi-bin directories are reserved only for cgi scripts, not html > > or php files. Just place the .php file in /var/www and I think it should > > work. > > > > -- > > Tot ziens, > > Bart-Jan Vrielink -- Bisping & Bisping GmbH & Co. KG Michael Streb internet and network [EMAIL PROTECTED] Spitalstrasse 21-24-26 Tel. +49-9123-9740-630 91207 Lauf a. d. Pegnitz Fax. +49-9123-9740-97 http://photo.bisping.de *http://bisping.de *http://lauf.de -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Apache / PHP4 config problem (newbee on PHP)
On Wed, Jan 15, 2003 at 05:32:45PM +0100, Gregoire Hostettler wrote: > Thank you for your response. > > I moved the script to its original location (/var/www) but I get a strange > behavior: not strange at all. > - Using IE6, the browser asks me if I want to download the test.php script > (???) Sure, because it is the wrong mime type. > - If I rename the .php script to .html, it displays just the header, nothing > else, which is correct imho In other words, it serves it as text/html, which is also incorrect. (It doesn't execute the php.) > - If I try to access test.php via lynx, it just displays the html text. > There is a tmp html file created, althought > It seems to me that the php4 engine never starts to generate pages... You're right, it's not being invoked. > Any other idea ? Change this (in srm.conf) AddType application/x-httpd-php4 .php To: AddType application/x-httpd-php .php -- brian moore <[EMAIL PROTECTED]> | The only really perfect love | Is one that gets away -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Apache / PHP4 config problem (newbee on PHP)
> > It seems to me that the php4 engine never starts to generate pages... Make sure the LoadModule line for php in apache's config file is uncommented. Then make sure you have MIME types set up for PHP files. AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps Should do the trick. -- Chris Hilts [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Apache / PHP4 config problem (newbee on PHP)
Thank you for your response. I moved the script to its original location (/var/www) but I get a strange behavior: - Using IE6, the browser asks me if I want to download the test.php script (???) - If I rename the .php script to .html, it displays just the header, nothing else, which is correct imho - If I try to access test.php via lynx, it just displays the html text. There is a tmp html file created, althought It seems to me that the php4 engine never starts to generate pages... Any other idea ? TYIA > On wo, 2003-01-15 at 13:50, Gregoire Hostettler wrote: > > > Got a (supposed) config problem with PHP4/Apache. > > > > OS: Debian potato 2.2r7, kernel 2.2.19 > > Apache 1.3.9 (Debian implementation) > > PHP4 4.0.3pl1-0p > > > > Attached are both the httpd.conf and srm.conf files, along with the > > access.log, error.log, php script involved and the output of apache -V > > (apachev file). > > Only the error.log was enough: > > [Wed Jan 15 14:29:55 2003] [notice] Apache/1.3.9 (Unix) Debian/GNU PHP/4.0.3pl1 mod_perl/1.21_03-dev configured -- resuming normal operations > [Wed Jan 15 14:29:55 2003] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache/suexec) > [Wed Jan 15 14:31:49 2003] [error] (8)Exec format error: exec of /usr/lib/cgi-bin/test.php failed > [Wed Jan 15 14:31:49 2003] [error] [client 192.168.124.1] Premature end of script headers: /usr/lib/cgi-bin/test.php > > You are placing html files in cgi-bin directories. Don't do that, > because cgi-bin directories are reserved only for cgi scripts, not html > or php files. Just place the .php file in /var/www and I think it should > work. > > -- > Tot ziens, > Bart-Jan Vrielink -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Apache / PHP4 config problem (newbee on PHP)
On wo, 2003-01-15 at 13:50, Gregoire Hostettler wrote: > Got a (supposed) config problem with PHP4/Apache. > > OS: Debian potato 2.2r7, kernel 2.2.19 > Apache 1.3.9 (Debian implementation) > PHP4 4.0.3pl1-0p > > Attached are both the httpd.conf and srm.conf files, along with the > access.log, error.log, php script involved and the output of apache -V > (apachev file). Only the error.log was enough: [Wed Jan 15 14:29:55 2003] [notice] Apache/1.3.9 (Unix) Debian/GNU PHP/4.0.3pl1 mod_perl/1.21_03-dev configured -- resuming normal operations [Wed Jan 15 14:29:55 2003] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache/suexec) [Wed Jan 15 14:31:49 2003] [error] (8)Exec format error: exec of /usr/lib/cgi-bin/test.php failed [Wed Jan 15 14:31:49 2003] [error] [client 192.168.124.1] Premature end of script headers: /usr/lib/cgi-bin/test.php You are placing html files in cgi-bin directories. Don't do that, because cgi-bin directories are reserved only for cgi scripts, not html or php files. Just place the .php file in /var/www and I think it should work. -- Tot ziens, Bart-Jan Vrielink -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Apache / PHP4 config problem (newbee on PHP)
Hi, On Wed, Jan 15, 2003 at 01:50:24PM +0100, Gregoire Hostettler wrote: > Got a (supposed) config problem with PHP4/Apache. > > OS: Debian potato 2.2r7, kernel 2.2.19 Apache 1.3.9 (Debian > implementation) PHP4 4.0.3pl1-0p > > Attached are both the httpd.conf and srm.conf files, along with the > access.log, error.log, php script involved and the output of apache -V > (apachev file). In all your effort to provide information, you forgot to tell us what you think should happen and what does happen, and in which circumstance...? I.e. what works different from what you expect? "Where does it hurt?" Cheers, Emile. -- E-Advies / Emile van Bergen | [EMAIL PROTECTED] tel. +31 (0)70 3906153| http://www.e-advies.info -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]