On my local MAMP install, I have a WordPress site, and am trying to get a CakePHP site ( 2.5.6 ) going using their blog tutorial. I want to try CakePHP out and see if it is suitable for a future project.
Interesting portion of folder structure as follows:
htdocs
|_ cakePHPBox
| |_ app
|_ local_blog
The WordPress site was originally installed in the root folder. After moving that, I ended up with an .htaccess file in the htdocs root that contained the following:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^cakePHPBox/(.*)$ /cakePHPBox/$1 [L,QSA]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_URI} !^/cakePHPBox [NC]
RewriteBase /local_blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/cakePHPBox [NC]
RewriteRule . /local_blog/index.php [L]
</IfModule>
# END WordPress
The .htaccess file in htdocs/cakePHPBox looks like this:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /cakePHPBox
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
The .htaccess file in htdocs/cakePHPBox/app looks like this:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /cakePHPBox
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
The .htaccess file in htdocs/cakePHPBox/app/webroot looks like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /cakePHPBox
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
These are modified from the originals; I am trying to account for the subfolder that CakePHP lives in in all of them, and the one in htdocs is also trying to account for WordPress' subfolder.
The WordPress blog works. The cakePHP tutorial doesn't! CakePHP's "landing page" pulls up without problem.
Trying to access the URL http://localhost/cakePHPBox/posts/index
as per the tutorial's instructions gives me this error. I can tell there's trouble because it prints the file across the top of the page instead of executing it, but I don't know why that is happening.
Various existing StackOverflow questions and answers have gotten me this far, but now I'm stuck!