₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,065 members, 8,420,128 topics. Date: Thursday, 04 June 2026 at 11:49 AM

Toggle theme

My Php Code Does Not Execute But Displays Code On Browser, - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingMy Php Code Does Not Execute But Displays Code On Browser, (3740 Views)

1 Reply (Go Down)

My Php Code Does Not Execute But Displays Code On Browser, by Capacchino(op): 12:22pm On Jun 30, 2016
Greetings experts,
I am a php beginner. I observed that whatever code I write does not execute on the browser, but the browser displays back whatever I have coded instead of the output. Don't rilly know my way around d problem, I need ur suggestions, pls.. Tnx
Re: My Php Code Does Not Execute But Displays Code On Browser, by elfico(m): 12:31pm On Jun 30, 2016
Capacchino:
Greetings experts,
I am a php beginner. I observed that whatever code I write does not execute on the browser, but the browser displays back whatever I have coded instead of the output. Don't rilly know my way around d problem, I need ur suggestions, pls.. Tnx
You are likely not running the code on the server.
If you are using xampp, verify that the php file is saved under c:\xampp\apache\htdocs
Re: My Php Code Does Not Execute But Displays Code On Browser, by damlax: 12:32pm On Jun 30, 2016
Are you using lamp or other software or else it won't show on your browser because browsers defaultly read only HTML , CSS
Re: My Php Code Does Not Execute But Displays Code On Browser, by Capacchino(op): 12:39pm On Jun 30, 2016
Am using wamp server as my local server, and my Php fil is stored c:/wampserver/www/filename
Re: My Php Code Does Not Execute But Displays Code On Browser, by Capacchino(op): 12:41pm On Jun 30, 2016
elfico:
You are likely not running the code on the server.
If you are using xampp, verify that the php file is saved under c:\xampp\apache\htdocs
I am using wamp server and my Php file is on c:/wampserver/www/filename.php
Re: My Php Code Does Not Execute But Displays Code On Browser, by elfico(m): 12:51pm On Jun 30, 2016
Capacchino:
I am using wamp server and my Php file is on c:/wampserver/www/filename.php
check for the folder called htdocs in C:\wampserver\ or C:\wampserver\apache.
Then move your project there.
Are you using an IDE for your coding?
Re: My Php Code Does Not Execute But Displays Code On Browser, by Capacchino(op):
elfico:
check for the folder called htdocs in C:\wampserver\ or C:\wampserver\apache.
Then move your project there.
Are you using an IDE for your coding?
OK. I will try it.. I'm using notepad++

I av moved file to htdocs, its not executing still, code is showing on my browser
Re: My Php Code Does Not Execute But Displays Code On Browser, by hollyfat(m): 2:38pm On Jun 30, 2016
Capacchino:
Greetings experts,
I am a php beginner. I observed that whatever code I write does not execute on the browser, but the browser displays back whatever I have coded instead of the output. Don't rilly know my way around d problem, I need ur suggestions, pls.. Tnx
Hope you are using localhost to access your code
Re: My Php Code Does Not Execute But Displays Code On Browser, by Vstuffs(m): 3:32pm On Jun 30, 2016
Try accessing your code like this
Localhost /filename.php
Save the file inside your htdocs folder in your wamp directory
And make sure your Apache is working
Re: My Php Code Does Not Execute But Displays Code On Browser, by Dlastofmykind(m): 4:49pm On Jun 30, 2016
I hope the file is saved as .php and not as .html?
Re: My Php Code Does Not Execute But Displays Code On Browser, by Capacchino(op): 4:55pm On Jun 30, 2016
hollyfat:
Hope you are using localhost to access your code
Yes I am
Re: My Php Code Does Not Execute But Displays Code On Browser, by hollyfat(m): 5:09pm On Jun 30, 2016
Capacchino:
Yes I am
try using http://127.0.0.1
Re: My Php Code Does Not Execute But Displays Code On Browser, by Capacchino(op): 5:32pm On Jun 30, 2016
Dlastofmykind:
I hope the file is saved as .php and not as .html?
Yes it s saved as. php
Re: My Php Code Does Not Execute But Displays Code On Browser, by ekeroyal(m): 7:38pm On Jun 30, 2016
I have a few questions to ask you OP



1. Is this your first PHP script?



2. If the first answer is no, are other scripts working well?



3. What browser(s) are you using?



4. Did you embed your PHP code in html or just plain PHP code?


Try pasting your code here, if you don't mind.
Re: My Php Code Does Not Execute But Displays Code On Browser, by Capacchino(op): 10:25pm On Jun 30, 2016
Its has been resolved, i just uninstalled and reinstalled wamp server, den I saved on my www folder.. Den used d localhost/foldername/filename.php on d browser...
Tnx for all ur suggestions and opinions, i am grateful
1 Reply

I Can't Solve This Error On My Php Page...My Php Code Does Not Execute But Displays Code On Browser,PHP Code To Insert And Retrieve Images From Mysql Server234

What Development Chain Do You Use For C++?Oracle Vs Sql ServerIs There Any Other Active Forums Like Nairaland In Nigeria