Forum Moderators: coopster

Message Too Old, No Replies

Installing PHP

         

mistah

12:47 pm on Feb 15, 2005 (gmt 0)

10+ Year Member



I have installed Apache Server 2.0.52 and PHP 4.3.10 on my laptop.

I have a file called "index.php" in the folder specified under DocumentRoot in the httpd.conf file. This php file conatins the following code:

<?php phpinfo();?>

When I type "localhost" into my browser, the browser correctly loads up index.php (so I know my DirectoryIndex setting is working correctly)

However the browser just displays "<?php phpinfo();?>" on the screen rather than parsing the php.

I have double-checked the "LoadModule php4_module path and it seems to be pointing to the right place.

Does anyone have any ideas why this is happening?

I have been told that it is possible that the versions of PHP and Apache that I am using are not compatable. However, before I do a reinstall it would be useful to know if there was a list of compatable versions available anywhere. Does anyone know of one?

Thanks in advance for any replies. Having taken the decision to move towards database driven websites, I don't want to give up before I've even left the starting blocks.

coopster

12:49 pm on Feb 15, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Have you had a look at some of the installation tips in the PHP Forum Library [webmasterworld.com]?

mistah

1:01 pm on Feb 15, 2005 (gmt 0)

10+ Year Member



Thanks coopster,

I had a look at the tutorials before I posted. However, I can't seem to find the answer.

I now realise how many versions of PHP and Apache there are and I have read in one of the books that I am using that certain versions of PHP and Apache are not compatable.

I am not that bothered about having the latest version. I just want something that will enable me to start experimenting with database-driven websites.

I'd therefore be interested to know of any versions of Apache and PHP that are compatable so that I can install those and eliminate the compatability issue from my enquiries, so to speak.

mistah

1:37 pm on Feb 15, 2005 (gmt 0)

10+ Year Member



OK, I worked it out. Nothing wrong with my setup. Just DReamweaver turning my simple php into paragraph text in HTML. I'll just use notepad from now on.

coopster

1:42 pm on Feb 15, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Well, it sounds as if you have the LoadModule directive in your config file, but have you told Apache to parse PHP yet? The PHP installation [php.net] manual instructs to use an AddType directive:
AddType application/x-httpd-php .php .phtml
This solution is is seemingly misleading [issues.apache.org] though. I have succuessfully been using the AddHandler solution on Apache 2.0, but on 1.3 I have had issues and haven't been able to resolve the difference as of yet.