I am currently running Moodle 2.6 on IIS 7 with MySQL on a production site. I have a test site I'm running on the same server with the latest moodle code to test with. I added another PHP folder containing the 5.5 code and configured my handler mapping on the test site to use the 5.5 php-cgi.exe and when I browse to the test site I get "500 Internal Server Error". I thought it was just something I had misconfigured but I can swap back to 5.3 handler and it works perfectly. When using 5.5, I can get phpinfo all day long so I'm a little confused as to why this isn't working. I also tried just using 5.5 for the production site and it gives the same error. Any help is greatly appreciated.
What does the web server error log say?
All the web server logs are saying is there was a connection. I enabled viewing of errors in PHP for this site and got this...
Warning: Creating default object from empty value in D:\moodletest\config.php on line 5
Warning: Cannot modify header information - headers already sent by (output started at D:\moodletest\config.php:5) in D:\moodletest\lib\setup.php on line 79
Fatal error: $CFG->dataroot is not writable, admin has to fix directory permissions! Exiting.
I know dataroot is writable, as it works as soon as I switch back to PHP53.
Hi Jeff,
Make sure there aren't extra lines or whitespaces after the closing "?>" tag in the PHP configuration file (in case there is one). Or that there aren't any blank lines before the opening tag.
...or it's not some ancient version of config.php. Check config-dist.php and make sure yours matches (if in doubt, rename config.php, copy config-dist.php to config.php, edit config.php and re-fill the details)
Howard, I'm sure it's an ancient version haha. Never really thought to see what changes were made to be honest. I've applied my db settings, dataroot, website etc to the config-dist and renamed accordingly. Now, I get service unavailable. I don't have a dirroot in the config-dist file though. Has this been removed?
Yes - dirroot is no longer required. If you go well down the config.php (section 7 iirc) file you will find the options to enable Debugging. Uncomment the relevant lines and see what you get.
- After a lot of stepping through code and checking permissions, I found my IIS application pool process was running under the Network Service account. I had to give this account modify permission tot he moodledata directory to allow writing.