php code is displayed, not executed
Posted by: abhay455 (47.247.13.---)
Date: August 15, 2017 04:57PM

the whole php code is displayed as it is..
i checked the extention and file type its .php
wamp is green.
used long tags.
reinstalled wamp.
wasted hell of time.
please help

Options: ReplyQuote
Re: php code is displayed, not executed
Posted by: Otomatic (Moderator)
Date: August 15, 2017 05:38PM


Options: ReplyQuote
Re: php code is displayed, not executed
Posted by: StarkHunter (47.29.5.---)
Date: August 20, 2017 01:59PM

Hi. I had this problem with me too, but soon I realised that it was all my fault.


I was missing 'localhost' from the URL.

It should look like this:
localhost/mysite/index.php


instead of
C:/wamp/www/mysite/index.php (it's an example)

If you are doing the same mistake, just fix it and it will work fine.

Thanks.

Options: ReplyQuote
Re: php code is displayed, not executed
Posted by: Otomatic (Moderator)
Date: August 20, 2017 02:22PM

Hi,

> It should look like this: localhost/mysite/index.php
NO. You must use VirtualHost. See The need for Virtual Host

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: php code is displayed, not executed
Posted by: StarkHunter (157.185.130.---)
Date: August 20, 2017 05:01PM

Otomatic Wrote:
-------------------------------------------------------
> Hi,
>
> > It should look like this:
> localhost/mysite/index.php
> NO. You must use
> VirtualHost. See
> [url=http://forum.wampserver.com/read.php?2,127757
> ]The need for Virtual Host[/url]

Yes, my mistake. If you have set a virtual host, it should be "virtualHostName/"

The above(localhost one) can be used if you have not set a Virtual Host. Remember to tick the "Add localhost before url" in the menu > tools that appears when you click on the WampServer icon.

Options: ReplyQuote


Sorry, only registered users may post in this forum.