Edit: I know what is causing the problem now, but still no solution. Basically unless the tmp
directory is 777 Cake is unable to write to it so it fails. And if tmp
is 777 then because of maybe some weird security setting PHP doesn't work. Any ideas if this is a possibility and how I can fix it?
Edit 2: Is it possible that because of character encoding the tmp is not 777 its showing ?
garbage characters.
I just migrated my CakePHP app to Amazon AWS (Using a BitNami LAMPstack). I was getting PHP errors saying Could Not Connect to DB (which means PHP is executing).
When I fixed the DB settings it is now printing inline PHP. For example:
<title><?php echo $title_for_layout; ?></title>
is showing in the HTML and the document title is hence a snippet of PHP code!
Please help I'm at a loss. Things I've tried doing:
- Changing AllowOverride to All in the section in/opt/bitnami/apache2/conf/httpd.conf
- Editing my php.ini for short_open_tag=On just in case
- Making sure mod_rewrite is enabled in httpd.conf and that my
htdocs
andapp
folder have the correct.htaccess
files.
Here are my .htaccess files just in case:
htdocs/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
Options All -Indexes
htdocs/app/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
htdocs/app/webroot/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>