BarryWAaMC Posted March 16, 2010 Posted March 16, 2010 (edited) Hi, 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!! Many thanks, Barry. Edited March 16, 2010 by BarryWAaMC
kesomir Posted March 16, 2010 Posted March 16, 2010 Sounds like the pages are being cached. Have a check for any page caching options you can change.
BarryWAaMC Posted March 16, 2010 Author Posted March 16, 2010 I've already flushed my PC's cache and tried other machines. Does Apache have a built in cache? Cheers.
kesomir Posted March 16, 2010 Posted March 16, 2010 (edited) 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 server->performance->Cache Type 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) Edited March 16, 2010 by kesomir
BarryWAaMC Posted March 16, 2010 Author Posted March 16, 2010 (edited) 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. Cheers. Edited March 16, 2010 by BarryWAaMC
danbuntu Posted March 16, 2010 Posted March 16, 2010 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.
BarryWAaMC Posted March 16, 2010 Author Posted March 16, 2010 My XAMPP install has 4 modules listed: Apache, mySQL, Filezilla and Mercury. Only Apache and mySQL are running. Thanks.
danbuntu Posted March 16, 2010 Posted March 16, 2010 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. 1
BarryWAaMC Posted March 16, 2010 Author Posted March 16, 2010 Cheers Dan, I found the following in my php.ini file. [eAccelerator] extension=eaccelerator.dll 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" ;eaccelerator.admin.name = ;eaccelerator.admin.password = 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. Thanks for all your help. Barry.
danbuntu Posted March 16, 2010 Posted March 16, 2010 no problems 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: <?php phpinfo(); ?> called the file up in a browser and it will show you all the installed extensions and their settings
gshaw Posted March 17, 2010 Posted March 17, 2010 Had the same problem with XAMPP, ended up using WAMPServer instead, much nicer all round. Good to know the solution though
powdarrmonkey Posted March 18, 2010 Posted March 18, 2010 create a file called phpinfo.php and in it put: <?php phpinfo(); ?> called the file up in a browser and it will show you all the installed extensions and their settings 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). Use it, read it and then rm -f it.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now