title images

Tuesday
March 21, 2006
06:06:16

Next entry: Japanese Phrase of the Day
Previous entry: Holidays the rest of the country apparently has

Related entries:
Drawing a line in the sand
Stage 1 - complete
funkiness going on…..
Japanese Moblogging + WordPress + Postie + WP-Cron - a How To
Comment spam leads to moderation

Recently Served Up

Lemon and Dill Jelly
Roasted Red Capsicum Hummus
Spinach Rice Croquettes
quake 5:08 pm
Edamame & Tofu Dip
quake 4:59 am
Potato and Chive Croquettes
Ebina Light Experiments
quake 8:45 am
quake 5:41 am
quake 11:45 pm
Jammin’! Spicy Fig Orange Marmalade
Roasting Red Capsicum
Eggplant & 3 Cheeses Lasagne
Whey To Go! Home Made Ricotta Cheese

Monthly Archives

Categories

Australia (2)
Earthquake Reports (35)
Food & Drink (14)
Italy (23)
Japan (11)
MJD-S Related (16)
Observations (12)
Personal Projects (5)
Photography (51)
Rants (5)
Silliness (3)
Techie Stuff (2)
Thumps & Whistles (1)
via Keitai (0)
World (2)
友達 (8)

Recently Added Spice

• nose smaller on On returning to Japan and wanting to remove one's head
• Jip on Jammin'! Spicy Fig Orange Marmalade
• John on Amazing Carrot Soup Recipe
• Layne on Lemon and Dill Jelly
• moth on Lemon and Dill Jelly
• kirsty_girl on Edamame & Tofu Dip
• Lulu on Roasted Red Capsicum Hummus
• The Goddess on Spinach Rice Croquettes
• Rebecca in SoCal on The Elusive Aussie Morning & Taste Memory
• Rebecca in SoCal on Riding with Fishes

Feeds

Atom
RSS 2.0
Subscribe in a reader

Page hits: 553513



Movable Type + php + 500 internal server error

by MJD-S

Share

Trying to convert your MT site from .html to .php but tearing out your hair because everytime you try to go to a php page you get the dreaded 500 internal server error? Been absolutely confuddled because a php test file you upload works ok - but the MT generated one still buggers up?

Then go no further.

Step 1

Check whether your webhost uses SuExec (What??). They will probably list whether they do in their FAQ docs. If not drop them a line to find out.

What basically is happening is that MT wants to make your directory permissions 777 and your file permissions 666. Your SuExec using web host doesn’t want these permissions to be used. It will say “Bugger off. Here is a 500 internal server error for you”.

Step 2

Grab your mt-config.cgi file.

Open it in a program such as BBEdit or Notepad.

Go to line 172.

164 # When creating files and directories, Movable Type uses umask settings to
165 # control the permissions set on the files. The default settings for file
166 # creation (HTMLUmask, DBUmask, and UploadUmask) are 0111; for directory
167 # creation (DirUmask), the default is 0000. You should not change these
168 # settings unless you are running MT under cgiwrap or suexec, or some other
169 # scenario where the MT application runs as you; in addition, you should not
170 # change these settings unless you know what they mean, and what they do.
171 #
172 # DBUmask 0022
173 # HTMLUmask 0022
174 # UploadUmask 0022
175 # DirUmask 0022
176 #
177 #
178 # In addition to controlling permissions via umask settings, you can also
179 # use the HTMLPerms and UploadPerms settings to control the default
180 # permissions for files created by the system (either as output files or
181 # uploaded files). The only real use of this is to turn on the executable bit
182 # of files created by the system—for example, if MT is generating PHP files
183 # that need to have the executable bit turned on, you could set HTMLPerms
184 # to 0777. The default is 0666. You should not change these settings unless
185 # you know what they mean, and what they do.
186 #
187 # HTMLPerms 0777
188 # UploadPerms 0777

(In the code above the line numbers have been added, and the MT explanations to help you locate where you need to make the change)

Change this code, by removing the hash marks (#):

172 DBUmask 0022
173 HTMLUmask 0022
174 UploadUmask 0022
175 DirUmask 0022

Change this code by removing the hashes (#) and changing the permission number:

187 HTMLPerms 0644
188 UploadPerms 0644

Upload this file to your server.

You probably already set your files to be published as php in your publishing settings in the MT admin interface (and hence discovered the dreaded 500).

Step 3

Rebuild your site.

If you check your permissions now in your ftp software you should see that the directory permissions are 755 and the php files 644.

Go have a lookie at your site now. The php pages should be showing up fine and the 500 error should be banished. Yay!

Notes

: the permissions you need to set may be different to the ones in the above explanation.

: this has not been tested yet with dynamic publishing, php includes, or plugins requiring php be used. Will update this as I test them myself.

del.icio.us Favicon Digg Favicon Email Favicon Facebook Favicon StumbleUpon Favicon Technorati Favicon TwitThis Favicon hatena Favicon

up arrow

Next entry: Japanese Phrase of the Day
Previous entry: Holidays the rest of the country apparently has

Added spice....

Commenting is not available in this section entry.