Jump to content

Recommended Posts

Since coming back from a recess in developing web applications, I installed Xampp 7.4.10 and I'm getting weird displays in my coding

It is actually showing the php tag and statements. I tried to configure the error_reporting line in php.ini thinking it was that, but to no avail

I made a screenshot to show what I'm actually getting

This should be only displaying the result of the echo statement, not what is inside the file

ajax.jpg

Link to comment
https://forums.phpfreaks.com/topic/311929-xampp-version-7410-weirdness/
Share on other sites

php is a server-side scripting language. if you are not making a http(s) request to a web server for the .php file, the php language engine isn't being invoked. when you directly enter the URL of the .php file in question in your browser's address bar, do you get the expected output? 

  • Like 1

It has nothing to do with the IDE.

Okay, AJAX, then:

4 hours ago, mac_gyver said:

what AJAX URL to the file through the web server are you using? it should be something like - http://localhost/your_file.php

 

2 hours ago, requinix said:

It has nothing to do with the IDE.

Okay, AJAX, then:

 

 I'm using http://localhost/my_file.html, and the IDE I'm using is Microsoft Visual Code, the thing it injects code into the script for live server. If I don't use Live server, like I type it manually, it works. So, if it's not the IDE, then it must be something else causing the problem

9 hours ago, requinix said:

1. Live Server? Didn't you say you were using XAMPP?
2. Unless configured otherwise, .html extensions do not run PHP code. Use a .php extension.

In VS code there is an extension called live server, which I'm using for development. It seems it's only good for HTML and CSS development

  • 2 weeks later...

Apparently, I have found a way to run php projects without manually typing the url in the address bar

I've install a php server extension and there is a blue button on the top right hand corner. It can only run one project at a time, so if you want to run a different project, you'll have to restart VS Code

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.