Code shown as text output

2019-07-20 16:27发布

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.

2条回答
劳资没心,怎么记你
2楼-- · 2019-07-20 16:35

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
查看更多
仙女界的扛把子
3楼-- · 2019-07-20 16:54

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.

查看更多
登录 后发表回答