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.
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.
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.
Hello,
I am running Gentoo with Apache2 and PHP4. I have been toying around with this for about two days now trying to get this to work correctly, but nothing seems to work. My apache server is up and running. I can go to standard HTML pages and they load fine. I have a php test page which just consists of:
Code:
<html>
<body>
<?php
phpinfo();
?>
</body>
</html>
When I load that up it doesn't parse the PHP... just displays the PHP code when I view the source. I have been through several posts on LinuxQuestions and a few Wikis and can't get anywhere. I emerged php and php_mod and it is in the apache module directory. I have also added LoadModule php4_module extramodules/libphp4.so to my apache2.conf but it still doesn't seem to be working. I have restarted several times as well.
What I don't understand is that it is obviously not parsing the PHP so I would assume that Apache doesn't realize that PHP is installed however when I cause a 404 or any other sort of server error apache brings back the error with:
Apache/2.0.54 (Gentoo/Linux) PHP/4.3.11 mod_ssl/2.0.54 OpenSSL/0.9.7e Server at cynthia Port 80
as the footer of the page. I don't understand that it states PHP/4.3.11 but fails to parse the PHP within the pages.
Try revdep-rebuild -p
see if it can find anything
I had the same problem one time and I think I did something with;
/etc/apache2/conf/modules.d/70_mod_php.conf
Code:
# vim: ft=apache sw=4 ts=4
<IfDefine PHP4>
# Load the module first
<IfModule !sapi_apache2.c>
LoadModule php4_module extramodules/libphp4.so
</IfModule>
# Set it to handle the files
<IfModule mod_mime.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php-source .phps
</IfModule>
# Fix some bugs
<Files *.php>
# keep this the same size as post_max_size in php.ini
# LimitRequestBody 8388608
</Files>
<Files *.php3>
# keep this the same size as post_max_size in php.ini
# LimitRequestBody 8388608
</Files>
<Files *.php4>
# keep this the same size as post_max_size in php.ini
# LimitRequestBody 8388608
</Files>
<Files *.phps>
# keep this the same size as post_max_size in php.ini
# LimitRequestBody 8388608
</Files>
<Files *.phtml>
# keep this the same size as post_max_size in php.ini
# LimitRequestBody 8388608
</Files>
</IfDefine>
I could not get apachectl or revdep working... command not found. However, I did add
Code:
AddType application/x-httpd-php .html
to my /etc/apache2/conf/modules.d/70_mod_php.conf and now it will parse the php in the html pages. I do feel like this will add a lot of overhead to the server running .html pages that do not have any php code in them. But for now it will interpret the php tags embedded in HTML. So it is a bit of a quick fix, but at least it works.
Well, you are supposed to save your php scripts with the .php extension, not the .html. It runs index.php, but not index.html. And the hash (#) means that you are logged in as root, so you needed to run apachectl as root. Its only in one of the sbin directories.
To restart apache2 with gentoo its;
/etc/init.d/apache2 restart
to start at boot
rc-update add apache2 default
to see what is starting in default runlevel
rc-update show
Last edited by comprookie2000; 07-17-2005 at 11:42 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.