Jump to content

Recommended Posts

Posted (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!

 

:frusty:

 

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 by BarryWAaMC
Posted (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 by kesomir
Posted (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 by BarryWAaMC
Posted

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.

Posted

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.

  • Thanks 1
Posted

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.

Posted

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

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...