Web Hosting Forum | Lunarpages
News: April 3, 2008 - New Contest! - Win 5 Years of Hosting and $1,000!
May 5, 2008 - May 08 Web Site of the Month? - Submit your LINKS!!!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 16, 2008, 06:38:04 PM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: Help: Mediawiki install success, but Error 500 "Internal Server Error"  (Read 319 times)
russtifarian
Space Explorer
***
Offline Offline

Posts: 9



WWW
« on: May 07, 2008, 02:55:53 PM »

Hi folks,

I have installed Mediawiki 1.12 and successfully installed it (enabled PHP5, then ran install script).  I moved the Localsettings.php as instructed and then tried my site, but got Error 500 "Internal Server Error".

I found this Forum posting which described the same problem, and also the same reply that I got from Lunarpages support:

 http://www.lunarforums.com/lunarpages_webhosting_help/php-t20568.0.html;msg156979#msg156979  and
 http://www.lunarforums.com/lunarpages_webhosting_help/php-t20568.0.html;msg157917#msg157917
 

The poster “Sten” said he finally fixed the problem: http://www.lunarforums.com/lunarpages_webhosting_help/php-t20568.0.html;msg158453#msg158453 , but he never explained what the fix was.  I am trying to contact him, but his last active post was in 2005.

Here's what I got from tech support, plus my reply

Quote
Regarding your suggestions, I’ve checked the conditions you listed and none seem to apply:

1. The permissions on some of the folders or files are 777 or 666. If this is the case, change them to either 755 or 644 in Cpanel's File Manager (or using your local FTP client).

[RCT] I have checked the permissions on folders and some files, and none are 777 or 666.  All directories were 755 and all files were 644.  I tried changing a few file permissions from 644 to 755 to see if would make a difference, but it did not. 

The ONLY directory that is not set to 755 is the “public_html” (not the home directory for the wiki), which is set to 750.  Is that as it should be?

2. The files and/or folders are not owned by you. Certain applications having been run under php as an apache module may have files owned by the apache user of nobody. An indication that you don't own the files would be if you are unable to change their file permissions. To correct this, please provide your username or domain name, and provide the location of the folder or files that need to have your ownership.

[RCT] All files and folders appear to be owned by me.  I was able to change permissions on all files and folders I tested.


3. Your .htaccess file has php_values or php_flags in it. This causes a 500 Internal server error when attempting to execute the script.

[RCT] None of the .htaccess files had any php_values or php_flags that I could see. 

In the home directory of the wiki (/public_html/wiki/), where index.php is found, the contents of .htacess are:

     AddHandler application/x-httpd-php5 .php

In the subdirectories, the contents of .htacess are:

      Deny from all
 
Is this a problem???


Also, I can't find my current apache log.  The archive log only includes log entries up to yesterday.

Thanks in advance for your help or advice.

Russ

Logged
russtifarian
Space Explorer
***
Offline Offline

Posts: 9



WWW
« Reply #1 on: May 07, 2008, 03:00:30 PM »

By the way, Mediawiki is the engine behind Wikipedia, runs on PHP5, MySQL, etc.

I have installed a previous version on Lunarpages (I think it was version 1.6 or 1.8 vs. the current 1.12) and did not run into this problem.

Thx.
Logged
russtifarian
Space Explorer
***
Offline Offline

Posts: 9



WWW
« Reply #2 on: May 07, 2008, 05:07:59 PM »

By the way, PHP5 runs fine from this directory -- see: http://meritology.com/wiki/testing.php as proof.   Confused
Logged
russtifarian
Space Explorer
***
Offline Offline

Posts: 9



WWW
« Reply #3 on: May 07, 2008, 05:20:00 PM »

Also, I can't seem to find the error logs where 500 Internal Server Errors are posted.  Where can I find the error log for Apache errors such as this (script errors).

the "Error Log" in cPanel only shows 404 and similar errors.

the "Raw Log" archives in cPanel only shows GETs and POSTs, no errors.

Help!! Help

Russ
Logged
russtifarian
Space Explorer
***
Offline Offline

Posts: 9



WWW
« Reply #4 on: May 07, 2008, 06:32:09 PM »

I found this interesting post from someone using suPHP and he tried to install Mediawiki:
http://scripts.mit.edu/~ghudson/blog/?p=12

Quote
When I tried out MediaWiki, I ran into a small hurdle: it wants the PHP session directory to be writable, which it’s not since /etc/php.ini sets save_path to /var/lib/php/session which is writable by group apache but not by random user IDs.  I can configure PHP’s session.save_path in /etc/php.ini to point to a world-writable sticky directory like /tmp.  The planned default umask (072; all users share the same group) would work to protect session data from other users, I think.  But it feels unsafe; I’d rather have a separate session directory for each user.  I don’t think I can do that in a single global php.ini; the documentation and source code don’t reveal any kind of substitution going on in session.save_path which I could use to put in the current user’s home directory or some such.

This sounds on-point.  Probably, the permission culprit is the PHP session directory, not the directories with the wiki code.  So maybe the question is "where is the PHP session.save_path under suPHP?"   and "How can I set it to /temp?"

Russ
Logged
russtifarian
Space Explorer
***
Offline Offline

Posts: 9



WWW
« Reply #5 on: May 08, 2008, 09:20:23 AM »

OK.  I figured out how to change the PHP session directory, but that still didn't solve my problem.    Crying or Very sad

Specifically, I've changed .htaccess in the public_html directory to include:

Code:
suPHP_ConfigPath /home/username/public_html

This (successfully) sets the php.ini to the file: /home/username/public_html/php.ini .

This new php.ini contains the line:

Code:
session.save_path="/home/username/php_tmp"

This (successfully) sets the PHP Session directory to php_tmp, which I created in my home directory.

I tried various permission settings on php_tmp directory, including 777 and 755, but nothing worked. Still got Error 500.

BTW, when I try browsing index.php5 instead of index.php, I get a blank (empty) page with no server errors.

PHP5 works, as did the installation script for Mediawiki 1.12. Here's the URL for PHP test program in the wiki directory:
http://meritology.com/wiki/testing.php . It lists full phpinfo() so y'all can see what's configured.

Logged
russtifarian
Space Explorer
***
Offline Offline

Posts: 9



WWW
« Reply #6 on: May 08, 2008, 10:59:09 AM »

Problem solved!

I turned on PHP error logging with the following entries in php.ini:

Code:
error_reporting=E_ALL
log_errors=On
error_log="/home/username/logs/phperrors.log"
display_errors=Off

This revealed the source of my problems: several PHP source files didn't upload properly.  Once I uploaded them again, everything appears to work just fine!!  Smile

By the way, I don't know if my changes to PHP session directory were critical or not.  I might go back and test this sometime.

I hope this sleuthing I've done helps others.

Russ
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM