Code shown as text output

限于喜欢 提交于 2019-12-11 00:25:41

问题


I'm a newbie to Facebook app development. It almost works when the page liked.php is shown (it's shown when a user liked the site), the PHP code is displayed as text output.

my liked.php code: deleted for privacy reasons ?>

Here's the output(it's shown as blank text):

I simply don't know why. Even the error_reporting(E_ALL); doesn't show anything. Simply blank text output. I use the newest facebook php sdk.


回答1:


I guess the problem is not in the code but in the configuration of your server. You need to tell the server to execute the php code instead of displaying it.




回答2:


Sounds like you either don't have PHP installed or you're not using a file extension which invokes the PHP engine - is your file called [Blah].php?

Some things to check:

  • You're serving the file from a web server (not locally)
  • The server has PHP installed
  • Your webserver is configured to use the PHP engine to handle the file type you're using (usually .php or .php4 or similar)
  • creating a new file with just <?php phpinfo(); ?> and serving it should give you lots of info about your PHP install.
  • If you have access to the server, you should be able to run PHP from the command line/shell


来源:https://stackoverflow.com/questions/12129327/code-shown-as-text-output

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!