Is PHP module for Apache installed by default?

Support for webhosts that use CentOS
Post Reply
starguy
Posts: 13
Joined: 2005/06/01 03:45:10
Contact:

Is PHP module for Apache installed by default?

Post by starguy » 2006/12/11 04:14:28

I can run php scripts on the command line:
root$ php testscript.php

I verify Php is installed
$ rpm -q php php-4.3.9-3.22

However, if I try to run them through the webserver, I get no output.. nothing ie

opening up with firefox http://localhost/testscript.php


So, is there like a PHP module for Apahce that needs to be installed, and if so, what is it called, and I assume once I know its name I can install it with up2date

eperez
Posts: 13
Joined: 2005/06/19 23:47:40
Location: Quito - Ecuador
Contact:

Re: Is PHP module for Apache installed by default?

Post by eperez » 2006/12/18 14:22:18

It should.

check /etc/httpd/conf.d/php.conf

This is the file places by php in order to run from withing apache. It is placed automagically.

regards
epe

foxb
Posts: 1924
Joined: 2006/04/20 19:03:33
Location: Montreal/QC

Re: Is PHP module for Apache installed by default?

Post by foxb » 2006/12/18 15:38:56

Starguy:

Even there is notting on the screen you can check apache log file for errors.... WHAT IS THE ERROR.??

mark15
Posts: 1
Joined: 2006/12/28 19:44:12

PHP/Apache problem...

Post by mark15 » 2006/12/28 19:48:14

Hey all,

I have php-4.3.9-3.22 with Apache(httpd) 2.0.52-28.ent.centos4 on CentOS4.4. Both of these were included in the OS install. When I open a .php file, at first it was just the garbled code showing up in the browser, now the browser says "The file install.php is of type application/x-httpd-php, and seamonkey does not know how to handle this file. I need to install dokuwiki, and I can't because of this setback.

Here are the changes I've made so far.

In /etc/httpd/conf/httpd.conf, added:
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php-source .phps
PHPIniDir "/etc/httpd/conf"

This is what's in the /etc/httpd/conf.d/php.conf file (called by httpd.conf):

# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#

LoadModule php4_module modules/libphp4.so

#
# Cause the PHP interpreter to handle files with a .php extension.
#

SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 9524288


AddType application/x-x509-ca-cert .crt
AddType application/x-httpd-php-source .phps

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php


I have also copied the php.ini file from /etc to /etc/httpd/conf. Am I missing something?? I am really stuck, and would appreciate any help!
Thanks,
Mark

foxb
Posts: 1924
Joined: 2006/04/20 19:03:33
Location: Montreal/QC

Re: PHP/Apache problem...

Post by foxb » 2006/12/28 20:21:32

Here is my /etc/httpd/conf.d/php.conf
[code]
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#

LoadModule php4_module modules/libphp4.so

#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddType application/x-httpd-php .php
# AddType application/x-httpd-php-source .phps

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

[/code]

Erase all changes you've made in httpd.conf

php.conf is called to setup php

See error log for details on error.

Post Reply

Return to “CentOS 4 - Webhosting Support”