I have installed apache 2.2 and php 5.3. when I run a simple php code like
<?php phpinfo();?>
instead of the simple php information page the code shows up on the screen. My php it seems is not running.
How I can enable it and makes it to run with apache. btw. I am newbee
thanks
Quick google search will show tons of options concerning configuration and installation. Give this one a go: http://php.net/manual/en/install.php
The easiest way to test you PHP installation is to run a php_info() function. See details and examples here: http://php.net/manual/en/function.phpinfo.php
One way to test whether PHP is functioning, is to create a page like this:
You should see a page generated by php with its configuration and settings. If you see the code itself, then Apache is not parsing the PHP and instead just passing it on as a regular text file. Definitely not what you want.
To configure Apache to parse PHP correctly, you need to make sure it is loading the PHP library, and that it is set to serve up *.php files using that library; and finally ensure that you have set up your index pages the way you want, usually so that index.php and index.html are both considered valid default files for a directory on your server.
The specifics of how to do this are explained numerous times in various Apache/PHP setup tutorials, and depending on your operating system and installation specifics, you will need to consult the tutorial or documentation specific to your case. Also you might want to try asking or searching on serverfault.com because the installation and setup of these programs are more suited to that wiki than stackoverflow.com. Once you've got your server running and need some help with specific PHP coding questions, this is the place.
Edit: Removed a line that's not relevant because the question was edited for clarity.
depends on your linux distribution. they all have different ways to enable php module.
You missed some packages or some switches from your installation.
If you installed PHP with your distribution's package manager, search for apache2-mod-php, libapache2-mod-php, or some similar package. This package contains the missing Apache module for your PHP.
If you installed PHP from source, you missed --with-apxs2=$(which apxs2) switch.
If you tell us your distribution, we can help you to solve this problem.
sudo apt-get install libapache2-mod-php