php file download problem with 1.6 unresolved

php file download problem with 1.6 unresolved

by Anil Sharma -
Number of replies: 10

Hi everyone !

Please check these different posts :

http://moodle.org/mod/forum/discuss.php?d=52216
http://moodle.org/mod/forum/discuss.php?d=49680
http://moodle.org/mod/forum/discuss.php?d=48298

All of these are different people facing similar problem, that the cron.php or sometimes some other php file wants to download instead of executing in explorer.  I've faced this problem with both php version 4 & 5 and it majorly occurs when a verion of moodle is upgraded from 1.5 to 1.6. Setting the permissions to execute makes no difference. Also, with all settings same, a fresh 1.6 install doesnt have this problrm, while an upgraded one does.

In my case, the cron.php file isn't running at all, it just wants to download.  Do any of you gurus have any ideas ?

Average of ratings: -
In reply to Anil Sharma

Re: php file download problem with 1.6 unresolved

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I'm not sure this is the real root of the problem, but could you try removing the line in .../admin/cron.php that reads:

@header('Content-Type: text/plain; charset='.current_charset());

Saludos. Iñaki.

In reply to Iñaki Arenaza

Re: php file download problem with 1.6 unresolved

by Anil Sharma -

I may have solved the problem.  When I made a change to the cron.php file and tried to upload, it wouldn't overwrite the old file. I kept getting an error message 'bad file descriptor' . By login into shell mode and owerwriting the file with a new one, the problem seems resolved.

Thanks  !

In reply to Anil Sharma

Re: php file download problem with 1.6 unresolved

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Just a question to make it clear what was that fixed the issue (to file a bug in case it's necessary). Did you just overwrite the old file with a new one without changing a bit in new the file, or did you remove the line I mentionnned in the new file?

Saludos. Iñaki.
In reply to Iñaki Arenaza

Re: php file download problem with 1.6 unresolved

by Anil Sharma -
I overwrote with a new file, without making any changes.
In reply to Anil Sharma

Re: php file download problem with 1.6 unresolved

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Thanks a lot smile

Saludos. Iñaki.
In reply to Iñaki Arenaza

Re: php file download problem with 1.6 unresolved

by Anil Sharma -

I'm still facing problems. 

I've changed the cron.php file with an older fuctional file and it runs, but all posts do not get processed. Specially, the forum digest doesnt get emailed automatically.  Now, i've downloaded cron.php from the CVS of moodle 1.6 table, and that file again doesnt execute, it starts downloading itself !

 

In reply to Anil Sharma

Re: php file download problem with 1.6 unresolved

by jonny guns -
are you sure your mime is setup correctly on your webserver? That being misconfigured is the only time a php file tries to open rather then execute.. 
In reply to jonny guns

Re: php file download problem with 1.6 unresolved

by Just H -
Hi Jonny

First up let me say I really have no idea about this sort of thing but I have had similar issues (php trying to download rather than execute) since I started using Moodle (1.4 I think it was) and in my cases it has appeared to be a timeout issue based on the fact if I tried it again it would work.

I am on shared hosting therefore do not have all resources available and it seems to time out now and then, and tries to download, at what I assumed where times the resource use on the server was heavy.

Does that sound feasable based on what you said re mime types?

Regards
H
In reply to Anil Sharma

Re: php file download problem with 1.6 unresolved

by Richard Mansfield -
I just installed moodle for the first time today (1.6) and I have the same problem,
http://localhost/moodle/index.php executes okay, but
going to http://localhost/moodle opens up the download dialog box (in firefox).

When I cleared the browser's cache, the problem went away.

If I let the download complete, a file with a cryptic name like 9itog72k.php was downloaded, and this seemed to be an older version of the index.php file in the main moodle root, because the webserver's moodle/index.php starts like this:

<?php  // $Id: index.php,v 1.161.2.5 2006/07/19 13:57:57 skodak Exp $
       // index.php - the front page.

But the file that was downloaded had an older date, and started like this:

<?PHP  // $Id: index.php,v 1.115.2.2 2004/09/07 14:14:30 moodler Exp $
       // index.php - the front page.

Richard.





In reply to Richard Mansfield

Re: php file download problem with 1.6 unresolved

by Richard Mansfield -
Whoops, the older index.php was from a previous version of moodle (debian stable) which I'd downloaded and then overwritten.