Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

500 Internal Server Error
 
Hole
Jr. Member
 
Total Posts:  12
Joined:  2008-04-05
 

I would appreciate some help with this install issue I have. I have searched the site for the solution before posting this thread with no luck.

My server is running php5. My host is JaguarPC.com.

I downloaded Magento and then uploaded it, unzipped the file in Cpanel and then moved all the files to the main directory as the default directory it was in was “/magento”. I then did a 755 cmod to the following files:

magento/var/.htaccess
magento/app/etc
magento/var
magento/media/import

I then went to the main site (http://www.CasualCatalogue.com) to find an internal server error.

I thought that something must have screwed up when extracting or the alike so I deleted all the files that had uploaded and started again. I reuploaded Magento, this time leaving it in the default directory “/magento”. I then did a 755 cmod to the same files as above, I received the same error so I did a 777 cmod to the files mentioned above.

I’m still receiving the error, you can see it here:

http://www.casualcatalogue.com/magento/

I hope you can help with this, thanks in advance!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hole
Jr. Member
 
Total Posts:  12
Joined:  2008-04-05
 

I’ve been told that the issue is something to do with my .htaccess. In public_html, I have a .htaccess file and a .htaccess.sample file. Is this normal?

Here is the code from my main .htaccess file:

############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name
## it might be /cgi-bin/php-cgi

#    Action php5-cgi /cgi-bin/php5-cgi
#    AddHandler php5-cgi .php
#    php_flag cgi.fix_pathinfo on

############################################
## this line is specific for 1and1 hosting

    #AddType x-mapp-php5 .php
    #AddHandler x-mapp-php5 .php

############################################
## default index file

    DirectoryIndex index.php

<IfModule mod_php5.c>

############################################
## adjust memory limit

    
php_value memory_limit 64M
    php_value max_execution_time 18000

############################################
## disable magic quotes for php request vars

    
php_flag magic_quotes_gpc off

############################################
## enable resulting html compression

    #php_flag zlib.output_compression on

###########################################
# disable user agent verification to not break multiple image upload

    
php_flag suhosin.session.cryptua off

</IfModule>

<
IfModule mod_security.c>
###########################################
# disable POST processing to not break multiple image upload

    
SecFilterEngine Off
    SecFilterScanPOST Off
</IfModule>

<
IfModule mod_deflate.c>

############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip

    # Insert filter
    #SetOutputFilter DEFLATE

    # Netscape 4.x has some problems...
    #BrowserMatch ^Mozilla/4 gzip-only-text/html

    # Netscape 4.06-4.08 have some more problems
    #BrowserMatch ^Mozilla/4\.0[678] no-gzip

    # MSIE masquerades as Netscape, but it is fine
    #BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    # Don't compress images
    #SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

    # Make sure proxies don't deliver the wrong content
    #Header append Vary User-Agent env=!dont-vary

</IfModule>

<
IfModule mod_ssl.c>

############################################
## make HTTPS env vars available for CGI mode

    
SSLOptions StdEnvVars

</IfModule>

<
IfModule mod_rewrite.c>

############################################
## enable rewrites

    
Options +FollowSymLinks
    RewriteEngine on

############################################
## you can put here your magento root folder
## path relative to web root

    #RewriteBase /magento/

############################################
## workaround for HTTP authorization
## in CGI environment

    
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

############################################
## always send 404 on missing files in these folders

    
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

############################################
## never rewrite for existing files, directories and links

    
RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond 
%{REQUEST_FILENAME} !-d
    RewriteCond 
%{REQUEST_FILENAME} !-l

############################################
## rewrite everything else to index.php

    
RewriteRule .* index.php [L]

</IfModule>


############################################
## Prevent character encoding issues from server overrides
## If you still have problems, use the second line instead

    
AddDefaultCharset Off
    
#AddDefaultCharset UTF-8

<IfModule mod_expires.c>

############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires

    
ExpiresDefault "access plus 1 year"

</IfModule>

############################################
## By default allow all access

    
Order allow,deny
    Allow from all

############################################
## If running in cluster environment, uncomment this
## http://developer.yahoo.com/performance/rules.html#etags

    #FileETag none

Thanks for the current help!

 
Magento Community Magento Community
Magento Community
Magento Community
 
txkhomes
Jr. Member
 
Total Posts:  5
Joined:  2008-04-05
United States
 

Also verify whether you have suexec you might have to use php.ini instead of htaccess

Usually a 500 is a php value that is not in the right place, ie. htaccess when it should be in shared user php.ini
Your error_log will provide more information to be able to determine what the exact problem is

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hole
Jr. Member
 
Total Posts:  12
Joined:  2008-04-05
 
txkhomes - 05 April 2008 10:49 PM

Also verify whether you have suexec you might have to use php.ini instead of htaccess

Usually a 500 is a php value that is not in the right place, ie. htaccess when it should be in shared user php.ini
Your error_log will provide more information to be able to determine what the exact problem is

Thanks for the reply!

suexec is enabled on the server. I’ve looked at the error_log however it makes no sense to me, can you or anyone else make any sense of it? Here are the contents of my error_log:

[Sun Apr  6 04:44:33 2008] [error] [client 67.195.52.28] client denied by server configuration: /home/casualca/public_html/_vti_pvt
[Sun Apr  6 04
:44:33 2008] [error] [client 67.195.52.28] client denied by server configuration: /home/casualca/public_html/_vti_log
[Sun Apr  6 04
:44:33 2008] [error] [client 67.195.52.28] client denied by server configuration: /home/casualca/public_html/_vti_txt
[Sun Apr  6 04
:44:33 2008] [error] [client 67.195.52.28] client denied by server configuration: /home/casualca/public_html/_vti_cnf
[Sun Apr  6 04
:44:32 2008] [error] [client 74.6.19.168] File does not exist: /home/casualca/public_html/404.shtml
[Sun Apr  6 04
:44:32 2008] [error] [client 74.6.19.168] File does not exist: /home/casualca/public_html/robots.txt
[Sun Apr  6 01
:38:02 2008] [error] [client 24.73.172.150] File does not exist: /home/casualca/public_html/404.shtml
[Sun Apr  6 01
:38:02 2008] [error] [client 24.73.172.150] File does not exist: /home/casualca/public_html/favicon.ico
[Sun Apr  6 01
:38:01 2008] [error] [client 24.73.172.150] File does not exist: /home/casualca/public_html/500.shtml
[Sun Apr  6 01
:38:01 2008] [error] [client 24.73.172.150] Premature end of script headers: /home/casualca/public_html/magento/index.php
SoftException in Application
.cpp:252File "/home/casualca/public_html/magento/index.php" is writeable by group
[Sun Apr  6 00
:15:36 2008] [error] [client 122.100.186.29] File does not exist: /home/casualca/public_html/403.shtml
[Sun Apr  6 00
:15:36 2008] [error] [client 122.100.186.29] attempt to invoke directory as script: /home/casualca/public_html/cgi-bin
[Sun Apr  6 00
:15:28 2008] [error] [client 122.100.186.29] client denied by server configuration: /home/casualca/public_html/_vti_pvt
[Sun Apr  6 00
:15:28 2008] [error] [client 122.100.186.29] client denied by server configuration: /home/casualca/public_html/_vti_log
[Sun Apr  6 00
:15:28 2008] [error] [client 122.100.186.29] client denied by server configuration: /home/casualca/public_html/_vti_txt
[Sun Apr  6 00
:15:28 2008] [error] [client 122.100.186.29] client denied by server configuration: /home/casualca/public_html/_vti_cnf
[Sun Apr  6 00
:14:50 2008] [error] [client 122.100.186.29] File does not exist: /home/casualca/public_html/404.shtml
[Sun Apr  6 00
:14:50 2008] [error] [client 122.100.186.29] File does not exist: /home/casualca/public_html/favicon.ico
[Sun Apr  6 00
:14:49 2008] [error] [client 122.100.186.29] File does not exist: /home/casualca/public_html/500.shtml
[Sun Apr  6 00
:14:49 2008] [error] [client 122.100.186.29] Premature end of script headers: /home/casualca/public_html/magento/index.php
SoftException in Application
.cpp:252File "/home/casualca/public_html/magento/index.php" is writeable by group
 
Magento Community Magento Community
Magento Community
Magento Community
 
soben
Jr. Member
 
Total Posts:  2
Joined:  2008-03-03
 

I had the same problem and similar error log message:

[Sun Apr  6 14:07:32 2008] [error] [client xx.xxx.xxx.xxx] Premature end of script headers: /home/myuser/public_html/magentotest/index.php
SoftException in Application
.cpp:238File "/home/myuser/public_html/magentotest/index.php" is writeable by group

The problem turned out to be that after extracting the zip, the permissions on all my magento files were set to either 775 or 664, but my web host (midphase - shared linux) does not allow permissions to be higher than 755 / 644, or more specifically group and world cannot have write or execute permissions.  (See http://midphasehelp.com/support/questions.php?questionid=297) I would not be surprised if your host is the same.

The solution seems to be to change permissions of index.php to 0644 or 0755.  This worked and the 500 Internal Server Error was gone.

 
Magento Community Magento Community
Magento Community
Magento Community
 
soben
Jr. Member
 
Total Posts:  2
Joined:  2008-03-03
 
soben - 06 April 2008 12:56 PM

The solution seems to be to change permissions of index.php to 0644 or 0755.  This worked and the 500 Internal Server Error was gone.

Okay, so , that much got me through the install process, but now I find that the javascript menus on the backend weren’t working… So, checking the log, I found:

[Sun Apr  6 15:45:58 2008] [error] [client xx.xxx.xxx.xxx] Premature end of script headers: /home/myuser/public_html/magentotest/js/proxy.php
SoftException in Application
.cpp:246Directory "/home/myuser/public_html/magentotest/js" is writeable by group

Can anyone help me interpret this—should I chmod proxy.php and ALL the .php files and directories to 644 and 755?  But if i do so, will magento still run properly?  I’m worried that my host’s permissions restrictions prevent me from running magento…

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hole
Jr. Member
 
Total Posts:  12
Joined:  2008-04-05
 

Thanks again soben, much appreciated.

I’ve just changed the permissions from 664 to 644 and then checked if the error was still there, it was, so I changed it to 755, it is still there with 755.

This is my error_log, I’ve only posted the latest 10 error_logs as it wouldn’t all fit in this post as one:

[Sun Apr  6 15:21:57 2008] [error] [client 98.204.80.231] client denied by server configuration: /home/casualca/public_html/_vti_txt
[Sun Apr  6 15
:21:57 2008] [error] [client 98.204.80.231] client denied by server configuration: /home/casualca/public_html/_vti_cnf
[Sun Apr  6 14
:42:57 2008] [error] [client 78.53.79.229] File does not exist: /home/casualca/public_html/404.shtml
[Sun Apr  6 14
:42:57 2008] [error] [client 78.53.79.229] File does not exist: /home/casualca/public_html/favicon.ico
[Sun Apr  6 14
:42:54 2008] [error] [client 78.53.79.229] File does not exist: /home/casualca/public_html/404.shtml
[Sun Apr  6 14
:42:54 2008] [error] [client 78.53.79.229] File does not exist: /home/casualca/public_html/favicon.ico
[Sun Apr  6 14
:42:50 2008] [error] [client 78.53.79.229] File does not exist: /home/casualca/public_html/404.shtml
[Sun Apr  6 14
:42:50 2008] [error] [client 78.53.79.229] File does not exist: /home/casualca/public_html/favicon.ico
[Sun Apr  6 14
:42:49 2008] [error] [client 78.53.79.229] File does not exist: /home/casualca/public_html/500.shtml
[Sun Apr  6 14
:42:49 2008] [error] [client 78.53.79.229] Premature end of script headers: /home/casualca/public_html/magento/index.php
SoftException in Application
.cpp:252File "/home/casualca/public_html/magento/index.php" is writeable by group

I can’t wait to get Magento running!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hole
Jr. Member
 
Total Posts:  12
Joined:  2008-04-05
 

I have just found this thread http://www.magentocommerce.com/boards/viewthread/1366/

I’m not sure if what setanta describes on how to fix it will solve my issue as in November, I’m sure this version of the script wasn’t released.

Would I be able to use any of the instructions sentanta gave back then for my issue? The .htaccess seems a lot different to mine.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Wikid-Art
Jr. Member
 
Total Posts:  13
Joined:  2008-01-04
 

Hi!

I’m not sure if I can help, but I had the 500 internal server error this morning and sorted it out, so maybe some of this will be helpful?.

I *think* that what happened was my host changed my domain php version default back to version 4 from 5.2 for some reason, so I had to reset it to version 5.2. It might have had something to do with the magento files I uploaded to the root directory, but I’m not sure.

Another thing I did wrong was to install the sample data first (in the media dir) and then set up the mySQL database and user prior to decompressing the core magento files. .(which the correct thing to do)

BUT, when I decompressed the magento core files, I wrote over the sample data directory with the empty media directory. So I think that screwed up my database, which was looking for the original files in the media dir.

Anyway when I sorted both those issues out the installation went fine.

Hope you sort it out !

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gui
Guru
 
Avatar
Total Posts:  588
Joined:  2008-03-09
 

Hi Hole,
I’m on the same host. Both your problems are related to the file permissions.

I hope you know how to use a terminal, if not this is a good time to learn it, probably quicker than manually set the right permissions:

ok in the terminal

# This gets you inside the magento store folder, that is important
cd home/public_html/your_login_name/your_magent_folder

find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
then checkout the wiki to return a couple of files and folders to the correct magento permissions:
http://www.magentocommerce.com/wiki/general/magento_installation_via_ssh

Now you will have a working installation, however I noticed after using magento-connect permissions were changed and I had to do the above again.

I am running the installation with a modified php.ini to have some modules like curl etc. Download the php.ini (make sure you download version 5) from you cPanel and read JagsKnowledge base on how to use that php.ini file.

G’luck mate

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hole
Jr. Member
 
Total Posts:  12
Joined:  2008-04-05
 

Thank you to everyone who assisted me with the issue!

Gui, that worked perfectly, I’ve never used shell access before but I was able to pick it up easily enough.

Thanks again, much appreciated!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Shirokovskiy
Jr. Member
 
Avatar
Total Posts:  28
Joined:  2010-10-21
Russian Federation
 

maybe this will be useful
http://www.magentocommerce.com/boards/viewthread/26347/P15/#t352307

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top