0

Currently no errors anywhere, when I visit a php page in my browser, it just outputs the php code to the browser,

I have a .htaccess file with the following

AddType application/x-httpd-php .php

php still not running, php -v shows php installed: PHP 5.3.10 (cli) (built: Feb 4 2012 07:36:51) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

I just need to get apache to execute the php code.

1
  • php -v shows the CLI version of PHP. Could you check that Apache knows about the PHP extension with apache2ctl -M? Commented Apr 9, 2012 at 17:36

1 Answer 1

0

If you have php installed try to create php configuration in /etc/httpd/conf.d/php.conf:

 # # PHP is an HTML-embedded scripting language which attempts to make it # easy for developers to write dynamically generated webpages. # LoadModule php5_module modules/libphp5.so # # Cause the PHP interpreter to handle files with a .php extension. # AddHandler php5-script .php AddType text/html .php # # Add index.php to the list of files that will be served as directory # indexes. # DirectoryIndex index.php 

It should be included by default on redhat like distros. (you can check it yourself if you have Include conf.d/*.conf in your httpd.conf.

Adding this sort of configuration to .htaccess is not a best idea imo and should be staticly placed in *.conf files... are you sure that AllowOverride is not set to None?

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.