-2

I recently migrated my Drupal 7 sites to A2 Hosting. Everything was working fine, until I had to edit a node which had some simple PHP code content in its body (it only shows different links if the user is anonymous or authenticated).

After modifying the content and clicking on Save, the page reloads without giving any message (such as node was updated), showing the content editing form as it was prior to the editing.
If I try to create a new page whose body is formatted as PHP code, the page is reloaded with a blank form after I hit Save.
Despite this, all my previous, unmodified PHP snippets were working fine.

This happens in 3 Drupal 7 sites I have hosted at A2. In one of them, as an attempt to fix the issue, I tried to temporary disable the PHP filter module and re-enable it afterwards. I managed to disable it, but it cannot be re-enabled. Every node and block using that input filter stopped working.

Then I installed a new, clean, standard Drupal 7.74 site on a subdomain, for testing purposes. It is impossible to enable PHP filter module in it. If I try it in admin/modules, the page reloads without any message and the PHP filter module remains disabled, just like in my own site. It is possible to enable any other modules, but PHP filter.

What could be the problem?

  • I have a local clone of that site in my mac running on MAMP. It works OK here. So I uploaded files and data base from the local to remote. And the problem went back to the remote version of the same site hosted by A2! So it looks like some configuration on their side is the culprit? They said nothing on their side could cause the issue... – dtabach Nov 21 at 20:00
  • 1
    The problem is that you're using PHP code in a body field, which is bad practise. – baikho Nov 21 at 20:35
  • Yes, I heard it is bad practise, I'm not a professional and I would appreciate any guidance on how to get the same result with different means, but this is another problem. The site is being running these simple scripts for years without problems, why did it stop just by changing ISP? Why it works in my local server and it does not in the remote? – dtabach Nov 21 at 22:29
  • If I simply add php tags like <?php ?> it is enough to prevent Drupal from saving the content. – dtabach Nov 21 at 22:30
  • 2
    This is probably not going to be figured out by anyone without some sort of error log. I don't think there are enough details. – Kevin Nov 23 at 1:46

Your Answer

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

Browse other questions tagged or ask your own question.