By agateb on
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
=-=
Drupal 5.2 is not ready for a production environment, you should be updating to Drupal 5.1. Please re confirm your version.
Corrected Version
You're right,
I am using version 5.1
=-=
The above quoted from the release thread: http://drupal.org/drupal-5.1
Did you follow this instruction ?
On the upgraded
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
=-=
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 ?
Very Positive...I have four
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.
=-=
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.
I can create a new login for
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.
I can create a new login for
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.
Where are you putting the
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 tryprint $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
I've tried adding PHP to
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.
Update
On the new 5.1 install, I removed TinyMCE and removed all modules I added but I am having the same result. Any ideas?
Another Update
I re-extracted the files to my webroot, with the same database and I still cannot create any PHP content.
Yet Another update
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 supported500 errors are HTTP problems
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/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Not HTTP Problem
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.
mod_security
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 addedSecFilterEngine Offto my .htaccess file but I am still getting the same error. I am still researching the error 501 but has anyone seen this before?=-=
mod_security, isn't worth the headache. If you can disable or figure out what rule is interferring and remove that rule.
mod_security it was
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.
=-=
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.
thanks from me too
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...
He's not unique..
I have the save problem, so far on all Drupal sites I have tested on the same server.
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
Reply button miss-placed above post
Was in response to:-
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