Import CakePHP Project from online to localhost ( CakePHP Project को localhost मैं कैसे Install करें । )

1. Copy  code zip and database zip from online server
2. Extract code zip into your folder and database files in phpmyadmin
3. Open app config in app/config/database.php file and  change your server name ,username ,password, database according to your localhost
4. Open  app/tmp/cache  folder  and all sub folder in that remove all chache file Important is that DO Not REMOVE Directory structure .
5. Run your site in localhost..
6 .After this please check your htaccess in 3 files first in root folder , second in app folder and final in     app/webroot  folder

For more Information please check this link ..
http://stackoverflow.com/questions/1334746/htaccess-for-cakephp

https://stackoverflow.com/questions/21886795/defining-document-root-in-apache2-cake-php/21887477#21887477

7. Finally my htaccess file in main project folder
    Options +FollowSymlinks

8.Fixing the docroot 
    in Xampp/Apache/Conf/extra/httpd-vhosts.conf

does the above config block need to have: .../app/webroot as the DocumentRoot

Assuming that path exists: yes.

This will fix the broken css/js/images.


<VirtualHost *:80>

ServerAdmin shopcoupons@wp.dev

DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/shopcoupons_git/app/webroot"

ServerName shopcoupons.dev.my

ErrorLog "logs/shopcoupons-error.dev.log"

CustomLog "logs/shopcoupons-common.dev.log" common

</VirtualHost>






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


htaccess files  In  app folder

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

htaccess files in app/webroot  folder

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>



1) Run These commands 

composer update 

composer install

composer dump-autoload

2)  If found issue like this  
" Fatal error: Class 'Mobile_Detect' not found in  E:\xampp\htdocs\cakephp\app\Controller\AppController.php on line 891 "

Use this 
App::import( ); 
Example
App::import('Vendor','aws-autoloader',array('file'=>'autoload.php'));


For more Info check this 
https://stackoverflow.com/questions/11957072/installing-cakephp-2-0-0-in-a-subdirectory



















No comments:

Post a Comment

Pages