Forbidden - editing student profile

Forbidden - editing student profile

by Paul Quicke -
Number of replies: 6

I am getting an error when editing my test student profile.

You don't have permission to access /xxxx/user/edit.php on this server.

It views fine but when you update I get the error. edit.php permission is 755

This also is the case with editing admin profile.

Any suggestions?

Thanks!


Average of ratings: -
In reply to Paul Quicke

Re: Forbidden - editing student profile

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Sounds very strange... can we get a screen shot of this error please?

In reply to Howard Miller

Re: Forbidden - editing student profile

by Paul Quicke -

not much to show but...

Attachment error.jpg
In reply to Paul Quicke

Re: Forbidden - editing student profile

by Paul Quicke -

/user/editadvanced.php works (for admin)

/user/edit.php Doesn't work  (for admin or student)

In reply to Paul Quicke

Re: Forbidden - editing student profile

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

This message is generated by the web server.

I would start by checking  the web server's error log for this event. It will probably tell you that access is prevented due to the web server's configuration. If that's the case you will need to check the configuration files for the cause. Something in there is blocking files called 'edit.php'. It's also possible that this is due to some settings in a .htaccess file that 'belongs' to some other application. For example, we sometimes see problems like this when Moodle has been installed 'underneath' Wordpress.

It could still be caused by some odd permissions on that file, but 0755 would "normally" be ok regardless of ownership etc., so it's not where I would start.

In reply to Howard Miller

Re: Forbidden - editing student profile

by Paul Quicke -

Yep I had the same thought smile so I created a  file edit.php under root/test/user/edit.php

I can view it (but that is true for the moodle one as well) and it runs this... 

<html>

 <head>

  <title>PHP Test</title>

 </head>

 <body>

 <?php echo '<p>Hello World</p>';  

$content = "some text here";

$fp = fopen($_SERVER['DOCUMENT_ROOT'] . "/myText.txt","wb");

fwrite($fp,$content);

fclose($fp);

?>

 </body>

</html>


This is stand alone moodle (no wordpress)

In reply to Paul Quicke

Re: Forbidden - editing student profile

by Paul Quicke -

FYI - There was a ModSecurity rule causing this error. I have put it to detection mode now and all works.