Linux - Software This 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. |
Notices |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-21-2004, 03:38 AM
|
#1
|
LQ Newbie
Registered: Jul 2004
Location: Kyiv
Distribution: Mandrake, ASP, Slackware, W2k
Posts: 19
Rep:
|
My Apache2 fails to parse php-scripts in html pages
Hi ALL
My PHP scripts doesn't work under Apache2
I have Linux Mandrake 10.0 with Apache2 and PHP-4, installed from rpm-s.
I insert such a simple script:
<?php
echo "Hello!";
?>
in default page index.html and restart Apache.
But when I try to open the page, I cant see the string "Hello"
When I view the source of html code, I have my php code inside.
---------
In log file:
[warn] child process ####(process pid) still did not exit, Sending a SIGTERM
I have 10 such a messages per each restart. Next:
[notice] caught SIGTERM, shutting down
[notice] Digest: generating secret for digest authentication ...
[notice] Digest: done
[notice] Apache-AdvancedExtranetServer/2.0.48 (Mandrake Linux/5mdk) PHP/4.3.4 configured -- resuming normal operations
---------
After that Apache works fine except PHP scripts support
php.ini: remains untouchable
httpd2.ini:
AddType application/x-httpd-php .php
LoadModule php4_module extramodules/mod_php4.so
Is there anybody faced such a problem?
P.S. When I run a php-script from command line, everything works fine.
Thanks.
|
|
|
10-21-2004, 04:05 AM
|
#2
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,215
|
Try to rename index.html to index.php so apache can parse it correctly
|
|
|
10-21-2004, 04:27 AM
|
#3
|
LQ Newbie
Registered: Jul 2004
Location: Kyiv
Distribution: Mandrake, ASP, Slackware, W2k
Posts: 19
Original Poster
Rep:
|
Thanks, everything works fine!
Is there any way to make apache parse
php-scripts in documents with *.htm,*.html extension?
|
|
|
10-21-2004, 04:39 AM
|
#4
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,215
|
You can do that by adding .htm .html in "AddType application/x-httpd-php .php" but then apache will parse all the plain html pages as php scripts.
|
|
|
10-21-2004, 05:22 AM
|
#5
|
LQ Newbie
Registered: Jul 2004
Location: Kyiv
Distribution: Mandrake, ASP, Slackware, W2k
Posts: 19
Original Poster
Rep:
|
Quote:
Originally posted by bathory
You can do that by adding .htm .html in "AddType application/x-httpd-php .php" but then apache will parse all the plain html pages as php scripts.
|
As far as I know, apache parse the php code only between <?php ?> tags.
So is the working of apache will be more effective? If no where I mistaken.
Thank You in advance
|
|
|
10-21-2004, 05:58 AM
|
#6
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,215
|
You're right, but if you add .htm .html to be parsed as php pages, then apache whenever is asked for a .htm page it will look every line of the page's code to see if it has php code in it, which has the effect to slow down it's operation.
|
|
|
10-21-2004, 06:59 AM
|
#7
|
LQ Newbie
Registered: Jul 2004
Location: Kyiv
Distribution: Mandrake, ASP, Slackware, W2k
Posts: 19
Original Poster
Rep:
|
thank You, Your advices was helpful for me
bye...
|
|
|
All times are GMT -5. The time now is 08:32 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|