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

Hi,

READ (and answer) BEFORE YOU ASK A QUESTION

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.1 32 bit - Apache 2.4.29 - PHP 7.1.11/7.0.25/5.6.32 - MySQL 5.7.20 - MariaDB 10.2.9
Wampserver 3.1.1 64 bit - Apache 2.4.29 - PHP 7.1.11/7.0.25/5.6.32 - MySQL 5.7.20 - MariaDB 10.2.9
PhPMyAdmin 4.7.5 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

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

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.1 32 bit - Apache 2.4.29 - PHP 7.1.11/7.0.25/5.6.32 - MySQL 5.7.20 - MariaDB 10.2.9
Wampserver 3.1.1 64 bit - Apache 2.4.29 - PHP 7.1.11/7.0.25/5.6.32 - MySQL 5.7.20 - MariaDB 10.2.9
PhPMyAdmin 4.7.5 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

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.