CakePHP shows 500 Internal Server Error

2019-08-15 03:21发布

问题:

I'm having a problem with my CakePHP installation.

I was developing it in a subfolder and it was working fine. But, when I move it into the root folder, it's showing 500 Internal Server Error.

For example, it was working fine on: mysite.com/demo/ But, when I move it into the same server root, i.e. mysite.com/ it's showing the error.

CakePHP Version: 2.2

As it was working fine on /demo/ folder, I think the mod_rewrite etc. are working fine, so that confused what's happening with the root folder.

Any Idea?

Thanks in advance.

回答1:

Please check .htaccess file and change if RewriteBase /folder/subfolder to RewriteBase /

like below

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteBase /
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>

and also On the debug mode (\app\Config\core.php) Configure::write('debug',2); for clearing cache for a moment and then off Configure::write('debug',0);