I installed the rpms for apache and php. Supposedly, apache is set up to execute php scripts because I installed the module for php4. However, when I put a phpinfo.php test file into /var/www/html, I get plain text of the code I wrote. It appears that it isn't getting run though the php interpreter. How do I fix this in apache?
using php with apache on linux mandrake
You have to find file named httpd.conf and there are rows with php extensions which should be uncommented:
AddType application/x-httpd-php .php .php3
if it is not there it have to be written there.
Zdenek
I have had this same problem, but I use tar files to install Apache and PHP you can check to see if the module is actullay installed by locating your httpd
prompt># locate httpd
I don't remeber the default directory from the rpm install then give the comand
httpd -l
this will list the modules that are currentley installed for your Apache. Look for
mod_php.c
you could read this post on things that I have done but I do not know how much it will help you since you are using rpm's
http://www.phpbuilder.com/board/showthread.php?s=&threadid=10206348
Another tool that is very useful is webmin this may just solve your problems for you. It is a very useful sys admin tool that handles your severs, users, printers, cd-rom burners, etc the rpm download can be found here
http://prdownloads.sourceforge.net/webadmin/webmin-0.990-1.noarch.rpm?download
Wish I could help you more. Good luck, you will like it once it is up and running.
Ok, I figured out the problem but I don't know how to fix it. I changed the httpd.conf file because I need the webserver to listen and run on port 8083. However, when I put 8083 instead of port 80, php gets returned as plaintext code, not HTML. How can I fix this?
Does apache work on 8083? If so, then check for the following three lines in your httpd.conf file:
LoadModule php4_module libexec/libphp4.so
AddModule mod_php4.c
AddType application/x-httpd-php .html .php .phtml .htm
Note that the extensions on the end tell apache which file extensions to treat as php. On our big intranet box at work, that includes .js .css as well as all the phtml, html, php, extensions. you can also use multiple addtype lines like so:
AddType application/x-httpd-php .html
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .phtml
If apache isn't reponding to 8083, then you need a listen directive as well.