[英]How to run an existing cake php project in my local using xampp server in windows
This is my webroot .htaccess file 这是我的webroot .htaccess文件
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteBase http://localhost/myproject/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
This is project folder .htaccess file 这是项目文件夹.htaccess文件
<IfModule mod_rewrite.c>
#RewriteEngine on
#RewriteRule ^(\.well-known/.*)$ $1 [L]
#RewriteRule ^$ webroot/ [L]
#RewriteRule (.*) webroot/$1 [L]
</IfModule>
This file is in app folder .htaccess file 该文件位于应用程序文件夹.htaccess文件中
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
Can any one help me out with this? 有人可以帮我吗?
Try with below htaccess codes 尝试以下htaccess代码
/var/www/app/webroot/.htaccess /var/www/app/webroot/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
/var/www/app/.htaccess /var/www/app/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
/var/www/.htaccess /var/www/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
There can be following reasons for 500 Internal Server Error in CakePHP application: CakePHP应用程序中的500 Internal Server Error可能有以下原因:
1) Your .htaccess files are not correct.
2) Permissions of folders are not correct. If CakePHP app is Group Writable i.e. 777 then webserver gives 500 error for safety.
3) You are missing Database Connection. Correct database configuration according to Webhost because most of times local and production server databases have different details.
4) Delete the content of your tmp folder. It is best practice that you must delete cache if you move your application from one place to another.
5) For testing purpose debug should be on like configure::write('debug',2);
6) If not succeeded check your Apache Error Log. If using Linux /var/log/apache2/error.log
Hope It Helps, Thanks!! 希望对您有所帮助,谢谢!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.