Moodle / PHP problem
I've come across a problem with php coding in Moodle. I'm not sure if this is a Moodle, PHP or Windows Server problem, so I apoligise if this post is in the wrong place.
I installed Moodle on to my Windows 2003 Server using the Moodle 1.9 XAMPP installer.
I am running Apache and mySQL from the XAMPP Control Panel.
Whenever I create a php page and then access it within a browser, the page displays. (Often with an error as I'm new to PHP!)
I access the php page and make a change to the code, including a visible text change.
I the refresh the page in the browser, but this doesn't change, including the visable text. I make this a version number so that I know I am looking at the new page.
If I save the altered file to a new name and then access that in the browser, I see the new version number in the text, but the old page still shows the old version number, even though the script of both pages is identical!
As you can probably imagine, this is somewhat frustrating. I have shut down my PC, cleared Cache and even tried looking at the pages from different machines so this is something that is accuring server side.
I have stopped and started the Apache server, but the problem persists.
If anyone can shead some light on this 'very dark' problem, I would be very grateful!!
Sounds like the pages are being cached. Have a check for any page caching options you can change.
I've already flushed my PC's cache and tried other machines.
Does Apache have a built in cache?
No (not unless you have mod_expires and have configured it incorrectly), but you can test that by creating a php file outside of moodle (I think that's what you were describing) and seeing if that caches.
If these are php pages displayed through moodle, then my money is on internal moodle caching. Check the performance pages to see what the setting
is set to. make sure it's on none.
EDIT: Let me know if I misunderstand your first post. (I'm not sure how you're adding php pages through moodle for example)
Moodle Cache is aready set to none and I can not find any reference to mod_expires.
EDIT: I 'add' php pages to the Moodle directory. I'm trying to see if I can pass the active Moodle username to another Web Application.
xammp comes with a php cache called: eAccelerator
It's probably this that's causing the caching you're seeing. I believe you can turn it off in the xampp control panel.
My XAMPP install has 4 modules listed:
Apache, mySQL, Filezilla and Mercury.
Only Apache and mySQL are running.
take look in the php.ini file in xampp\php and find the line:
;zend_extension = "\xampp\php\ext\php_eaccelerator.dll
if it's got a ';' before it then that means it's been disabled and isn't running. So if there isn't a ';' then put on in, save and restart apache.
I found the following in my php.ini file.
I have added the ';' in front of each of the above lines. Saved the file. Stopped and restarted the Apache server and this has got rid of the Cache.
eaccelerator.shm_size = "0"
eaccelerator.cache_dir = "C:\Web Server\tmp"
eaccelerator.enable = "1"
eaccelerator.optimizer = "1"
eaccelerator.debug = "0"
eaccelerator.check_mtime = "0"
eaccelerator.filter = ""
eaccelerator.shm_max = "0"
eaccelerator.shm_ttl = "0"
eaccelerator.shm_prune_period = "0"
eaccelerator.shm_only = "0"
eaccelerator.compress = "1"
eaccelerator.compress_level = "9"
eaccelerator.keys = "shm_and_disk"
eaccelerator.sessions = "shm_and_disk"
eaccelerator.content = "shm_and_disk"
Thanks for all your help.
for the record though you only need to comment out the extension= line - this will stop the extension being loaded and just ignore all the other settings. Useful to bear in mind if you have any other extension problems.
also have you found phpinfo?
create a file called phpinfo.php and in it put:
called the file up in a browser and it will show you all the installed extensions and their settings
Had the same problem with XAMPP, ended up using WAMPServer instead, much nicer all round. Good to know the solution though :)
Danger, this can leak all sorts of sensitive information if you leave it lying around and publicly accessible (and if it's on your webserver, sooner or later I'll be able to access it).
Originally Posted by danbuntu
Use it, read it and then rm -f it.