Plugin Beginner

Re: Plugin Beginner

by Justin Hunt -
Number of replies: 0
Picture of Particularly helpful Moodlers Picture of Plugin developers

It sounds to me like you are "barking up the wrong tree."

If all the other pages in Moodle are displaying correctly then I do not think you need to modify anything at the apache level just for your php file. I would first make sure that it has the same permissions and same ownership as the other files in the directory. 

The other issue here, is that if you want your php file to be a part of Moodle, it really should be a Moodle php page, and ideally part of a plugin.

Moodle provides an API that gives you access to permissions, layout (headers/footers etc) database, internationalisation etc. Much of that requires that Moodle knows which plugin is calling the API, via the plugin's "component name". Though depending on what you are doing, it is possible to just have a free standing page.

It might pay to look at an activity's view.php page (say /mod/page/view.php), because this will show the basic setup that a page accessed directly from a browser needs to be a nice Moodle citizen. (ie page layout, login check, javascript loading, parameter retrieval)