简体   繁体   中英

500 Internal Server Error using SilverStripe

I have a problem with my SilverStripe site after a server upgrade to PHP 5.6. My web host upgraded the server from PHP 5.3 to PHP 5.6 and now a 500 server error occurs on every page.

The message from SilverStripe is:

Sorry, there was a problem with handling your request.

In the server error log files there are no error entries. In the server access log you can see the 500 error:

ERROR: [09/Mar/2016:11:12:07 +0100] "GET /Security/login?BackURL=%2Fadmin HTTP/1.1" 500 11398 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36"

Next entry in file is OK:

[09/Mar/2016:11:12:08 +0100] "GET /themes/ustheme/css/us.style.css HTTP/1.1" 304 0 " http://www.example.com/Security/login?BackURL=%2Fadmin " "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36"

How do I debug and fix this problem?

When switching PHP-version, your cache needs to be flushed. Switch your site to dev-mode to flush without having to logon. Or just delete your cache-directory (or create a root-directory named silverstripe-cache.)

First try to flush the site cache as suggested by Simon Erkelens .

Sometimes flushing the cache will not work. This may be because the SilverStripe version cannot handle the PHP version.

If our site is on a server with cPanel some web hosts allow us to select the PHP version through cPanel. This feature is not on every server with cPanel but hopefully this becomes more common.

Select PHP version may be found in the cPanel software panel:

cPanel  - 选择PHP版截图1

On the PHP selector screen there is a PHP version select box allowing us to select a PHP version. To change PHP version select an option from the PHP version select box and press the Set as current button. Flush the site cache to see if the site now works.

cPanel  - 选择PHP版截图2

I recommend using the newest version of PHP that will work with the SilverStripe site so that it is as secure and stable as possible.

run below command to get rid off from internal server error /dev/build

if your site is http://silverdemo.com

then run command like below

http://silverdemo.com/dev/build

it will rebuild the database and models

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM