How to set up CakePHP project on windows server

Follow the below steps to successfully get your CakePHP project running along side your WordPress website:

  1. Edit below lines in .htaccess file in the root(Home) directory.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^CakePHPFolder/(.*)$ / CakePHPFolder /$1 [L,QSA]
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

2. Create the web.config file in CakePHP Project folder and put the below code in it.

<?xml version="1.0" encoding="UTF-8"?>
                <rule name="Exclude direct access to webroot/*"
                    <match url="^webroot/(.*)$" ignoreCase="false" />
                    <action type="None" />
                <rule name="Rewrite routed access to assets(img, css, files, js, favicon)"
                    <match url="^(font|img|css|files|js|favicon.ico)(.*)$" />
                    <action type="Rewrite" url="webroot/{R:1}{R:2}"
                      appendQueryString="false" />
                <rule name="Rewrite requested file/folder to index.php"
                    <match url="^(.*)$" ignoreCase="false" />
                    <action type="Rewrite" url="index.php"
                      appendQueryString="true" />

3) In .htaccess file of cakePHP project remove the line RewriteRule ^(\.well-known/.*)$ $1 [L].

Your cakePHP is set up now.

If you are using Mysql8 its not supported to it.

Leave a comment

43 + = 45



Linked In

Copyright © 2020 by Blue Creazione. All rights reserved.