I created a page and put PHP code in the body. This code is not executing. What am I doing wrong?

For example: <?php echo time(); ?> does not work.

  • WYSIWYG is turned off
  • Rich text is not enabled
  • PHP code input format is selected

Comments

jaypan’s picture

Look at the HTML source and see what is being outputted.

Contact me to contract me for D7 -> D10/11 migrations.

easton’s picture

Nothing is being outputted in the code.

tom.camp’s picture

Are you seeing any PHP errors in the logs - /admin/reports/dblog?

Try to echo out some text, like echo 'test'