+ Post New Thread
Results 1 to 12 of 12
Virtual Learning Platforms Thread, Moodle / PHP problem in Technical; Hi, I've come across a problem with php coding in Moodle. I'm not sure if this is a Moodle, PHP ...
  1. #1
    BarryWAaMC's Avatar
    Join Date
    Oct 2009
    Posts
    22
    Thank Post
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Angry Moodle / PHP problem

    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.
    Last edited by BarryWAaMC; 16th March 2010 at 09:37 AM.

  2. #2
    kesomir's Avatar
    Join Date
    Mar 2008
    Location
    London
    Posts
    288
    Thank Post
    15
    Thanked 28 Times in 23 Posts
    Rep Power
    17
    Sounds like the pages are being cached. Have a check for any page caching options you can change.

  3. #3
    BarryWAaMC's Avatar
    Join Date
    Oct 2009
    Posts
    22
    Thank Post
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    I've already flushed my PC's cache and tried other machines.

    Does Apache have a built in cache?

    Cheers.

  4. #4
    kesomir's Avatar
    Join Date
    Mar 2008
    Location
    London
    Posts
    288
    Thank Post
    15
    Thanked 28 Times in 23 Posts
    Rep Power
    17
    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)
    Last edited by kesomir; 16th March 2010 at 10:13 AM.

  5. #5
    BarryWAaMC's Avatar
    Join Date
    Oct 2009
    Posts
    22
    Thank Post
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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.
    Last edited by BarryWAaMC; 16th March 2010 at 10:26 AM.

  6. #6
    danbuntu's Avatar
    Join Date
    Dec 2009
    Location
    Maidstone, Kent
    Posts
    289
    Thank Post
    0
    Thanked 52 Times in 49 Posts
    Rep Power
    19
    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.

  7. #7
    BarryWAaMC's Avatar
    Join Date
    Oct 2009
    Posts
    22
    Thank Post
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    My XAMPP install has 4 modules listed:
    Apache, mySQL, Filezilla and Mercury.

    Only Apache and mySQL are running.

    Thanks.

  8. #8
    danbuntu's Avatar
    Join Date
    Dec 2009
    Location
    Maidstone, Kent
    Posts
    289
    Thank Post
    0
    Thanked 52 Times in 49 Posts
    Rep Power
    19
    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.

  9. Thanks to danbuntu from:

    BarryWAaMC (16th March 2010)

  10. #9
    BarryWAaMC's Avatar
    Join Date
    Oct 2009
    Posts
    22
    Thank Post
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Cheers Dan,

    I found the following in my php.ini file.

    Code:
    [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.

  11. #10
    danbuntu's Avatar
    Join Date
    Dec 2009
    Location
    Maidstone, Kent
    Posts
    289
    Thank Post
    0
    Thanked 52 Times in 49 Posts
    Rep Power
    19
    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

  12. #11
    gshaw's Avatar
    Join Date
    Sep 2007
    Location
    Essex
    Posts
    2,648
    Thank Post
    164
    Thanked 217 Times in 200 Posts
    Rep Power
    66
    Had the same problem with XAMPP, ended up using WAMPServer instead, much nicer all round. Good to know the solution though

  13. #12

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    Quote Originally Posted by danbuntu View Post
    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.

SHARE:
+ Post New Thread

Similar Threads

  1. Cron (Moodle/ Corn.php) on Ubuntu 8.04lts
    By kieran8055 in forum Virtual Learning Platforms
    Replies: 7
    Last Post: 18th September 2009, 03:41 PM
  2. PHP problem in win2k3 64bit
    By gianboy in forum Windows Server 2000/2003
    Replies: 6
    Last Post: 3rd August 2009, 02:46 AM
  3. Moodle PHP
    By danIT in forum Coding
    Replies: 6
    Last Post: 12th January 2009, 01:38 PM
  4. FreeBSD, PHP, Moodle + LDAP
    By Marci in forum Web Development
    Replies: 4
    Last Post: 25th June 2008, 08:20 AM
  5. Office 2007 file format support in Apache, PHP and Moodle
    By Geoff in forum Virtual Learning Platforms
    Replies: 2
    Last Post: 8th July 2007, 12:12 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •