Hey All,
I need some assistance. I just installed Drupal 5.2 and I cannot create any PHP content. I am getting this: Error 501/505: Method not implemented or not supported. Now, I created an Administrator role with the permission to use Full HTML and PHP as my Input Type. I also have a 4.7 installation that I upgraded to 5.2 and I am getting the same error on new content that has the <?php ?> tag. On the upgraded installation, all my old PHP content still works, its jut that I cannot create any new content that has PHP in it. Can you think of anything I am missing?

Comments

vm’s picture

Drupal 5.2 is not ready for a production environment, you should be updating to Drupal 5.1. Please re confirm your version.

agateb’s picture

You're right,
I am using version 5.1

vm’s picture

For the most trouble-free transition from an existing installation, it is recommended that you first upgrade to Drupal 4.7.5 or Drupal 5.0.

The above quoted from the release thread: http://drupal.org/drupal-5.1

Did you follow this instruction ?

agateb’s picture

On the upgraded installation, I upgraded from 4.6 to 4.7.5, ran that for a couple of months then upgraded to 5.1. On the new install, I just installed 5.1

vm’s picture

and you are positive you are shifting the input format from FILTERED HTML to PHP prior to submitting the node , that has php inluded in it ?

agateb’s picture

Very Positive...I have four Dupal sites, two are still running 4.7.6 with no problems. All my sites have heavy PHP content so this is not somethng I am new to.

vm’s picture

What concerns me, is that you claim this same thing is happening on a Fresh install of Drupal 5.1. This shouldn't be as, None of my 5.1 installs have the problem you are discussing. I was not trying to question your experience or knowledge.

agateb’s picture

I can create a new login for you with the appropriate priviledges or you can use the one that I currently log in with to see if you can help me figure this out. Let me know if I can pm you and email you this info.

agateb’s picture

I can create a new login for you with the appropriate priviledges or you can use the one that I currently log in with to see if you can help me figure this out. Let me know if I can pm you and email you this info.

rolodmonkey’s picture

Where are you putting the PHP input? Are you adding it to specific nodes, or are you adding it to module settings? For security reasons, some parts of 5.1 will strip out code, without giving you an option of PHP input.

For instance if you put a

tag in the Footer message, everything looks fine, but if you try print $footer; the tags will be stripped out. Another example is TinyMCE which has a set of tag filters that are completely separate from the ones you can set in Input formats.

--

Read more at iRolo.net

agateb’s picture

I've tried adding PHP to Pages, Book Page, and Story and also Scripts, a new content type that I created. All yeilds the same result. You mentioned TinyMCE, I just installed it on both servers but have not made any configuration changes to it. I'll try uninstalling that and see if it makes a difference. If that doesn't work, I'll disable all my modules on the fresh install and go back to the base install. If you have any other suggestions I'll greatly appreciate it.

agateb’s picture

On the new 5.1 install, I removed TinyMCE and removed all modules I added but I am having the same result. Any ideas?

agateb’s picture

I re-extracted the files to my webroot, with the same database and I still cannot create any PHP content.

agateb’s picture

I dropped my database; recreated it...did a totally new install of 5.1, created a new user and the first thing I tried to do after the initial login was to add PHP content to a node and I got Error 501/505 - Not implemented or not supported

dman’s picture

That message would imply to me a protocol error more than anything else.

Odd that you find it only coming up with server-side PHP, yet you can create standard pages fine.
PHP or not-php should be a drupal server/syntax problem, but you are getting a browser/network problem.

You'd have to drill down to the HTTP headers to find what the story is there. The link above suggests you have the annoying IE 'friendly' error messages on - which exist only to obscure the reall error message from you. Is that really the case?

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

agateb’s picture

I think it has something to do with the way the web server is configured but I cannot figure out what it is. I tried what you suggested in Internet Explorer but that did not make a difference. I've also tried muiliple borwsers(Mozilla, Firefox, Avant, Maxthon, Epiphany). The verbage is different but I get some form of error on all. I'm gonna disable mod_rewrite, that's the last thing I enabled on the server and the error log is suggesting a PHP injection attack. That's gonna take me a while though, cos I am using dynamic virtual hosting on apache and I have to schedule some downtime...come to think of it, that's the only common thing between the servers that are not working. I'll let you know if that works.

agateb’s picture

I haven't disabled mod_rewrite but going thru my error log I came accross this error [Wed May 30 09:06:59 2007] [error] [client 207.67.35.142] ModSecurity: Access denied with code 501 (phase 2). Pattern match "(?:(?:\\\\b(?:f(?:tp_(?:nb_)?f?(?:ge|pu)t|get(?:s?s|c)|scanf|write|open|read)|gz(?:(?:encod|writ)e|compress|open|read)|s(?:ession_start|candir)|read(?:(?:gz)?file|dir)|move_uploaded_file|(?:proc_|bz)open)|\\\\$_(?:(?:pos|ge)t|session))\\\\b|<\\\\?(?!xml))" at ARGS:body. [id "950013"] [msg "PHP Injection Attack. Matched signature <<?>"] [severity "CRITICAL"] [hostname "workingdir.homelinux.net"] [uri "/drupal/?q=node/add/page"] [unique_id "qEd2TwoKAAMAAAf4HFkAAAAG"]. I've added SecFilterEngine Off to my .htaccess file but I am still getting the same error. I am still researching the error 501 but has anyone seen this before?

vm’s picture

mod_security, isn't worth the headache. If you can disable or figure out what rule is interferring and remove that rule.

agateb’s picture

I disabled mod_security and I can now post PHP content. I'm not too comfortable about leaving it off so I'm gonna see what rule was causing that error and disable it. Thanks for your help guys.

vm’s picture

I don't use it, with mod_security you can wind up with posts that wont post, simply because of the use of words that look like code. An example of this, is perl. no matter where it sits in a word, its enough to trip mod_security. I'll venture a guess there are many who don't use it.

teagle’s picture

This has really helped - disabling mod_security (at least while I do things in php input format) has ended a frustrating day - so thanks VERY much from me too...

John Bryan’s picture

I have the save problem, so far on all Drupal sites I have tested on the same server.

  • Dedicated Server
  • Redhat Linux Fedora 7
  • Apache 2.2.4
  • PHP 5.2.2
  • Drupal 5.1

Tried suggestions from some other postings/threads which suggest it is a conflict with mod_security. But it doesn't exist in the system http.conf and the commands to disable it via .htaccess break the whole site.

Regards

John Bryan
www.ALT2.com
Application Integration Specialists
Tel: UK 08700 3456-31

John Bryan’s picture

Was in response to:-

What concerns me, is that you claim this same thing is happening on a Fresh install of Drupal 5.1. This shouldn't be as, None of my 5.1 installs have the problem you are discussing. I was not trying to question your experience or knowledge.

For clarification this happens when ever trying to create nodes with PHP content, even with PHP Input Filter selected and <?php ?> being used.

Regards

John Bryan
www.ALT2.com
Application Integration Specialists
Tel: UK 08700 3456-31