Php code is showing in browser instead of executing

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Re: Php code is showing in browser instead of executing

Postby Altrea » 03. January 2019 09:28

Search for and follow the steps to how to unhide the known extensions related to your operating system
http://lmgtfy.com/?q=unhide+extensions+ ... file+types

Then remove the unwanted file extention by renaming the file.

Last step use a better editor to create and edit your php files.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 9861
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Php code is showing in browser instead of executing

Postby delrashmi » 03. January 2019 11:41

i changed my file extension & now my code is not displaying on browser,but when i use following code....<?php echo"hello"; ?> ,browser left blank ie hello is not printing on my browser.
delrashmi
 
Posts: 14
Joined: 01. January 2019 05:32
XAMPP version: 3.2.2
Operating System: window10,64bit

Re: Php code is showing in browser instead of executing

Postby Altrea » 03. January 2019 12:01

What is the output of your browsers source code view at the moment you get a blank screen?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 9861
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Php code is showing in browser instead of executing

Postby delrashmi » 04. January 2019 05:38

it shows me the php code while the browser screen is blank
delrashmi
 
Posts: 14
Joined: 01. January 2019 05:32
XAMPP version: 3.2.2
Operating System: window10,64bit

Re: Php code is showing in browser instead of executing

Postby Nobbie » 04. January 2019 12:12

You probably are still using wrong file extension.
Nobbie
 
Posts: 11218
Joined: 09. March 2008 13:04

Re: Php code is showing in browser instead of executing

Postby delrashmi » 04. January 2019 12:18

no this time i am sure ,also my file is showing as php file but when i execute it -browser screen remains white without showing anything.
delrashmi
 
Posts: 14
Joined: 01. January 2019 05:32
XAMPP version: 3.2.2
Operating System: window10,64bit

Re: Php code is showing in browser instead of executing

Postby Nobbie » 04. January 2019 12:28

How do you enter the file name into your browser? Something is wrong with your description, you said you entered test.php into your browser, while the file name was test.php.txt, that would lead to error 404 or 403 not found.

We cannot help you if dont tell how you are executing test.php. I assume that you simply double click in explorer on the file test.php, but you do not tell us so.
Nobbie
 
Posts: 11218
Joined: 09. March 2008 13:04

Re: Php code is showing in browser instead of executing

Postby delrashmi » 04. January 2019 13:56

Let me explain the whole scenario from beginning.....at first i create a php file (test.php) but it was saved as test.php.txt and when i tried to execute it ,it shows me the php code in browser but now i changed the file type of same file & now its showing me as php file.Now at this time when i tried to open the same file (saved as test.php in htdocs) as-localhost/test.php it shows me the blank browser page.
delrashmi
 
Posts: 14
Joined: 01. January 2019 05:32
XAMPP version: 3.2.2
Operating System: window10,64bit

Re: Php code is showing in browser instead of executing

Postby Altrea » 04. January 2019 14:04

can you send us the php file?

There must be something wrong with it or it's code or the way how you access it.
And with the information you provided us it is not possible to identify this issue.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 9861
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Php code is showing in browser instead of executing

Postby Nobbie » 04. January 2019 14:28

delrashmi wrote: and when i tried to execute it


This is still a bad description. Do not use "try to execute", i have no idea what you mean by that. Please explain fully and precisely, what you are doing. Each mouseclick, every keystroke!
Nobbie
 
Posts: 11218
Joined: 09. March 2008 13:04

Re: Php code is showing in browser instead of executing

Postby delrashmi » 05. January 2019 08:16

my php code is-<?php echo"hello"; ?> & have saved it as test.php in htdocs folder.Now in browser i enter url as-localhost/test.php & it shows me blank screen of browser
delrashmi
 
Posts: 14
Joined: 01. January 2019 05:32
XAMPP version: 3.2.2
Operating System: window10,64bit

Re: Php code is showing in browser instead of executing

Postby Altrea » 05. January 2019 08:42

In my test environment it is working as expected. My test.php file echoes the word hello instead of a full white page.
My source code view contains only the word hello, no php code.

I'm out. I cannot help you. I don't know your XAMPP configuration, i don't know your php file and i have no possibilities to analyse and test it myself.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 9861
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Php code is showing in browser instead of executing

Postby delrashmi » 05. January 2019 08:44

Ok...not an issue thanks for ur comments/suggestions.
delrashmi
 
Posts: 14
Joined: 01. January 2019 05:32
XAMPP version: 3.2.2
Operating System: window10,64bit

Previous

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 82 guests