0

I want to use php code inside my content editor I already enabled the PHP Filter from module then selected Text Format : PHP code and "PHP evaluator" option is on but still it's not working

I have tried a simple code of php

<?php 
  echo "PHP is here"; 
 ?>

but this turned into a HTML comment in

output :

<!--?php 
   echo "PHP is here"; 
?-->

Note: I already gave the permission to use PHP

  • I think you have to remove <?php and ?> – Huelfe Dec 2 '15 at 8:05
  • Are you using ckeditor/WYSIWYG ? If yes please provide respective version. – dev.patrick Dec 2 '15 at 8:05
  • did u clear the cache? – No Sssweat Dec 2 '15 at 8:06
  • 1
    @Huelfe, php tags have to be there its in instruction even when you choose php as format. – dev.patrick Dec 2 '15 at 8:08
  • 1
    This has been removed from core, for good reasons: "Warning Enabling this module can cause security and performance issues as it allows users to execute PHP code on your site. There are better alternatives out there that do not expose such vulnerabilities on your site." -- drupal.org/project/php – cilefen Dec 2 '15 at 19:13
0

You need to set the right permissions for the php.

  1. Go to admin/people/permissions
  2. Search for the php
  3. Click the check box for the roles who can use the php
  • i already given the permission – HUNK Dec 4 '15 at 9:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.