PHP tags and commands not recognised or processed
Posted by: GalacticPrez (---.tpgi.com.au)
Date: January 21, 2025 05:37AM

I installed WAMP and everything seems fine until I try to use PHP ... I tried many suggestions from searches and nothing helped ... the configuration was all default, but I tried adding some extra things like adding .html to the end of the line > AddType application/x-httpd-php .php in httpd.conf file ... nothing I tried made any difference.

Visual Studio doesn't recognise the <?php tag in html files, not even after adding the PHP tools extension ... nor does it run basic .php test files like just echoing something to the page ...

Is there something I am supposed to do after installing WAMP before it will successfully monitor and respond to php tags commands and files?

Options: ReplyQuote
Re: PHP tags and commands not recognised or processed
Posted by: Otomatic (Moderator)
Date: January 21, 2025 10:20AM

> AddType application/x-httpd-php .php in httpd.conf file
There is absolutely nothing to modify in the httpd.conf file!
What's more, you've looked in this file the wrong way because 'AddType application/x-httpd-php .php' already exists, otherwise PHP wouldn't work.

To interpret php code, files must have the extension .php and not .html

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

Options: ReplyQuote
Re: PHP tags and commands not recognised or processed
Posted by: GalacticPrez (---.static.tpgi.com.au)
Date: January 22, 2025 11:52AM

But it wasn't working BEFORE I made that change, that that change is not the cause, it just failed to be the solution ... and it neither worked as inline php using tag <?php ?> NOR did it work as PHP in a separate .php file ... it doesn't matter how I try it, it doesn't matter what settings I change, I tried uninstalling and reinstalling WAMP, it still didn't work.



Edited 1 time(s). Last edit at 01/22/2025 11:54AM by GalacticPrez.

Options: ReplyQuote
Re: PHP tags and commands not recognised or processed
Posted by: Otomatic (Moderator)
Date: January 22, 2025 01:47PM

The page 'http:://localhost/' is the file c:\wamp64\www\index.php which mixes PHP code with html code.

You have a problem on your system*

What anti-virus or anti-spyware software do you use?

What versions of Wampserver, Apache and PHP ?

* It's the interfacing between Visual Studio and Wampserver that's the problem.

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



Edited 2 time(s). Last edit at 01/22/2025 06:12PM by Otomatic.

Options: ReplyQuote


Sorry, only registered users may post in this forum.