Weird bug , PHP code get prints in browser screen instead execution [closed]
Closed 5 years ago.
- Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
- This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the questi开发者_如何转开发on would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
I am making some code , But it is so strange that code just get prints on screen , I am not able to find any reason of it.
Please help me out of this, rest of the code is working fine.
Thanks
The server is not correctly configured to run php ;)
Or your file has no .php file extension.
That is a very annoying problem. There is an error for sure. Check your web server logs but I doubt the it will be helpful. I solved that problem by using die(); in the script and printing some variables on screen using var_dump and/or print_r. Try to break the script in peaces to isolate and find the problem.
Missing <?php
would be the obvious possibility to check first
Since you provide no detail at all i can just guess:
Is the file extension correct? Is there a .htaccess or server configuration that makes apache not interpret the file as php?
精彩评论